Skip to Content
0

CCO Plugin Developement, Clear Items in Sales Screen

Feb 01 at 08:39 AM

64

avatar image
Former Member

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,

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Sebastian Magin
Feb 02 at 09:13 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Sebastian Magin
Feb 05 at 08:50 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Sebastian,

Thanks for your reply,

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

Thanks.

0

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
avatar image
Former Member Feb 04 at 08:13 AM
0

Hi Sebastian,

Thanks for your replay.

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

Thanks

Share
10 |10000 characters needed characters left characters exceeded