refs #412 Added payment check currency

This commit is contained in:
cuneytsenturk 2018-07-10 17:21:40 +03:00
parent 51b3e37856
commit 7641d7e315
2 changed files with 32 additions and 8 deletions

View File

@ -50,9 +50,15 @@ class Invoices extends Controller
$paid = 0;
foreach ($invoice->payments as $item) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->amount;
$paid += $item->getDynamicConvertedAmount();
if ($invoice->currency_code != $item->currency_code) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->getDynamicConvertedAmount();
}
$paid += $amount;
}
$invoice->paid = $paid;
@ -118,9 +124,15 @@ class Invoices extends Controller
$paid = 0;
foreach ($invoice->payments as $item) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->amount;
$paid += $item->getDynamicConvertedAmount();
if ($invoice->currency_code != $item->currency_code) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->getDynamicConvertedAmount();
}
$paid += $amount;
}
$invoice->paid = $paid;

View File

@ -69,9 +69,15 @@ class Invoices extends Controller
$paid = 0;
foreach ($invoice->payments as $item) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->amount;
$paid += $item->getDynamicConvertedAmount();
if ($invoice->currency_code != $item->currency_code) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->getDynamicConvertedAmount();
}
$paid += $amount;
}
$invoice->paid = $paid;
@ -821,9 +827,15 @@ class Invoices extends Controller
$paid = 0;
foreach ($invoice->payments as $item) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->amount;
$paid += $item->getDynamicConvertedAmount();
if ($invoice->currency_code != $item->currency_code) {
$item->default_currency_code = $invoice->currency_code;
$amount = $item->getDynamicConvertedAmount();
}
$paid += $amount;
}
$invoice->paid = $paid;