Wrong line net amount

71 views
Skip to first unread message

geoffro...@capbarthodia.com

unread,
Oct 10, 2024, 5:40:07 AM10/10/24
to iDempiere
 Hi all,

I don’t understand the amount of the invoice line:

My test case: Release IDempiere 10 and IDempiere 11

In a standard Order, I order 3 products, the invoicing rule is “after delivery,” and the delivery rule is “availability.” I create a shipment with a shipping confirmation (Ship/Receipt Confirmation) of only 1 item out of the 3 ordered.

I complete the confirmation, Complete the shipment, and create the invoice. The invoiced quantity is correctly set to 1, but the invoice line amount is calculated based on the quantity entered (which is 3) instead of the invoiced quantity (which is 1).

What did I do wrong?
Screenshot 2024-10-10 at 11-38-46 iDempiere.png

Carlos Antonio Ruiz Gomez

unread,
Oct 10, 2024, 5:57:38 AM10/10/24
to idem...@googlegroups.com
This step:
> and create the invoice

How did you create the invoice?

Is the problem reproducible in demo.globalqss.com or test.idempiere.org?

Regards,

Carlos Ruiz
> --

geoffro...@capbarthodia.com

unread,
Oct 10, 2024, 8:14:19 AM10/10/24
to iDempiere
Hi Carlos, thx for your prompt answer.
I used the new form (info window ) Generate Invoices (manual)

I'll test it on test.idempiere.org
Screenshot 2024-10-10 at 14-12-26 iDempiere.png

geoffro...@capbarthodia.com

unread,
Oct 10, 2024, 8:19:36 AM10/10/24
to iDempiere
I can't choose a product in the sales order line.
log bellow.

07:16:53.880===========> InfoProductWindow.testCount: SELECT COUNT(*) FROM ( SELECT DISTINCT p.M_Product_ID, p.ImageURL AS ImageURL, p.Discontinued AS Discontinued, p.Value AS Value, p.Name AS Name, bomQtyAvailable(p.M_Product_ID,103,0) AS QtyAvailable, bomPriceList(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceList, bomPriceStd(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceStd, bomQtyOnHand(p.M_Product_ID,103,0) AS QtyOnHand, bomQtyReserved(p.M_Product_ID,103,0) AS QtyReserved, bomQtyOrdered(p.M_Product_ID,103,0) AS QtyOrdered, (SELECT SUM(c.TargetQty) FROM M_InOutLineConfirm c INNER JOIN M_InOutLine il ON (c.M_InOutLine_ID=il.M_InOutLine_ID) INNER JOIN M_InOut i ON (il.M_InOut_ID=i.M_InOut_ID) WHERE c.Processed='N' AND i.M_Warehouse_ID=103 AND il.M_Product_ID=p.M_Product_ID) AS QtyUnconfirmed, (SELECT SUM(c.TargetQty) FROM M_MovementLineConfirm c INNER JOIN M_MovementLine ml ON (c.M_MovementLine_ID=ml.M_MovementLine_ID) INNER JOIN M_Locator l ON (ml.M_LocatorTo_ID=l.M_Locator_ID) WHERE c.Processed='N' AND l.M_Warehouse_ID=103 AND ml.M_Product_ID=p.M_Product_ID) AS QtyUnconfirmedMove, bomPriceStd(p.M_Product_ID, pr.M_PriceList_Version_ID)-bomPriceLimit(p.M_Product_ID, pr.M_PriceList_Version_ID) AS Margin, bp.Name AS Vendor, pr.PriceLimit AS PriceLimit, pa.IsInstanceAttribute AS IsInstanceAttribute FROM M_Product p LEFT OUTER JOIN M_ProductPrice pr ON (p.M_Product_ID=pr.M_Product_ID AND pr.IsActive='Y') LEFT OUTER JOIN M_AttributeSet pa ON (p.M_AttributeSet_ID=pa.M_AttributeSet_ID) LEFT OUTER JOIN M_Product_PO ppo ON (p.M_Product_ID=ppo.M_Product_ID AND ppo.IsCurrentVendor='Y' AND ppo.IsActive='Y') LEFT OUTER JOIN C_BPartner bp ON (ppo.C_BPartner_ID=bp.C_BPartner_ID) WHERE p.IsSummary='N' AND p.IsActive='Y' AND p.IsActive='Y' AND Upper(p.Name) Like UPPER(?) AND pr.M_PriceList_Version_ID = ? AND p.IsSold = ? AND p.IsSummary='N' AND p.AD_Client_ID IN(0,11) AND (p.AD_Org_ID IN (0,11,12,50000,1000000,50002,50001,1000002,50004,50006,50005,50007)) AND (p.M_Product_ID IS NULL OR p.M_Product_ID NOT IN (SELECT Record_ID FROM AD_Private_Access WHERE AD_Table_ID=208 AND AD_User_ID<>100 AND IsActive='Y')) AND (m_product.isactive='Y') AND (m_product.isactive='Y') AND (pr.M_ProductPrice_ID IS NULL OR pr.M_ProductPrice_ID NOT IN (SELECT Record_ID FROM AD_Private_Access WHERE AD_Table_ID=251 AND AD_User_ID<>100 AND IsActive='Y')) AND (pa.M_AttributeSet_ID IS NULL OR pa.M_AttributeSet_ID NOT IN (SELECT Record_ID FROM AD_Private_Access WHERE AD_Table_ID=560 AND AD_User_ID<>100 AND IsActive='Y')) AND (bp.C_BPartner_ID IS NULL OR bp.C_BPartner_ID NOT IN (SELECT Record_ID FROM AD_Private_Access WHERE AD_Table_ID=291 AND AD_User_ID<>100 AND IsActive='Y')) ) a [3707] org.postgresql.util.PSQLException: ERROR: invalid reference to FROM-clause entry for table "m_product" Hint: Perhaps you meant to reference the table alias "p". Position: 2100; State=42P01; ErrorCode=0 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2725) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2412) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:371) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:502) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:419) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194) at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:137) at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) at jdk.internal.reflect.GeneratedMethodAccessor1009.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.compiere.db.StatementProxy.invoke(StatementProxy.java:142) at jdk.proxy2/jdk.proxy2.$Proxy19.executeQuery(Unknown Source) at org.adempiere.webui.info.InfoWindow.testCount(InfoWindow.java:2654) at org.adempiere.webui.info.InfoWindow.testQueryForEachIdentifier(InfoWindow.java:716) at org.adempiere.webui.info.InfoWindow.processQueryValue(InfoWindow.java:655) at org.adempiere.webui.info.InfoWindow.<init>(InfoWindow.java:350) at org.adempiere.webui.info.InfoWindow.<init>(InfoWindow.java:278) at org.adempiere.webui.info.InfoProductWindow.<init>(InfoProductWindow.java:163) at org.adempiere.webui.factory.DefaultInfoFactory.create(DefaultInfoFactory.java:168) at org.adempiere.webui.factory.InfoManager.create(InfoManager.java:124) at org.adempiere.webui.editor.WSearchEditor.actionText(WSearchEditor.java:520) at org.adempiere.webui.editor.WSearchEditor.onEvent(WSearchEditor.java:394)
Screenshot 2024-10-10 at 14-16-24 TEST iDempiere.png

geoffro...@capbarthodia.com

unread,
Oct 10, 2024, 8:33:55 AM10/10/24
to iDempiere
Carlos, I reproduced the case on : https://demo.globalqss.com/webui/
Sales Order 50001
Shipment (Customer) 500001
ShipConfirm : 10000000
Invoice: 100004
hope that helps

geoffro...@capbarthodia.com

unread,
Oct 10, 2024, 8:34:52 AM10/10/24
to iDempiere
Screenshot 2024-10-10 at 14-34-18 GlobalQSS Demo iDempiere LCO.png

geoffro...@capbarthodia.com

unread,
Oct 10, 2024, 9:38:47 AM10/10/24
to iDempiere
if it helps
Here's how we plan to get around the problem at the moment :

we "patch" the standard InvoiceGenerate process by removing the "if (sLine.sameOrderLineUOM())" test to only have the "line.setQtyEntered(sLine.getMovementQty());" instruction.

Carlos Antonio Ruiz Gomez

unread,
Oct 10, 2024, 10:39:51 AM10/10/24
to idem...@googlegroups.com
It sounds like a core bug - if possible please open a JIRA ticket for that.

I'll try to check it a.s.a.p.

geoffro...@capbarthodia.com

unread,
Oct 10, 2024, 12:02:11 PM10/10/24
to iDempiere
Reply all
Reply to author
Forward
0 new messages