Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-6733

Error with Service Product Invoice Lines

    Details

    • Sprint:
      Community Day 4 - 2015

      Description

      I think there is a bug in the creation of invoices for Service Products.

      A Service Product uses the Invoice Item Line Type (InvoiceItemTypeId) 'INV_SPROD_ITEM' and a Finished Good product uses the InvoiceItemTypeId 'INV_FPROD_ITEM'

      If you create a Sales Order for a Service Product then the invoice generated has the line item type for a Finished Goods product which is wrong.

      This is an issue because you can configure Service products to be posted to a different account to Finished Goods products in the GL Account Defaults. (https://localhost:8443/accounting/control/GlAccountSalInvoice?organizationPartyId=Company)

      So currently Service products are being posted using the setup specified for Finished Goods. I think no one has noticed because in the Demo Data the accounts are the same 401000.

      Example
      1) Create a Sales Order for the Service Product SV-1000 using DemoCustomer
      2) Approve the Sales Order
      3) An invoice will automatically be created for the Service Product SV-1000
      4) Click the link to the invoice and you will see that the second column 'Invoice Item Type' says 'Invoice Finished Goods Item (Sales) and it should say 'Invoice Service Product Item (Sales)

      The InvoiceServices.java contains the following, so looks like some possible hardcoding.

      createInvoiceItemContext.put("invoiceItemTypeId", getInvoiceItemType(delegator, (orderItem.getString("orderItemTypeId")), (product == null ? null : product.getString("productTypeId")), invoiceType, "INV_FPROD_ITEM"));
      
      1. OFBIZ-6733.patch
        1 kB
        Rishi Solanki

        Activity

        Hide
        rishisolankii Rishi Solanki added a comment -

        The default value was picked as finished good because there was no corresponding entry available for service product with no physical entry in the InvoiceItemTypeMap.
        As mention by Sharan then system pick the default invoice item type to create invoice for item. After loading the InvoiceItemTypeMap data no code changes requires and system will automatically pick the correct invoice item type from db.

        Note: Issue also exists in trunk and patch is applicable to both trunk and release mentioned in affects version. Thanks!

        Show
        rishisolankii Rishi Solanki added a comment - The default value was picked as finished good because there was no corresponding entry available for service product with no physical entry in the InvoiceItemTypeMap. As mention by Sharan then system pick the default invoice item type to create invoice for item. After loading the InvoiceItemTypeMap data no code changes requires and system will automatically pick the correct invoice item type from db. Note: Issue also exists in trunk and patch is applicable to both trunk and release mentioned in affects version. Thanks!
        Hide
        sharan Sharan Foga added a comment -

        Thanks very much Rishi! I will test the patch in all versions.

        Show
        sharan Sharan Foga added a comment - Thanks very much Rishi! I will test the patch in all versions.
        Hide
        rishisolankii Rishi Solanki added a comment -

        The patch is available which fixes the reported problem. Also similar fix applied for the similar problem in other tickets from where I take the reference for fix are as OFBIZ-6728 and OFBIZ-6829. Thanks!

        Show
        rishisolankii Rishi Solanki added a comment - The patch is available which fixes the reported problem. Also similar fix applied for the similar problem in other tickets from where I take the reference for fix are as OFBIZ-6728 and OFBIZ-6829 . Thanks!
        Hide
        arunpati Arun Patidar added a comment -

        Thanks Sharan Foga for committing the patch. I have verified it on 14.12, 15.12 and trunk. Closing this ticket as changes has been already committed. Tnaks to Rishi Solanki for providing patch.

        Show
        arunpati Arun Patidar added a comment - Thanks Sharan Foga for committing the patch. I have verified it on 14.12, 15.12 and trunk. Closing this ticket as changes has been already committed. Tnaks to Rishi Solanki for providing patch.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Trunk r1720883
        R14.12 r1722261
        R13.04 r1722264

        Show
        jacques.le.roux Jacques Le Roux added a comment - Trunk r1720883 R14.12 r1722261 R13.04 r1722264
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        R12.04 r1728886

        Show
        jacques.le.roux Jacques Le Roux added a comment - R12.04 r1728886

          People

          • Assignee:
            arunpati Arun Patidar
            Reporter:
            sharan Sharan Foga
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Agile