erpnet / ErpNet.FP

ErpNet.FP is a light-weight cross-platform Http server facilitating printing to fiscal printers through simple JSON Api.
BSD Zero Clause License
108 stars 63 forks source link

Rounding with line discount #151

Closed petrovalora closed 4 years ago

petrovalora commented 4 years ago

Hello, While testing the connection and printing notes via ErpNet, we get to the following problem: We submit the following data from our system: Quantity = 1 Price = 25.45 Discount = 10% When submitting a total value of 22.91, the cash register enters a change of 0.01 When submitting a total value of 22.90 gives an error: Payment total amount (22.90) should be the same as the items total amount (22.91)

Is it possible when checking var difference = Math.Abs ​​(paymentAmount - itemsTotalAmount); if (difference> = 0.01m && difference / itemsTotalAmount> 0.00001m) not to round correctly?

We need to know how to round the values ​​in our system in order to achieve adequate printing of receipts.

g-vvv commented 4 years ago

Please read issues #76, #146 .