invoice and bill currency issue some fix
This commit is contained in:
@ -76,7 +76,9 @@ class Invoices extends Controller
|
||||
foreach ($invoice->payments as $item) {
|
||||
$default_amount = $item->amount;
|
||||
|
||||
if ($invoice->currency_code != $item->currency_code) {
|
||||
if ($invoice->currency_code == $item->currency_code) {
|
||||
$amount = (double)$default_amount;
|
||||
} else {
|
||||
$default_amount_model = new InvoicePayment();
|
||||
|
||||
$default_amount_model->default_currency_code = $invoice->currency_code;
|
||||
@ -85,17 +87,17 @@ class Invoices extends Controller
|
||||
$default_amount_model->currency_rate = $_currencies[$item->currency_code];
|
||||
|
||||
$default_amount = (double) $default_amount_model->getDivideConvertedAmount();
|
||||
|
||||
$convert_amount = new InvoicePayment();
|
||||
|
||||
$convert_amount->default_currency_code = $item->currency_code;
|
||||
$convert_amount->amount = $default_amount;
|
||||
$convert_amount->currency_code = $invoice->currency_code;
|
||||
$convert_amount->currency_rate = $_currencies[$invoice->currency_code];
|
||||
|
||||
$amount = (double) $convert_amount->getDynamicConvertedAmount();
|
||||
}
|
||||
|
||||
$convert_amount = new InvoicePayment();
|
||||
|
||||
$convert_amount->default_currency_code = $item->currency_code;
|
||||
$convert_amount->amount = $default_amount;
|
||||
$convert_amount->currency_code = $invoice->currency_code;
|
||||
$convert_amount->currency_rate = $_currencies[$invoice->currency_code];
|
||||
|
||||
$amount = (double) $convert_amount->getDynamicConvertedAmount();
|
||||
|
||||
$paid += $amount;
|
||||
}
|
||||
}
|
||||
@ -892,7 +894,7 @@ class Invoices extends Controller
|
||||
// it should be integer for amount mask
|
||||
$currency->precision = (int) $currency->precision;
|
||||
|
||||
$html = view('incomes.invoices.item', compact('item_row', 'taxes'))->render();
|
||||
$html = view('incomes.invoices.item', compact('item_row', 'taxes', 'currency'))->render();
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
|
Reference in New Issue
Block a user