Table of Contents

rm#25486 PO - Wrong error message when undergoing already invoiced quantites via modify

https://cust-projects.seeburger.de/redmine/issues/25486

Description

…

TODO

Analyze

The error message is formed in POCollabPreprocessor.doPreProcessing():120

The invoice information seems to be written in the database with the help of BillableObject import ( see BillableObjectStatusInboundXMLHandler.processRootElement()).

Reproduce

The invoice information seems to be imported in the system through BillableObject import, but it was too difficult for me to get such a file (no one seems to have such files now). It is possible to reproduce it on the simple way and Simple

1. Import PO with 3 Positions ( an example: D:\development\testdata\purchaseorder\rm#25486_WrongErrMsgAboutInvoicedQties\po_003.xml )

2. Find out CREFHEADERID for this PO:

SELECT * FROM TAIRPOSCHEDULE WHERE CLINEPONUM = 'rm25486_003';

3. Update invoice quantities for example with the following statement :

UPDATE TAIRPOLINEITEM 
SET CFULLYINVOICED=1,CINVOICEREMAININGQTY=35,CINVOICETOTALQTY=90,CREQTOTALQTY=90,CPROMTOTALQTY=90 
WHERE CREFHEADERID=<ref_header_id>

Misc

Result

POCollabPreProcessor.doPreProcessing() was changed:

                        BigDecimal invoicedQty =
                                Toolbox.getBigDecimalOrZero(poLineItemData.getInvoiceTotalQty()).subtract(
                                    Toolbox.getBigDecimalOrZero(poLineItemData.getInvoiceRemainingQty()));
                        resultModel.addMessage(new ClientResultMessageEntry(false, IPOConstants.ERROR_CODE_REQ_QTY_BELOW_INV_QTY, nlsKey,
                                "The quantity of the schedule lines %s1 of the PO item %s2 can't be changed because the resulting item quantity %s3 would be below the already invoiced quantity %s4",
                                slText, preProcData.getPosNumber(), poLineItemData.getReqTotalQty(), invoicedQty));