![]() | |
| ||||
| I posted this as an accountancy question on another forum. Perhaps it is more of a coding issue. I'm writing an invoicing system in PHP/mySQL at the moment, for my own use, to suit my own business rules. A major premise is that when a quote is accepted, the invoices are generated from that quote, as stage-payment percentages of the overall cost. There can be as many stages as required, each with an abitrary percentage specified (not exceeding 100, obviously). If I quote somebody for €1075.50 and invoice them in 3 stages for 17%, 50% and 33% of the total, these values work out at 182.83500000 537.75000000 and 354.91500000 On an invoice, I believe nobody issues invoices for a fraction of a penny, so these would be rounded to the penny, giving 182.83 537.75 and 354.91 if I round down giving a total invoiced of 1075.49, and 182.84 537.75 and 354.92 if I round up giving a total invoiced of 1075.51 Both these values differ from the quote value of 1075.50 How can I reconcile the error? I could calculate when the last invoice had reached 100 percent and make it's value = totalcost - amount already invoiced. But this adds an unwieldy special case with lots of extra programming. Can anybody suggest a more elegant solution?
__________________ Ones and zeros - which are you? |
| Thread Tools | |
| Display Modes | |
|
|
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| coding errors | bennyhill | Coding Help | 3 | 27-10-2007 04:59 PM |
| webmaster tools verification errors | blacknight | 4 | 24-10-2007 09:27 PM | |
| Spamhaus errors blocking my email? | ButtermilkJack | Server / Technical Administration Tips and Queries | 3 | 07-03-2007 03:42 PM |
| Accounting Package | Amateur | The Business Aspects of Web Work | 4 | 29-11-2006 10:26 PM |