another api fix #46
This commit is contained in:
parent
fc9e62dc8d
commit
90fba987fa
@ -51,6 +51,10 @@ class Invoices extends ApiController
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
if (empty($request['amount'])) {
|
||||
$request['amount'] = 0;
|
||||
}
|
||||
|
||||
$invoice = Invoice::create($request->all());
|
||||
|
||||
$taxes = [];
|
||||
@ -119,7 +123,7 @@ class Invoices extends ApiController
|
||||
}
|
||||
|
||||
if (empty($request['amount'])) {
|
||||
$request['amount'] += $sub_total + $tax_total;
|
||||
$request['amount'] = $sub_total + $tax_total;
|
||||
}
|
||||
|
||||
$invoice->update($request->input());
|
||||
@ -219,7 +223,7 @@ class Invoices extends ApiController
|
||||
}
|
||||
|
||||
if (empty($request['amount'])) {
|
||||
$request['amount'] += $sub_total + $tax_total;
|
||||
$request['amount'] = $sub_total + $tax_total;
|
||||
}
|
||||
|
||||
$invoice->update($request->input());
|
||||
|
@ -331,7 +331,7 @@ class Invoices extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$request['amount'] += $sub_total + $tax_total;
|
||||
$request['amount'] = $sub_total + $tax_total;
|
||||
|
||||
$invoice->update($request->input());
|
||||
|
||||
@ -402,8 +402,6 @@ class Invoices extends Controller
|
||||
|
||||
$request['invoice_status_code'] = 'draft';
|
||||
|
||||
$request['amount'] = 0;
|
||||
|
||||
// Upload attachment
|
||||
$attachment_path = $this->getUploadedFilePath($request->file('attachment'), 'invoices');
|
||||
|
||||
@ -469,9 +467,7 @@ class Invoices extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($request['amount'])) {
|
||||
$request['amount'] += $sub_total + $tax_total;
|
||||
}
|
||||
$request['amount'] = $sub_total + $tax_total;
|
||||
|
||||
$invoice->update($request->input());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user