Skip to Content
0
Jul 27, 2023 at 10:36 AM

How to know cancel's Article code of receipt in CCO Plugin

163 Views

Dear Sir,

Please can someone help me about CCO rows canceling. I cannot try to do the following code. I add tree article codes on the receipt Form. I canceled two article codes. May I know how I can check these two cancel codes in the plugin. I use the following code.I retireve item.getCancellationStatus() value but this value always gets 1, this I do not know which item cancel or not.someone can you help me about this.please?

ReceiptEntity receipt = null;
CDBSession session = CDBSessionFactory.instance.createSession();
ReceiptManager receiptManager = new ReceiptManager(session);

try {
receipt = receiptManager.findOrCreate(UserRegistry.INSTANCE.getCurrentUser(), null, false);
} catch (InconsistentReceiptStateException ex) {
ex.printStackTrace();
}
for (SalesItemEntity item : receipt.getSalesItems()) {
String Cancel = item.getCancellationStatus();String articlecode =item.getId().toString();.....................

}