diff --git a/app/Classes/Modules/Exports/Services/ExportsInvoiceTransactions.php b/app/Classes/Modules/Exports/Services/ExportsInvoiceTransactions.php index 0f46ae6c..2474df77 100644 --- a/app/Classes/Modules/Exports/Services/ExportsInvoiceTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsInvoiceTransactions.php @@ -23,6 +23,7 @@ class ExportsInvoiceTransactions implements FromQuery, WithHeadings, WithHeading use Exportable; private $request; + private $counter = 1; public function __construct(Request $request) { @@ -70,6 +71,17 @@ class ExportsInvoiceTransactions implements FromQuery, WithHeadings, WithHeading { $row = null; + $logArray = []; + $logArray['counter'] = $this->counter; + $this->counter += 1; + $logArray['system'] = $transaction->system; + $logArray['StatementTransactionOwner_id'] = $transaction->id; + $logArray = json_encode($logArray); + + $filePath = storage_path('logs/exports_invoice_transactions.log'); + $textToAppend = Carbon::now()->format('[Y-m-d H:i:s]') . ' ' . $logArray . PHP_EOL; + file_put_contents($filePath, $textToAppend, FILE_APPEND); + if($transaction->system == 'EXCHANGE') { $row = (App()->make($transaction->owner_type))->where('id', $transaction->owner_id)->first(); $company = $row->type === TransactionType::PAYMENT ? $row->owner->company : $row->owner->owner;