@lang('crm.statement_heading_date') | @lang('crm.statement_heading_details') | @lang('crm.statement_heading_amount') | @lang('crm.statement_heading_payments') | @lang('crm.statement_heading_balance') | @foreach($statement['result'] as $item)
---|---|---|---|---|
{{ $item['date'] }} | {!! $item['detail'] !!} | @php if(isset($item['invoice_id'])) { echo app_format_money($item['invoice_amount'], $statement['currency'], true); } else if(isset($item['credit_note_id'])) { echo app_format_money($item['credit_note_amount'], $statement['currency'], true); } @endphp | @php if(isset($item['payment_id'])) { echo app_format_money($item['payment_total'], $statement['currency'], true); } else if(isset($item['credit_note_refund_id'])) { echo app_format_money($item['refund_amount'], $statement['currency'], true); } @endphp | @php $tmpBeginningBalance = 0; if(isset($item['invoice_id'])) { $tmpBeginningBalance = ($tmpBeginningBalance + $item['invoice_amount']); } else if(isset($item['payment_id'])){ $tmpBeginningBalance = ($tmpBeginningBalance - $item['payment_total']); } else if(isset($item['credit_note_id'])) { $tmpBeginningBalance = ($tmpBeginningBalance - $item['credit_note_amount']); } else if(isset($item['credit_note_refund_id'])) { $tmpBeginningBalance = ($tmpBeginningBalance + $item['refund_amount']); } if(!isset($item['credit_id'])){ echo app_format_money($tmpBeginningBalance, $statement['currency'], true); } @endphp |