formatting

This commit is contained in:
Denis Duliçi
2020-06-10 16:29:55 +03:00
parent 8b7ee416a6
commit b0843151b1
2 changed files with 12 additions and 8 deletions

View File

@ -87,11 +87,15 @@ abstract class DocumentModel extends Model
return false;
}
static $currencies;
$paid = 0;
$reconciled = $reconciled_amount = 0;
if ($this->transactions->count()) {
$currencies = Currency::enabled()->pluck('rate', 'code')->toArray();
if (empty($currencies)) {
$currencies = Currency::enabled()->pluck('rate', 'code')->toArray();
}
foreach ($this->transactions as $item) {
if ($this->currency_code == $item->currency_code) {