Fix discount issues. #434
This commit is contained in:
parent
c3487358f1
commit
27f37de489
2 changed files with 5 additions and 2 deletions
|
|
@ -764,7 +764,10 @@ class JobOrderController extends Controller
|
||||||
|
|
||||||
// use invoice object values in a json friendly array
|
// use invoice object values in a json friendly array
|
||||||
$invoice = [
|
$invoice = [
|
||||||
'discount' => number_format($iobj->getDiscount(), 2),
|
// TODO: CMB needs to have no decimal places for discount.
|
||||||
|
// Resq requires the two decimal places since discount is computed.
|
||||||
|
//'discount' => number_format($iobj->getDiscount(), 2),
|
||||||
|
'discount' => number_format($iobj->getDiscount(), 0),
|
||||||
'trade_in' => number_format($iobj->getTradeIn(), 2), // TODO: computations not done yet for this on invoice creator
|
'trade_in' => number_format($iobj->getTradeIn(), 2), // TODO: computations not done yet for this on invoice creator
|
||||||
'price' => number_format($iobj->getVATExclusivePrice(), 2),
|
'price' => number_format($iobj->getVATExclusivePrice(), 2),
|
||||||
'vat' => number_format($iobj->getVAT(), 2),
|
'vat' => number_format($iobj->getVAT(), 2),
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@ class CMBInvoiceGenerator implements InvoiceGeneratorInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if discount is greater than 50 or negative number
|
// check if discount is greater than 50 or negative number
|
||||||
if (($discount > 50) || ($discount < 0))
|
if (($discount > 60) || ($discount < 0))
|
||||||
return 'Invalid discount specified';
|
return 'Invalid discount specified';
|
||||||
|
|
||||||
$criteria->setDiscount($discount);
|
$criteria->setDiscount($discount);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue