Openbravo Issue Tracking System - POS2
View Issue Details
0055996POS2POSpublic2024-07-02 23:052024-07-12 11:06
sdossantos 
SABARINATH P 
urgentmajoralways
closedfixed 
5
pi 
24Q3.1 
No
0055996: Error with Print Product Label
When we have time difference (UTF) we have errors when calculating the print product label.
We always subtract as the service that gets the price product label is:

  /**
   * This method will return the correct date which should be stored in the database taking into
   * account the client and the server date
   */
  public static Date calculateClientDatetime(String orgClientDate, Long dateOffset) {
    Date serverDate = (Date) JsonToDataConverter.convertJsonToPropertyValue(PropertyByType.DATETIME,
        orgClientDate.lastIndexOf(".") != -1
            ? orgClientDate.subSequence(0, orgClientDate.lastIndexOf("."))
            : orgClientDate);
    // date is the date in the server timezone, we need to convert it to the date in the
    // original time zone
    Date dateUTC = convertToUTC(serverDate);
    Date clientDate = new Date();
    clientDate.setTime(dateUTC.getTime() - dateOffset * 60 * 1000);
    return clientDate;
  }
Use the Argentina time for example (configure on your computer)
1- Add a product price exception in backoffice for a product. For example with start date with yesterday's date - pio 10
2- Get the product print label of the product you configured in step 1, we see the price 10
3- now let's change the exception configured in step 1, with today's date in the start date,
4 - In product pront label, we see another price and not 10.

Attached video
No tags attached.
blocks defect 0055893 closed SABARINATH P Error with Print Product Label 
Issue History
2024-07-12 10:49SABARINATH PTypedefect => backport
2024-07-12 10:49SABARINATH PTarget Version => 24Q3.1
2024-07-12 11:02hgbotNote Added: 0166929
2024-07-12 11:06hgbotResolutionopen => fixed
2024-07-12 11:06hgbotStatusscheduled => closed
2024-07-12 11:06hgbotNote Added: 0166932
2024-07-12 11:06hgbotNote Added: 0166933

Notes
(0166929)
hgbot   
2024-07-12 11:02   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.product.label.printing/-/merge_requests/69 [^]
(0166932)
hgbot   
2024-07-12 11:06   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.product.label.printing [^]
Changeset: 22df4f6c4f8c51897ea3599617b34811c101e890
Author: Sabarinath <sabarinath.palanisamy.ext@openbravo.com>
Date: 12-07-2024 14:29:54
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.product.label.printing/-/commit/22df4f6c4f8c51897ea3599617b34811c101e890 [^]

Fixed ISSUE-55996: Product price exception valid date handled for any time zone.

---
M web-jspack/org.openbravo.pos2.product.label.printing/src/components/PrintProductLabel/PrintProductLabelSelectProdStep/PrintProductLabelProductListGrid/PrintProductLabelProductListGrid.jsx
---
(0166933)
hgbot   
2024-07-12 11:06   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.product.label.printing/-/merge_requests/69 [^]