mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
update export booking transaction add in supplier name
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Transaction;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
@@ -29,7 +30,8 @@ class ExportsBookingTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
'Ref No',
|
||||
'Creted Date',
|
||||
'Amount',
|
||||
'Rate'
|
||||
'Rate',
|
||||
'Supplier'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -54,11 +56,8 @@ class ExportsBookingTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
*/
|
||||
public function map($transaction): array
|
||||
{
|
||||
if ($transaction->owner->owner == null){
|
||||
$refNo = $transaction->owner->marking;
|
||||
} else {
|
||||
$refNo = $transaction->owner->owner->marking;
|
||||
}
|
||||
$supplierName = Company::where('id', $transaction->issuer)->get()->first()->name;
|
||||
$refNo = $transaction->owner->owner == null ? $transaction->owner->marking : $transaction->owner->owner->marking;
|
||||
|
||||
$createdAt = $transaction->created_at->format('d-m-Y');
|
||||
$amount = $transaction->amount;
|
||||
@@ -69,6 +68,7 @@ class ExportsBookingTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
$createdAt,
|
||||
$amount,
|
||||
$rate,
|
||||
$supplierName
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user