[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2024-06-11 Thread Ingo Wolfmayr (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17854019#comment-17854019
 ] 

Ingo Wolfmayr commented on OFBIZ-12390:
---

Hi [~jleroux],

yes please. I do not have the time right now to take care of the issue. Thanks

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2024-06-11 Thread Jacques Le Roux (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17853969#comment-17853969
 ] 

Jacques Le Roux commented on OFBIZ-12390:
-

Hi [~iwolf],

Should we close as abandoned?.

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2024-05-08 Thread Jacques Le Roux (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17844590#comment-17844590
 ] 

Jacques Le Roux commented on OFBIZ-12390:
-

Hi [~iwolf],

Any chances? Do you want some help?

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2024-04-07 Thread Ingo Wolfmayr (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17834792#comment-17834792
 ] 

Ingo Wolfmayr commented on OFBIZ-12390:
---

Hi [~jleroux],

I check and update the ticket.

Best regards,
Ingo

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2024-03-17 Thread Jacques Le Roux (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17827776#comment-17827776
 ] 

Jacques Le Roux commented on OFBIZ-12390:
-

Hi [~iwolf],

The last patch version applies well with "git apply cartRounding.patch"
I have tried to reproduce following your suggestions. Here is what I did in 
order.

I imported both files via XML import and created an order using:
partyId: AUT_CUSTOMER
productStore: Test GmbH
product 1: AUT_PRODUCT (quantity 1)
product 1: AUT_PRODUCT_CP (quantity 1)

I thought the result would be correct (2.8) since I have applied the patch. But 
it's not.

You then suggest to update the order. I don't how to update a created order. I 
then run the service "createPaymentFromOrder". The order total still shows 
2.79. And both OrderPaymentPreferenceS are 2.79

What could I miss?

TIA

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2022-09-17 Thread Ingo Wolfmayr (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606098#comment-17606098
 ] 

Ingo Wolfmayr commented on OFBIZ-12390:
---

Hi Jacques,

I create a new patch.

Best regards,

Ingo

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2022-09-17 Thread Jacques Le Roux (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606084#comment-17606084
 ] 

Jacques Le Roux commented on OFBIZ-12390:
-

Hi Ingo,

There is a pb w/ your patch:

{noformat}
C:\projectsASF\Git\ofbiz-framework>git apply --reject cartRounding.patch
Checking patch 
applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java...
Checking patch 
applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java...
error: while searching for:
curDisplayPrice = this.getBasePrice();
} else {
if (selectedAmount.compareTo(BigDecimal.ZERO) > 0) {
curDisplayPrice = 
this.displayPrice.multiply(this.selectedAmount).setScale(3, 
UtilNumber.getRoundingMode("order.rounding"));
} else {
curDisplayPrice = this.displayPrice.setScale(3, 
UtilNumber.getRoundingMode("order.rounding"));
}
}
return curDisplayPrice;

error: patch failed: 
applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java:2355
Hunk #2 succeeded at 2554 (offset -3 lines).
Applied patch 
applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
 cleanly.
Applying patch 
applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
 with 1 reject...
Rejected hunk #1.
Hunk #2 applied cleanly.
{noformat}

>From what I have seen with another tool (ToirtoiseGit) the pb is related to  
><>
Please create your patch using trunk HEAD, TIA


> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2022-09-17 Thread Ingo Wolfmayr (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606074#comment-17606074
 ] 

Ingo Wolfmayr commented on OFBIZ-12390:
---

[~jamesyong] : the order calculation and invoice calculation are correct and 
the results are even. Creating an invoice from an order will add all necessary 
adjustments (like VAT_CORRECTION). I did not see any problem here.

The order payment preference uses the cart "displayGrandTotal" to create the 
value. Using the cart (ecommerce, update order, webpos ...) the 
displayGrandTotal with the example provided will always result in a different 
value. The order items are stored with 3 decimals. The problem, as far as I can 
see, is not a missing adjustment but a different logic/timing in rounding when 
summing up the order/cart/invoice lines. When using the cart object, the 
rounding for the same order line is not limited.

Rounding the cart line subtotal before building the grand total (for Display) 
solved it - order & invoice are doing it that way.

Does not rule out that I am missing something. :)

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2022-09-16 Thread James Yong (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606027#comment-17606027
 ] 

James Yong commented on OFBIZ-12390:


I think it will be better solved by adding an adjustment at invoice item level. 

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2022-09-16 Thread Ingo Wolfmayr (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17605870#comment-17605870
 ] 

Ingo Wolfmayr commented on OFBIZ-12390:
---

Hi Jacques,

I have updated the XML files.

1.) Import [^pricecheckData-1.xml]

2.) Import Orders.xml

3.) Update the order to recalculate prices. The order will then be up-to-date. 
There is not payment preference right now.

4.) Goto Webtools and run the service "createPaymentFromOrder" - it will create 
a new payment preference. If you create one payment preference before applying 
the patch you will see the wrong amount. Apply the patch and run the service 
again. You will see a second preference with the right amount. See the image 
below.

Thanks,

Ingo

 

!image-2022-09-16-16-43-38-897.png!

 

 

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, image-2022-09-16-16-43-38-897.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2022-09-16 Thread Jacques Le Roux (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17605844#comment-17605844
 ] 

Jacques Le Roux commented on OFBIZ-12390:
-

HI INgo,

Thanks for the testing files, but I can't import the order one. I get 


{noformat}
2022-09-16 15:42:49,150 |jsse-nio-8443-exec-6 |GenericDelegator  
|E| Failure in create operation for entity [OrderRole]: 
org.apache.ofbiz.entity.GenericEntityException: Error while inserting: 
[GenericEntity:OrderRole][created
Stamp,2022-09-16 15:42:49.119(java.sql.Timestamp)][createdTxStamp,2022-09-16 
15:42:48.496(java.sql.Timestamp)][lastUpdatedStamp,2022-09-16 
15:42:49.119(java.sql.Timestamp)][lastUpdatedTxStamp,2022-09-16 
15:42:48.496(java.sql.Timestamp)][
orderId,TO10001(java.lang.String)][partyId,AUT_CUSTOMER(java.lang.String)][roleTypeId,BILL_TO_CUSTOMER(java.lang.String)]
 (SQL Exception while executing the following:null (INSERT on table 
'ORDER_ROLE' caused a violation of foreign key c
onstraint 'ORDER_ROLE_PROLE' for key (AUT_CUSTOMER,BILL_TO_CUSTOMER).  The 
statement has been rolled back.)). Rolling back transaction.
{noformat}


> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Assignee: Jacques Le Roux
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2022-09-15 Thread Ingo Wolfmayr (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17605655#comment-17605655
 ] 

Ingo Wolfmayr commented on OFBIZ-12390:
---

The attached patch defines rounding on cart object to apply to the order & 
invoice total logic. It does  not change the price calulcation but the cart 
price total result.

Having different results in order/invoice total and cart total has the 
following effect:
 * Invoice can not be closed, as payment amount created from order does not 
match invoice amount
 * Payment on cart will differ to created order. WebPos payment request will 
not match order.

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01, Upcoming Branch
>Reporter: Ingo Wolfmayr
>Priority: Major
> Attachments: Orders.xml, cartRounding.patch, 
> image-2021-11-19-09-44-18-759.png, image-2021-11-19-09-44-44-443.png, 
> image-2021-11-19-09-59-07-571.png, pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2022-01-07 Thread Ingo Wolfmayr (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17470599#comment-17470599
 ] 

Ingo Wolfmayr commented on OFBIZ-12390:
---

Is there a definition on how the price should be calculated?

For example:

cartItem 01:
price: 4.535
tax: 0,454
quantity:  1

cartItem 02
price: 0.955
tax: 0,955
quantity: 3

There are three different places where prices are calculated - they must come 
to the same result:

ShoppingCart - basePrice from productPrice (3 digit after comma in database)
Order- basePrice from orderItem (unitPrice - (3 digit after comma in database)
Invoice - basePrice from invoiceItem (price - (3 digit after comma in database)

(basePrice * quanity).scale(orderDecimals)
+ (itemTaxAdjustment * quantity).scale(orderDecimals)
+ (itemOtherAdjustements).scale(orderDecimals)
= total

or

(basePrice.scale(orderDecimals) * quanity)
+ (itemTaxAdjustment.scale(orderDecimals) * quantity)
+ (itemOtherAdjustements).scale(orderDecimals)
= total

or

(basePrice* quanity)
+ (itemTaxAdjustment * quantity)
+ (itemOtherAdjustements)
= total.scale(orderDecimals) 

...

If there is a definition I would like to check the methods cart, order and 
invoice to use the same logic. Having a cent difference in some cases and not 
to be able to rely on the calculation is really annoying.

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01
>Reporter: Ingo Wolfmayr
>Priority: Major
> Attachments: Orders.xml, image-2021-11-19-09-44-18-759.png, 
> image-2021-11-19-09-44-44-443.png, image-2021-11-19-09-59-07-571.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2021-11-19 Thread Ingo Wolfmayr (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17446416#comment-17446416
 ] 

Ingo Wolfmayr commented on OFBIZ-12390:
---

I have uploaded the import for both orders. Beware: OrderPaymentPreferences 
won't update when order is updated. So it will always show the imported value.

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01
>Reporter: Ingo Wolfmayr
>Priority: Major
> Attachments: Orders.xml, image-2021-11-19-09-44-18-759.png, 
> image-2021-11-19-09-44-44-443.png, image-2021-11-19-09-59-07-571.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2021-11-19 Thread Pierre Smits (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17446386#comment-17446386
 ] 

Pierre Smits commented on OFBIZ-12390:
--

Could you consider enhancing that with records definitions for the order?

Mit freundlichen Grüßen,

Pierre

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01
>Reporter: Ingo Wolfmayr
>Priority: Major
> Attachments: image-2021-11-19-09-44-18-759.png, 
> image-2021-11-19-09-44-44-443.png, image-2021-11-19-09-59-07-571.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12390) Order/Invoice: Item total result diff total result

2021-11-19 Thread Pierre Smits (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-12390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17446384#comment-17446384
 ] 

Pierre Smits commented on OFBIZ-12390:
--

Guten Morgen Ingo,

Kudos for providing such an elaborate set of demo/test data. 

> Order/Invoice: Item total result diff total result
> --
>
> Key: OFBIZ-12390
> URL: https://issues.apache.org/jira/browse/OFBIZ-12390
> Project: OFBiz
>  Issue Type: Improvement
>  Components: accounting, order
>Affects Versions: Trunk, 17.12.08, 18.12.01
>Reporter: Ingo Wolfmayr
>Priority: Major
> Attachments: image-2021-11-19-09-44-18-759.png, 
> image-2021-11-19-09-44-44-443.png, image-2021-11-19-09-59-07-571.png, 
> pricecheckData-1.xml
>
>
> In some cases the order total is not correct:
> net price: €1.273
> 10% sales tax: € 0.127
> quantity: 1
> grand total: € 1.40
> Now taking the same product and adding it with two order lines:
> grand total: € 2.79
> Right now the grand total is calculated by total all item net prices, total 
> all adjustments and finally adding those two values together.
> The following screenshots are taken from the orderview. Ofbiz request a 
> payment of € 2.80 but will create an invoice with a grand total of € 2.79.
> !image-2021-11-19-09-44-18-759.png!
> !image-2021-11-19-09-44-44-443.png!
> Heres the result with just one orderline:
> !image-2021-11-19-09-59-07-571.png!
>  
> I have created a XML file for testing.  Import the file via XML import and 
> create an order:
> partyId: AUT_CUSTOMER
> productStore: Test GmbH
> product 1: AUT_PRODUCT (quantity 1)
> product 1: AUT_PRODUCT_CP (quantity 1)
> Checkout with default settings.
> From my perspective the calculation should be changed to calculate the total 
> amount for each line and calculate the grand total from these results.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)