Openbravo Issue Tracking System - Retail Modules
View Issue Details
0044340Retail ModulesWeb POSpublic2020-06-10 18:212020-06-15 08:31
aferraz 
aferraz 
normalminorhave not tried
closedfixed 
5
 
RR20Q3 
marvintm
No
0044340: Use same API in Discount and Tax engine output - Tax engine changes
Use same Ticket API in Discount and Tax engine output
*
Current Tax engine output is as follows:
{
  "header": {
    "id": null,
    "grossAmount": 261.81,
    "netAmount": 216.37,
    "taxes": [
      {
        "base": 216.37,
        "amount": 45.44,
        "tax": {
          "id": "5235D8E99A2749EFA17A5C92A52AEFC6",
          ...
        }
      }
    ]
  },
  "lines": [
    {
      "id": "BBC8BD559F1F6830AF7998A180F8D9DA",
      "grossUnitAmount": 261.81,
      "netUnitAmount": 216.37,
      "grossUnitPrice": 261.81,
      "netUnitPrice": 216.37,
      "qty": 1,
      "tax": "5235D8E99A2749EFA17A5C92A52AEFC6",
      "taxRate": 1.21,
      "taxes": [
        {
          "base": 216.37,
          "amount": 45.44,
          "tax": {
            "id": "5235D8E99A2749EFA17A5C92A52AEFC6",
            ...
          }
        }
      ]
    }
  ]
}

Remove header property so it is similar to Ticket API:
{
  "id": null,
  "grossAmount": 261.81,
  "netAmount": 216.37,
  "taxes": [
    {
      "base": 216.37,
      "amount": 45.44,
      "tax": {
        "id": "5235D8E99A2749EFA17A5C92A52AEFC6",
        ...
      }
    }
  ],
  "lines": [
    {
      "id": "BBC8BD559F1F6830AF7998A180F8D9DA",
      "grossUnitAmount": 261.81,
      "netUnitAmount": 216.37,
      "grossUnitPrice": 261.81,
      "netUnitPrice": 216.37,
      "qty": 1,
      "tax": "5235D8E99A2749EFA17A5C92A52AEFC6",
      "taxRate": 1.21,
      "taxes": [
        {
          "base": 216.37,
          "amount": 45.44,
          "tax": {
            "id": "5235D8E99A2749EFA17A5C92A52AEFC6",
            ...
          }
        }
      ]
    }
  ]
}

Add also taxengine namespace when running the engine from graal/node/webservice:
{
  "ticket": {
    "taxengine": {
      "grossAmount": 261.81,
      "netAmount": 216.37,
      "taxes": [...],
      "lines": [
        {
          "id": "BBC8BD559F1F6830AF7998A180F8D9DA",
          "grossUnitAmount": 261.81,
          "netUnitAmount": 216.37,
          "grossUnitPrice": 261.81,
          "netUnitPrice": 216.37,
          "qty": 1,
          "tax": "5235D8E99A2749EFA17A5C92A52AEFC6",
          "taxRate": 1.21,
          "taxes": [...]
        }
      ]
    }
  }
}
No tags attached.
related to defect 0044156RR20Q3 closed aferraz Use same Ticket API in Discount and Tax engine - Tax engine changes 
related to defect 0044181RR20Q3 closed aferraz Use same Ticket API in Discount and Tax engine - Discount engine changes 
related to defect 0044339 closed aferraz Use same API in Discount and Tax engine output - Discount engine changes 
Issue History
2020-06-10 18:21aferrazNew Issue
2020-06-10 18:21aferrazAssigned To => aferraz
2020-06-10 18:21aferrazTriggers an Emergency Pack => No
2020-06-10 18:21aferrazIssue generated from0044339
2020-06-10 18:21aferrazRelationship addedrelated to 0044156
2020-06-10 18:21aferrazRelationship addedrelated to 0044181
2020-06-10 18:22aferrazRelationship addedrelated to 0044339
2020-06-12 08:44hgbotCheckin
2020-06-12 08:44hgbotNote Added: 0120809
2020-06-12 08:47aferrazNote Added: 0120810
2020-06-12 08:48aferrazNote Deleted: 0120810
2020-06-12 08:50aferrazProposed Solution updated
2020-06-12 08:55hgbotCheckin
2020-06-12 08:55hgbotNote Added: 0120814
2020-06-12 08:57hgbotCheckin
2020-06-12 08:57hgbotNote Added: 0120815
2020-06-12 09:22aferrazProposed Solution updated
2020-06-12 09:53aferrazStatusnew => scheduled
2020-06-12 09:53aferrazStatusscheduled => resolved
2020-06-12 09:53aferrazFixed in Version => RR20Q3
2020-06-12 09:53aferrazResolutionopen => fixed
2020-06-15 08:31marvintmReview Assigned To => marvintm
2020-06-15 08:31marvintmStatusresolved => closed

Notes
(0120809)
hgbot   
2020-06-12 08:44   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: bcfcfcbcca40bf1a75eaa0e8f243245d18bddc0a
Author: Álvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Jun 10 18:50:05 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bcfcfcbcca40bf1a75eaa0e8f243245d18bddc0a [^]

Related to ISSUE-44340: Change tax engine result structure

---
M web/org.openbravo.retail.posterminal/app/model/business-logic/taxes-engine/engine/tax-rules.js
M web/org.openbravo.retail.posterminal/js/data/dataordertaxes.js
M web/org.openbravo.retail.posterminal/js/taxesengine/pos/pos-taxes.js
---
(0120814)
hgbot   
2020-06-12 08:55   
Repository: erp/pmods/org.openbravo.taxes
Changeset: fb59f816e3855624debf8a0fcf5c4829746cdb56
Author: Álvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Jun 12 08:53:28 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.taxes/rev/fb59f816e3855624debf8a0fcf5c4829746cdb56 [^]

Related to ISSUE-44340: Change tax engine result structure

---
M src-test/org/openbravo/taxes/test/base/TaxesResult.java
---
(0120815)
hgbot   
2020-06-12 08:57   
Repository: erp/pmods/org.openbravo.taxes
Changeset: ccf25a87da4b91280fef4a8de56757bd709c21e2
Author: Álvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Jun 12 08:54:00 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.taxes/rev/ccf25a87da4b91280fef4a8de56757bd709c21e2 [^]

Related to ISSUE-44340: Add taxengine namespace

---
M src-test/org/openbravo/taxes/test/base/executor/NodeTaxesExecutor.java
M src-test/org/openbravo/taxes/test/base/executor/TaxesCalculator.java
M src/org/openbravo/taxes/engine/graal/GraalTaxesExecutor.java
---