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

Resolve address from InvoiceWorker not respect the invoice date

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • Trunk
    • None
    • accounting
    • None

    Description

      When you edit an invoice pdf, the different addresses are resolved by the InvoiceWorker with the method getInvoiceAddressByType.

      public static GenericValue getInvoiceAddressByType(GenericValue invoice, String contactMechPurposeTypeId, boolean fetchPartyAddress) {

      This method check first on the InvoiceContactMech table and if no address found, check directly on the party with a filter date to now.

      try {
      locations = invoice.getRelated("InvoiceContactMech", UtilMisc.toMap("contactMechPurposeTypeId", contactMechPurposeTypeId), null, false);
      } catch (GenericEntityException e) {
      Debug.logError("Touble getting InvoiceContactMech entity list", module);
      }
      
      if (UtilValidate.isEmpty(locations) && fetchPartyAddress) {
      // if no locations found get it from the PartyAndContactMech using the from and to party on the invoice
      ...
      locations = EntityUtil.filterByDate(locations, date, "contactFromDate", "contactThruDate", true);
      
      

      If you edit the invoice pdf one year after, addresses present on it can be change because the invoice date isn't use to resolve validate address related.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nmalin Nicolas Malin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: