ekmungai / eloquent-ifrs

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

month must be between 0 and 99, 2023 given #134

Closed AAUU-Ansari closed 1 year ago

AAUU-Ansari commented 1 year ago

Dear Sir,

I am getting this error when I try to save the first cash sale transaction
using this code $cashSale = CashSale::create([ 'account_id' => $bankAccount->id, 'date' => Carbon::now(), 'narration' => "Example Cash Sale", ]); // Intermediate save does not record the transaction in the Ledger

AAUU-Ansari commented 1 year ago

and many date formats tried but still getting that error

composer update and composer dump also tried

ekmungai commented 1 year ago

Hi Ansari, I think there's a typo in the readme. Could you try replacing 'date' => Carbon::now(), with 'transaction_date' => Carbon::now(), Edward

AAUU-Ansari commented 1 year ago

i am tried that code ( 'transaction_date' => Carbon::now() ) but still getting this error

On Wed, Jun 14, 2023 at 11:11 PM Edward Mungai @.***> wrote:

Hi Ansari, I think there's a typo in the readme. Could you try replacing 'date' => Carbon::now(), with 'transaction_date' => Carbon::now(), Edward

— Reply to this email directly, view it on GitHub https://github.com/ekmungai/eloquent-ifrs/issues/134#issuecomment-1591761177, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZJ3QZHIKCIEKTLQV6X37VTXLH5EJANCNFSM6AAAAAAZGXLICE . You are receiving this because you commented.Message ID: @.***>

ekmungai commented 1 year ago

Hmm. That's very strange. Do you mind sharing the whole code from the start?

AAUU-Ansari commented 1 year ago

after commenting ( 'transaction_date' => Carbon::now() ) this code Laravel shows again that error, I think when we call CashSale class Laravel through imagery that error

AAUU-Ansari commented 1 year ago

use IFRS\Models\Account; use IFRS\Models\Transaction; use IFRS\Transactions\CashSale; use IFRS\models\LineItem;

    $cashSale = CashSale::create([
        'account_id' => 4,
        //'transaction_date' => Carbon::now(),
        'narration' => "Example Cash Sale",
    ]);
    $cashSaleLineItem = LineItem::create([
        'account_id' => 5,
        'narration' => "Example Cash Sale Line Item",
        'quantity' => 1,
        'amount' => 100,
    ]);

    $cashSaleLineItem->addVat($outputVat);
    $cashSale->addLineItem($cashSaleLineItem);
    $cashSale->post(); // This posts the Transaction to the Ledger
AAUU-Ansari commented 1 year ago

Hmm. That's very strange. Do you mind sharing the whole code from the start?

Dear any update about that issue

ekmungai commented 1 year ago

Hi Ansari,

Its really hard to tell from just the snippet you shared. Could you share the entire stacktrace of the error?

AAUU-Ansari commented 1 year ago

er

AAUU-Ansari commented 1 year ago

after upgrading Laravel 9 to 10 but again getting that error

AAUU-Ansari commented 1 year ago

Dear Ekmungai/Eloquent-Ifrs can you send me a copy of the running project with basics

On Fri, Jun 16, 2023 at 10:16 PM Edward Mungai @.***> wrote:

Hi Ansari,

Its really hard to tell from just the snippet you shared. Could you share the entire stacktrace of the error?

— Reply to this email directly, view it on GitHub https://github.com/ekmungai/eloquent-ifrs/issues/134#issuecomment-1595002616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZJ3QZF6U76EIZSO2X3NAZTXLSIFJANCNFSM6AAAAAAZGXLICE . You are receiving this because you commented.Message ID: @.***>

ekmungai commented 1 year ago

Hi Ansari,

Before I do that, could you please tell me the value of the year_start column in the entities table?

Cheers

AAUU-Ansari commented 1 year ago

Hi Ansari,

Before I do that, could you please tell me the value of the year_start column in the entities table?

Cheers

2023

ekmungai commented 1 year ago

That is exatly your problem. Year start is supposed to be the month which the financial year of the entity starts, i.e. between 1 (for January) and 12 (For December)

AAUU-Ansari commented 1 year ago

That is exatly your problem. Year start is supposed to be the month which the financial year of the entity starts, i.e. between 1 (for January) and 12 (For December)

Bundle of Thanks, Sir. May Allah increase your knowledge