update invoice, estimate & payment vars

This commit is contained in:
raishvaria
2019-12-12 16:04:12 +05:30
parent 36be395579
commit 5f7401f622
6 changed files with 15 additions and 9 deletions

View File

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