ekmungai / eloquent-ifrs

Eloquent Double Entry Accounting with a focus on IFRS Compliant Reporting
MIT License
332 stars 67 forks source link

Date is not updating? #152

Closed waleed-GRT closed 10 months ago

waleed-GRT commented 10 months ago

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.

ekmungai commented 10 months ago

Hi Waleed,

The field should be transaction_date.

Cheers, Edward

waleed-GRT commented 10 months ago

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