ekmungai/eloquent-ifrs

Date is not updating?

waleed-GRT opened this issue · 2 comments

Hello,

When using the "Eloquent-IFRS" package to handle CashPurchase transactions, there seems to be a problem with date handling when we create a record, the date is not being updated correctly. Instead, it always shows today's date.

      $cashPurchase = CashPurchase::create([
            'account_id' => $this->data['bank_account_id'],
            'date' => Carbon::create($this->data['date']), 
            'narration' => $this->data['detail'],
        ]);

        $cashPurchaseLineItem = LineItem::create([
            'account_id' => $this->data['expense_account_id'],
            'description' => $this->data['detail'],
            'amount' => $this->data['amount'],
        ]);

        $cashPurchase->addLineItem($cashPurchaseLineItem);

        $cashPurchase->post();

Your assistance in addressing this issue would be greatly appreciated.

Hi Waleed,

The field should be transaction_date.

Cheers,
Edward

Actually, I followed the example on the documentation page, but changing the 'date' to 'transaction_date' worked for me. Thank you for your help, though.

image