Fix discount issues. #434

This commit is contained in:
Korina Cordero 2020-07-03 08:14:12 +00:00
parent c3487358f1
commit 27f37de489
2 changed files with 5 additions and 2 deletions

View file

@ -764,7 +764,10 @@ class JobOrderController extends Controller
// use invoice object values in a json friendly array
$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
'price' => number_format($iobj->getVATExclusivePrice(), 2),
'vat' => number_format($iobj->getVAT(), 2),

View file

@ -270,7 +270,7 @@ class CMBInvoiceGenerator implements InvoiceGeneratorInterface
}
// check if discount is greater than 50 or negative number
if (($discount > 50) || ($discount < 0))
if (($discount > 60) || ($discount < 0))
return 'Invalid discount specified';
$criteria->setDiscount($discount);