Closed kchizi closed 2 years ago
Just did a PR to fix this issue in the migration file removing vat_id in line items. Kindly merge
Hi @kchizi,
Actually the current master branch already has changes to address this issue by allowing for multiple taxes (VAT, Excise etc) per line item, so please stand by until its ready for release. Cheers, Edward
Any idea when you plan to make a new release with these changes?
@kchizi
I've been on a small break to deal with some personal issues, but I should back at work starting April so probably a month or so after that.
Cheers, Edward
Pushed a fix for this and did a pr by the way
Hi @chrisbaswell and @kchizi,
I'm happy to announce that version 5 of the package is now available.
Cheers, Edward
Some transactions attract levies and other taxes other than VAT. One transaction can have multiple levies for example catering levy. I have tried recording transactions without VAT but seems like it is a constraint. The approach I took was to record the VAT and levy as separate line items but it seems that has also failed.
$journalEntry = JournalEntry::create([ 'account_id' => $clientAccount, 'date' => Carbon::now(), 'narration' => "Sale against invoice ".$transaction->invoice_no." ", 'credited' => false, // main account shouold be debited 'entity_id' => $business->entity_id, 'main_account_amount' => $transaction->final_total ]);
$journalEntry->addLineItem( LineItem::create([ 'account_id' => $subtax->tax_account_id, 'description' => $subtax->name." @ ".$subtax->amount, 'amount' => $taxamount*$quantity, 'entity_id' => $entity_id, // 'quantity' => $quantity, 'credited' => true ]) );
Kindly advice on how to go about this.
Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (*****.
ifrs_line_items
, CONSTRAINTifrs_line_items_vat_id_foreign
FOREIGN KEY (vat_id
) REFERENCESifrs_vats
(id
)) (SQL: insert intoifrs_line_items
(account_id
,amount
,entity_id
,quantity
,credited
,updated_at
,created_at
) values (463, 250, 64, 1, 1, 2021-12-31 01:58:42, 2021-12-31 01:58:42))