cancel
Showing results for 
Search instead for 
Did you mean: 

CCO Plugin Developement, Clear Items in Sales Screen

0 Kudos

Dear CCO Experts

I am using the main sales screen as different TAB in CCO for posting Stock requests.

Is there any standard method to clear the materials selected in the sales data grid and refresh the sales screen ?

Thanks for your support.


Mohamed,

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello Mohamed,

I will try to solve this issue with you. But first, can you please provide a broader background about your topic? What are you trying to achieve exactly and why do you need to clear the sales item grid?

Best regards,

Sebastian

Answers (4)

Answers (4)

0 Kudos

Hi Ricardo Renteria,

Can you contact me?

I have a requirement on CCO.

ricardo_renteria2
Participant
0 Kudos

Hi mohamed_begaa

today I need exactly the same. I need to replicate the same behavior when you press the Cancel button of the receipt (I mean, clean the receipt and the sales grid), in another button created by a plugin. How can you solve it? I need this in the retail UI.

I tested the method voidReceipt but it don´t work.

Maybe anyone else can give me some hint?

Thanks at all

0 Kudos

Hello Mohamed,

ok, so all you want to do is get back to an empty receipt after posting a stock transfer with your special logic. Unfortunately, there is no way to completely remove a sales item that was added to a receipt. Due to legal requirements we cannot allow something like this.

One way to clear the sales item grid anyways would be to void the receipt. In order to this you can call the "voidReceipt"-action on the "ReceiptController". This can easily be done from the UI.

I hope this answer will help you complete your plugin.

Best regards,

Sebastian

0 Kudos

Hi Sebastian,

Thanks for your reply,

Could you please give me a sample code on how to use voidReceipt.

Thanks.

0 Kudos

Hi Mohamed,

If you intend to cancel the receipt from Javascript, I recommend you to jump into the Chrome DevTools and check what happens once you click on the Cancel button on the UI. The button's id is #cancelBtn.

In case you intend to trigger the cancellation from Java you want to do it like this:

ReceiptEntity receiptEntity = receiptManager.retrieveEntityByKey(receiptKey);

if (receiptEntity != null) {

receiptManager.voidReceipt(receiptEntity);

}

Best regards,

Sebastian

0 Kudos

Hi Sebastian,

Thanks for your replay.

I just want to clean the sales items in the main grid after posting the document

Thanks