Page 1 of 1

Add non-stock item to Snapshot > 1

PostPosted: Wed May 11, 2022 11:42 am
by pricerc
My customer wants to add a credit-card surcharge based on the payment for a particular snapshot, which is only for the "this delivery" amount.

So on, say, snapshot 2, there is a second payment for the items that were on backorder in snapshot 1, and so we'd like to add a second surcharge.

I was about to tell them 'no', when I decided I had better check...

On a Bill/Complete or Ship+Bill order, you can't add an item to a processed order using the UI, but I don't see a restriction in the code for AddNonInventoryItem.

So is this something a) possible, and b) reasonable, to do in code?

Re: Add non-stock item to Snapshot > 1  Topic is solved

PostPosted: Wed May 11, 2022 2:38 pm
by Mike.Sheen
pricerc wrote:My customer wants to add a credit-card surcharge based on the payment for a particular snapshot, which is only for the "this delivery" amount.

So on, say, snapshot 2, there is a second payment for the items that were on backorder in snapshot 1, and so we'd like to add a second surcharge.

I was about to tell them 'no', when I decided I had better check...

On a Bill/Complete or Ship+Bill order, you can't add an item to a processed order using the UI, but I don't see a restriction in the code for AddNonInventoryItem.

So is this something a) possible, and b) reasonable, to do in code?


We don't support it - if we don't prevent you doing it via the business logic, then that's a bug.

A lot of things have logic when assumes all snapshots have the same lines - and in the same order as well.

Re: Add non-stock item to Snapshot > 1

PostPosted: Wed May 11, 2022 6:34 pm
by pricerc
Mike.Sheen wrote:
pricerc wrote:My customer wants to add a credit-card surcharge based on the payment for a particular snapshot, which is only for the "this delivery" amount.

So on, say, snapshot 2, there is a second payment for the items that were on backorder in snapshot 1, and so we'd like to add a second surcharge.

I was about to tell them 'no', when I decided I had better check...

On a Bill/Complete or Ship+Bill order, you can't add an item to a processed order using the UI, but I don't see a restriction in the code for AddNonInventoryItem.

So is this something a) possible, and b) reasonable, to do in code?


We don't support it - if we don't prevent you doing it via the business logic, then that's a bug.

A lot of things have logic when assumes all snapshots have the same lines - and in the same order as well.


Thanks Mike. Makes sense.

I'll leave it to you to figure out if I missed the check - the decompiler sometimes obfuscates things, but I would have expected some kind of exception being thrown, and I didn't see one.

Re: Add non-stock item to Snapshot > 1

PostPosted: Thu May 12, 2022 8:37 am
by SBarnes
I do know this slightly different but you can change prices on the sales order object after a D01 and the business logic will accept it, I did this for a client where we unlocked the pricing cells on the form and Jiwa will accept it and save it.