Add discount per item for invoice

This commit is contained in:
Burak Çakırel
2020-03-21 04:42:45 +03:00
parent 307e93c53c
commit a1ccfc8b22
15 changed files with 235 additions and 60 deletions

View File

@ -40,7 +40,7 @@ class CreateInvoiceItem extends Job
// Apply discount to amount
if (!empty($this->request['discount'])) {
$item_discounted_amount = $item_amount - ($item_amount * ($this->request['discount'] / 100));
$item_discounted_amount = $item_amount -= ($item_amount * ($this->request['discount'] / 100));
}
$tax_amount = 0;
@ -138,6 +138,7 @@ class CreateInvoiceItem extends Job
'quantity' => (double) $this->request['quantity'],
'price' => (double) $this->request['price'],
'tax' => $item_tax_total,
'discount_rate' => $this->request['discount'],
'total' => $item_amount,
]);