Merge branch 'master'

This commit is contained in:
Mohit Panjwani
2019-12-12 20:42:17 +05:30
14 changed files with 62 additions and 46 deletions

View File

@ -60,9 +60,10 @@ class EstimatesController extends Controller
$estimate_num_auto_generate = CompanySetting::getSetting('estimate_auto_generate', $request->header('company')); $estimate_num_auto_generate = CompanySetting::getSetting('estimate_auto_generate', $request->header('company'));
$nextEstimateNumberAttribute = null; $nextEstimateNumberAttribute = null;
$nextEstimateNumber = Estimate::getNextEstimateNumber($estimate_prefix);
if ($estimate_num_auto_generate == "YES") { if ($estimate_num_auto_generate == "YES") {
$nextEstimateNumberAttribute = Estimate::getNextEstimateNumber($estimate_prefix); $nextEstimateNumberAttribute = $nextEstimateNumber;
} }
$tax_per_item = CompanySetting::getSetting('tax_per_item', $request->header('company')); $tax_per_item = CompanySetting::getSetting('tax_per_item', $request->header('company'));
@ -71,7 +72,8 @@ class EstimatesController extends Controller
return response()->json([ return response()->json([
'customers' => $customers, 'customers' => $customers,
'nextEstimateNumber' => $nextEstimateNumberAttribute, 'nextEstimateNumberAttribute' => $nextEstimateNumberAttribute,
'nextEstimateNumber' => $estimate_prefix.'-'.$nextEstimateNumber,
'taxes' => Tax::whereCompany($request->header('company'))->latest()->get(), 'taxes' => Tax::whereCompany($request->header('company'))->latest()->get(),
'items' => Item::whereCompany($request->header('company'))->get(), 'items' => Item::whereCompany($request->header('company'))->get(),
'tax_per_item' => $tax_per_item, 'tax_per_item' => $tax_per_item,

View File

@ -70,13 +70,15 @@ class InvoicesController extends Controller
$invoice_num_auto_generate = CompanySetting::getSetting('invoice_auto_generate', $request->header('company')); $invoice_num_auto_generate = CompanySetting::getSetting('invoice_auto_generate', $request->header('company'));
$nextInvoiceNumberAttribute = null; $nextInvoiceNumberAttribute = null;
$nextInvoiceNumber = Invoice::getNextInvoiceNumber($invoice_prefix);
if ($invoice_num_auto_generate == "YES") { if ($invoice_num_auto_generate == "YES") {
$nextInvoiceNumberAttribute = Invoice::getNextInvoiceNumber($invoice_prefix); $nextInvoiceNumberAttribute = $nextInvoiceNumber;
} }
return response()->json([ return response()->json([
'nextInvoiceNumber' => $nextInvoiceNumberAttribute, 'nextInvoiceNumberAttribute' => $nextInvoiceNumberAttribute,
'nextInvoiceNumber' => $invoice_prefix.'-'.$nextInvoiceNumber,
'items' => Item::with('taxes')->whereCompany($request->header('company'))->get(), 'items' => Item::with('taxes')->whereCompany($request->header('company'))->get(),
'invoiceTemplates' => InvoiceTemplate::all(), 'invoiceTemplates' => InvoiceTemplate::all(),
'tax_per_item' => $tax_per_item, 'tax_per_item' => $tax_per_item,

View File

@ -56,16 +56,18 @@ class PaymentController extends Controller
$nextPaymentNumberAttribute = null; $nextPaymentNumberAttribute = null;
$nextPaymentNumber = Payment::getNextPaymentNumber($payment_prefix);
if ($payment_num_auto_generate == "YES") { if ($payment_num_auto_generate == "YES") {
$nextPaymentNumberAttribute = Payment::getNextPaymentNumber($payment_prefix); $nextPaymentNumberAttribute = $nextPaymentNumber;
} }
return response()->json([ return response()->json([
'customers' => User::where('role', 'customer') 'customers' => User::where('role', 'customer')
->whereCompany($request->header('company')) ->whereCompany($request->header('company'))
->get(), ->get(),
'nextPaymentNumber' => $nextPaymentNumberAttribute, 'nextPaymentNumberAttribute' => $nextPaymentNumberAttribute,
'nextPaymentNumber' => $payment_prefix.'-'.$nextPaymentNumber,
'payment_prefix' => $payment_prefix 'payment_prefix' => $payment_prefix
]); ]);
} }

View File

@ -582,7 +582,7 @@ export default {
this.newEstimate.expiry_date = moment(today).add(7, 'days').toString() this.newEstimate.expiry_date = moment(today).add(7, 'days').toString()
this.itemList = response.data.items this.itemList = response.data.items
this.estimatePrefix = response.data.estimate_prefix this.estimatePrefix = response.data.estimate_prefix
this.estimateNumAttribute = response.data.nextEstimateNumber this.estimateNumAttribute = response.data.nextEstimateNumberAttribute
} }
this.initLoading = false this.initLoading = false
}, },

View File

@ -582,7 +582,7 @@ export default {
this.newInvoice.due_date = moment(today).add(7, 'days').toString() this.newInvoice.due_date = moment(today).add(7, 'days').toString()
this.itemList = response.data.items this.itemList = response.data.items
this.invoicePrefix = response.data.invoice_prefix this.invoicePrefix = response.data.invoice_prefix
this.invoiceNumAttribute = response.data.nextInvoiceNumber this.invoiceNumAttribute = response.data.nextInvoiceNumberAttribute
} }
this.initLoading = false this.initLoading = false
}, },

View File

@ -309,7 +309,7 @@ export default {
} else { } else {
let response = await this.fetchCreatePayment() let response = await this.fetchCreatePayment()
this.customerList = response.data.customers this.customerList = response.data.customers
this.paymentNumAttribute = response.data.nextPaymentNumber this.paymentNumAttribute = response.data.nextPaymentNumberAttribute
this.paymentPrefix = response.data.payment_prefix this.paymentPrefix = response.data.payment_prefix
this.formData.payment_date = moment(new Date()).toString() this.formData.payment_date = moment(new Date()).toString()
} }

View File

@ -3,9 +3,11 @@
<head> <head>
<title>Estimate</title> <title>Estimate</title>
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}} {{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css"> <style type="text/css">
body { body {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
} }
html { html {
@ -58,13 +60,13 @@
margin-left:160px; margin-left:160px;
} }
.header { .header {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 20px; font-size: 20px;
color: rgba(0, 0, 0, 0.7); color: rgba(0, 0, 0, 0.7);
} }
.TextColor1 { .TextColor1 {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
} }
@ -339,7 +341,7 @@
} }
.notes { .notes {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
font-size: 12px; font-size: 12px;
@ -352,7 +354,7 @@
} }
.notes-label { .notes-label {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 15px; font-size: 15px;

View File

@ -3,9 +3,11 @@
<head> <head>
<title>Estimate</title> <title>Estimate</title>
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}} {{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css"> <style type="text/css">
body { body {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
} }
html { html {
@ -62,13 +64,13 @@
margin-left:160px; margin-left:160px;
} }
.header { .header {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 20px; font-size: 20px;
color: rgba(0, 0, 0, 0.7); color: rgba(0, 0, 0, 0.7);
} }
.TextColor1 { .TextColor1 {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
} }
@ -364,7 +366,7 @@
} }
.notes { .notes {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
font-size: 12px; font-size: 12px;
@ -377,7 +379,7 @@
} }
.notes-label { .notes-label {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 15px; font-size: 15px;

View File

@ -3,9 +3,11 @@
<head> <head>
<title>Estimate</title> <title>Estimate</title>
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}} {{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css"> <style type="text/css">
body { body {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
} }
html { html {
@ -64,13 +66,13 @@
margin-left:160px; margin-left:160px;
} }
.header { .header {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 20px; font-size: 20px;
color: rgba(0, 0, 0, 0.7); color: rgba(0, 0, 0, 0.7);
} }
.TextColor1 { .TextColor1 {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
} }
@ -372,7 +374,7 @@
} }
.notes { .notes {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
font-size: 12px; font-size: 12px;
@ -385,7 +387,7 @@
} }
.notes-label { .notes-label {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 15px; font-size: 15px;

View File

@ -3,9 +3,11 @@
<head> <head>
<title>Invoice</title> <title>Invoice</title>
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}} {{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css"> <style type="text/css">
body { body {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
} }
html { html {
@ -59,13 +61,13 @@
margin-left:160px; margin-left:160px;
} }
.header { .header {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 20px; font-size: 20px;
color: rgba(0, 0, 0, 0.7); color: rgba(0, 0, 0, 0.7);
} }
.TextColor1 { .TextColor1 {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
} }
@ -346,7 +348,7 @@
} }
.notes { .notes {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
font-size: 12px; font-size: 12px;
@ -359,7 +361,7 @@
} }
.notes-label { .notes-label {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 15px; font-size: 15px;
@ -416,9 +418,8 @@
<div class="bill-add"> <div class="bill-add">
<div class="bill-address-container"> <div class="bill-address-container">
@include('app.pdf.invoice.partials.billing-address') @include('app.pdf.invoice.partials.billing-address')
</div> </div>
@if($invoice->user->billingaddress->name || $invoice->user->billingaddress->address_street_1 || $invoice->user->billingaddress->address_street_2 || $invoice->user->billingaddress->country || $invoice->user->billingaddress->state || $invoice->user->billingaddress->city || $invoice->user->billingaddress->zip || $invoice->user->billingaddress->phone) @if($invoice->user->billingaddress && ($invoice->user->billingaddress->name || $invoice->user->billingaddress->address_street_1 || $invoice->user->billingaddress->address_street_2 || $invoice->user->billingaddress->country || $invoice->user->billingaddress->state || $invoice->user->billingaddress->city || $invoice->user->billingaddress->zip || $invoice->user->billingaddress->phone))
<div class="ship-address-container"> <div class="ship-address-container">
@else @else
<div class="ship-address-container " style="float:left;padding-left:0px;"> <div class="ship-address-container " style="float:left;padding-left:0px;">

View File

@ -3,9 +3,10 @@
<head> <head>
<title>Invoice</title> <title>Invoice</title>
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}} {{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css"> <style type="text/css">
body { body {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
} }
html { html {
@ -61,13 +62,13 @@
margin-left:160px; margin-left:160px;
} }
.header { .header {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 20px; font-size: 20px;
color: rgba(0, 0, 0, 0.7); color: rgba(0, 0, 0, 0.7);
} }
.TextColor1 { .TextColor1 {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
} }
@ -373,7 +374,7 @@
} }
.notes { .notes {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
font-size: 12px; font-size: 12px;
@ -386,7 +387,7 @@
} }
.notes-label { .notes-label {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 15px; font-size: 15px;
@ -431,7 +432,7 @@
<div class="ship-address-container"> <div class="ship-address-container">
@include('app.pdf.invoice.partials.shipping-address') @include('app.pdf.invoice.partials.shipping-address')
</div> </div>
@if($invoice->user->shippingaddress->name || $invoice->user->shippingaddress->address_street_1 || $invoice->user->shippingaddress->address_street_2 || $invoice->user->shippingaddress->country || $invoice->user->shippingaddress->state || $invoice->user->shippingaddress->city || $invoice->user->shippingaddress->zip || $invoice->user->phone) @if($invoice->user->shippingaddress && ($invoice->user->shippingaddress->name || $invoice->user->shippingaddress->address_street_1 || $invoice->user->shippingaddress->address_street_2 || $invoice->user->shippingaddress->country || $invoice->user->shippingaddress->state || $invoice->user->shippingaddress->city || $invoice->user->shippingaddress->zip || $invoice->user->phone))
<div class="bill-address-container"> <div class="bill-address-container">
@else @else
<div class="bill-address-container" style="float:right;padding-right:0px;"> <div class="bill-address-container" style="float:right;padding-right:0px;">

View File

@ -3,9 +3,11 @@
<head> <head>
<title>Invoice</title> <title>Invoice</title>
{{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}} {{-- <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet"> --}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css"> <style type="text/css">
body { body {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
} }
html { html {
@ -64,13 +66,13 @@
margin-left:160px; margin-left:160px;
} }
.header { .header {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 20px; font-size: 20px;
color: rgba(0, 0, 0, 0.7); color: rgba(0, 0, 0, 0.7);
} }
.TextColor1 { .TextColor1 {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
} }
@ -382,7 +384,7 @@
} }
.notes { .notes {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
font-size: 12px; font-size: 12px;
@ -395,7 +397,7 @@
} }
.notes-label { .notes-label {
font-family: 'Roboto', sans-serif; font-family: "DejaVu Sans";
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 15px; font-size: 15px;
@ -436,7 +438,7 @@
<div style="float:left;"> <div style="float:left;">
@include('app.pdf.invoice.partials.billing-address') @include('app.pdf.invoice.partials.billing-address')
</div> </div>
@if($invoice->user->billingaddress->name || $invoice->user->billingaddress->address_street_1 || $invoice->user->billingaddress->address_street_2 || $invoice->user->billingaddress->country || $invoice->user->billingaddress->state || $invoice->user->billingaddress->city || $invoice->user->billingaddress->zip || $invoice->user->billingaddress->phone) @if($invoice->user->billingaddress && ($invoice->user->billingaddress->name || $invoice->user->billingaddress->address_street_1 || $invoice->user->billingaddress->address_street_2 || $invoice->user->billingaddress->country || $invoice->user->billingaddress->state || $invoice->user->billingaddress->city || $invoice->user->billingaddress->zip || $invoice->user->billingaddress->phone))
<div style="float:right;"> <div style="float:right;">
@else @else
<div style="float:left;"> <div style="float:left;">

View File

@ -3,6 +3,6 @@
<div class="notes-label"> <div class="notes-label">
Notes Notes
</div> </div>
{{$invoice->notes}} {!! $invoice->notes !!}
</div> </div>
@endif @endif