ekmungai / eloquent-ifrs

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

Jurnal Entry example? #53

Closed shahonseven closed 3 years ago

shahonseven commented 3 years ago

Hi @ekmungai

How do I create journal entry as below?

Wave-Journal-Entry

Thank you!

ekmungai commented 3 years ago

Hi @shahonseven,

You could do it like this:

use IFRS\Transactions\JournalEntry;
use IFRS\models\LineItem;

$transaction = JournalEntry::create([
    'account_id' => $AccumulatedArmotizationAccount->id,
    'date' => Carbon::parse('2012-02-02'),
    'narration' => "Depreciation of Mac",
])`

$lineItem = LineItem::create([
    'vat_id' => $vat->id, // 0 rate
    'account_id' => $depreciationExpenseAccount->id,
    'narration' => "Depreciation Expense",
    'quantity' => 1,
    'amount' => 1000,
]);

$transaction ->addLineItem($lineItem );
$transaction ->post();