You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Christian Geisert (JIRA)" <ji...@apache.org> on 2014/04/23 13:10:15 UTC

[jira] [Updated] (OFBIZ-5622) Incorrect creation logic for ShipmentItemBilling records

     [ https://issues.apache.org/jira/browse/OFBIZ-5622?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Geisert updated OFBIZ-5622:
-------------------------------------

    Attachment: Invoice-ShipmentItemBilling-trunk.diff

Yes, I think you are reading this correct, i.e. this is a bug.I'll attach a patch (is on my todo list for quite some time....)

> Incorrect creation logic for ShipmentItemBilling records
> --------------------------------------------------------
>
>                 Key: OFBIZ-5622
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5622
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Priority: Minor
>         Attachments: Invoice-ShipmentItemBilling-trunk.diff
>
>
> When invoice is created the following code is run for each invoice item:
> {code}
> if ("ItemIssuance".equals(currentValue.getEntityName())) {
>   List<GenericValue> shipmentItemBillings = delegator.findByAnd("ShipmentItemBilling", UtilMisc.toMap("shipmentId", currentValue.get("shipmentId")), null, false);
>   if (UtilValidate.isEmpty(shipmentItemBillings)) {
>     // create the ShipmentItemBilling record
>     GenericValue shipmentItemBilling = delegator.makeValue("ShipmentItemBilling", UtilMisc.toMap("invoiceId", invoiceId, "invoiceItemSeqId", invoiceItemSeqId));
>     shipmentItemBilling.put("shipmentId", currentValue.get("shipmentId"));
>     shipmentItemBilling.put("shipmentItemSeqId", currentValue.get("shipmentItemSeqId"));
>     shipmentItemBilling.create();
>   }
> }
> {code}
> If I read it correctly, this will only create one ShipmentItemBilling for the first InvoiceItem only, i.e. 
> one ShipmentItemBilling record for each invoiceId and shipmentId and several invoiceItemSeqId will be missing it
> The good news is that ShipmentItemBilling is not used much currently but until the bug is fixed the ShipmentItemBilling entity will not contain reliable information.



--
This message was sent by Atlassian JIRA
(v6.2#6252)