[ https://issues.apache.org/jira/browse/OFBIZ-1222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844718#action_12844718 ]
Bob Morley commented on OFBIZ-1222: ----------------------------------- I know this one is pretty old - but we ran into this exact situation in our application. We have a "POS" type application where you can sell digital goods (gift cards) along with a bunch of finished goods. If one has their product store to automatically invoice digital goods and you create an order through the POS with both finished and digital goods, an invoice is cut for the digital good and then (because the transaction is face to face) the CheckOutHelper -> completeOrder is executed which runs the createOrderInvoice. This service does not check to see if the items have already been billed and as a result, creates an invoice that also includes the digital items (double invoicing them). I suspect if you the POS and configure it this way you can duplicate the problem in our stock Ofbiz application. I have manually applied this old patch to OrderServices in our source code and was able to run it and have it no longer duplicate the items in the invoice. (Now I need to figure out the problem with the payment applications). :) I would +1 for putting this in; it does resolve the double invoicing issue -- I can not comment on the functionality around rentals. > Improvements while creating invoice for order > --------------------------------------------- > > Key: OFBIZ-1222 > URL: https://issues.apache.org/jira/browse/OFBIZ-1222 > Project: OFBiz > Issue Type: Improvement > Components: accounting > Reporter: Rashko Rejmer > Priority: Minor > Attachments: InvoiceServices.patch > > > I have made patch that adds 2 improvements to the > InvoiceServices.createInvoiceForOrder service: > - this method doesn't checks if the billItems Map contains already invoiced > items. This is not visible through the UI. In all places where this service > is invoked they are passed not invoiced order items. This improvement will > prevent double invoicing if only part of one order item was invoiced and we > try to invoice the second part(e.g if we bought 5 x GZ-1000 products and we > invoice only 2 of them, then we try to invoice the rest - 3); > - now quantities of rental order items are calculated correctly. If one > order items rents fixed asset for 2 days the quantity of the invoice item > should be multiplied by 2. The same is valid for adjustment quantities for > additional charges for second and n-th person; > - some cleanups - variables that are not used any more; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.