Page 1 of 1

Can a credit note be set to Reserve Order?

PostPosted: Wed Feb 09, 2022 2:20 pm
by DannyC
I want to set a credit note to a reserve order but despite the following code, it's staying as Invoice Order and the field is locked. Have tried both the CreateStart and CreateEnd event.
Is it possible?

Code: Select all
if (salesOrder.CreditNote)
{
   salesOrder.OrderType = JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder.SalesOrderOrderTypes.e_SalesOrderOrderTypeReserveOrder;
}

Re: Can a credit note be set to Reserve Order?

PostPosted: Wed Feb 09, 2022 3:06 pm
by SBarnes
Given the user interface won't let you do it I'd say you can't but given a reserved order is designed to reserve/hold stock what is the use case where you would want to do it as a credit note?

Re: Can a credit note be set to Reserve Order?

PostPosted: Wed Feb 09, 2022 3:07 pm
by Mike.Sheen
Works for me using the CreateEnd event.

Sample plugin demonstrating this attached.

CRNote_Reserve_After_Create.png


If you have other plugins enabled, they may be impacting the behaviour. I'm in the habit of disabling all other plugins when trying to troubleshoot with a SQL Query.

Re: Can a credit note be set to Reserve Order?

PostPosted: Wed Feb 09, 2022 3:09 pm
by Mike.Sheen
SBarnes wrote:Given the user interface won't let you do it I'd say you can't but given a reserved order is designed to reserve/hold stock what is the use case where you would want to do it as a credit note?


And this also - The OrderType Reserve has no relevance in the context of a credit note.

Re: Can a credit note be set to Reserve Order?

PostPosted: Wed Feb 09, 2022 3:59 pm
by DannyC
The OrderType Reserve has no relevance in the context of a credit note.

LOL. I was waiting for that question!

For the client's scenario, they currently use Reserve Order on credit notes (in v 6.5.13) when a credit note has been raised, particularly when Credit Goods Into Stock is ticked. Then when the stock actually arrives, then they can flick it to Invoice Order and process. It's just a manual check to enforce when credited goods have really been received.

Re: Can a credit note be set to Reserve Order?

PostPosted: Wed Feb 09, 2022 4:03 pm
by SBarnes
Why not just raise the credit in a reserved warehouse and do a warehouse transfer when the goods come in?

It would also give them better reporting on what is outstanding.

Re: Can a credit note be set to Reserve Order?

PostPosted: Wed Feb 09, 2022 5:57 pm
by DannyC
Why not just raise the credit in a reserved warehouse and do a warehouse transfer when the goods come in?


Already doing that also.


Mike, I can't get your plugin to work. All other plugins disabled. There no system setting I need?
Thinking a bit more about this, seeing as that dropdown is locked from editing even it was set to Reserve Order, the user couldn't change it to Invoice Order anyway.
Methinks the client will need to revisit their workflows. Might be a case for a custom field - just that the Order Type is right there on the header so no further clicking to other tabs needed.

Re: Can a credit note be set to Reserve Order?

PostPosted: Wed Feb 09, 2022 7:11 pm
by Mike.Sheen
DannyC wrote:[
Mike, I can't get your plugin to work. All other plugins disabled. There no system setting I need?


I've setup a new clean VM and tested - the only thing I found is the plugin I provided contained an unused reference to a component not installed (a newer version of the Actipro Syntax editor) - so when I imported the plugin it gave an error about that unresolved reference.

I removed that reference, saved and tested on a brand new demo database (with every other plugin disabled) and it worked fine. Did you get an error importing the plugin? You should have - how did you handle that?

I was testing on 07.02.01 SR9 - what version were you testing on?

Attached is the revised plugin with that reference removed (versioned 7.2.1.1).