Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 9960ac0

Browse files
committed
Implement line item discounts
1 parent 6e76b7b commit 9960ac0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/Plane2Ninja/Transformers/InvoiceItemTransformer.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ class InvoiceItemTransformer extends BaseTransformer
99

1010
/*
1111
*
12-
* Invoice plane has the ability to implement discounts on line items,
13-
* this is an issue as this data cannot be translated across to Invoice Ninja
14-
*
15-
* The solution is to carry over the line item discounts into the invoice discount field.
16-
* This will need to be calculated.
17-
*
12+
* Line item discounts now implemented
1813
*
1914
*/
2015

@@ -29,6 +24,7 @@ public function transform(InvoiceItem $item)
2924
'tax_name1' => $this->getTaxName($item),
3025
'tax_rate1' => $this->getTaxRate($item),
3126
'invoice_item_type_id' => 1,
27+
'discount' => $item->item_discount_amount ? $item->item_discount_amount : 0,
3228
];
3329
}
3430

0 commit comments

Comments
 (0)