Page 1 of 1

Allow Invoice Number Override

PostPosted: Tue Dec 06, 2016 10:14 pm
by indikad
v - 7.0.149
I am using the jiwa File watcher plugin to import new sales orders .
I can get this one done however - there are couple of important things I cannot yet work out.
I have set the AllowInvoiceNumberOverride but cannot get jiwa to override invoice number using my plugin code
Code: Select all
salesOrder.InvoiceNo = csvFields(2) '--- using manual numbering

also :
I need to override the item description that too does not work -
I have the system settings flag set correctly ( allowAlternateDescriptons = editable )
Code: Select all
salesOrder.SalesOrderLines(newKey).Description = csvFields(5)

on both cases I can edit by hand on screen - but not with the plugin.
with the same coding set I am trying to add data to UserDefinedFloat1 and 2 but that too is not good.
Code: Select all
salesOrder.SalesOrderLines(newKey).UserDefinedFloat2 = csvFields(7)



an early tip is appreciated.

Re: Allow Invoice Number Override

PostPosted: Tue Dec 06, 2016 10:41 pm
by Mike.Sheen
indikad wrote:I have set the AllowInvoiceNumberOverride but cannot get jiwa to override invoice number using my plugin code
Code: Select all
salesOrder.InvoiceNo = csvFields(2) '--- using manual numbering



How have you set the AllowInvoiceNumberOverride system setting? is that via the standard system setting, or did you explicitly set the sales orders SystemSettings.AllowInvoiceNumberOverride in your plugin code?

indikad wrote:also :
I need to override the item description that too does not work -
I have the system settings flag set correctly ( allowAlternateDescriptons = editable )
Code: Select all
salesOrder.SalesOrderLines(newKey).Description = csvFields(5)



As above - how was this set?

indikad wrote:with the same coding set I am trying to add data to UserDefinedFloat1 and 2 but that too is not good.
Code: Select all
salesOrder.SalesOrderLines(newKey).UserDefinedFloat2 = csvFields(7)



That should work, regardless - at what point are you setting these values? Without a sample plugin which demonstrates the issues, it's hard to comment on the problem.

Re: Allow Invoice Number Override

PostPosted: Wed Dec 07, 2016 7:44 am
by indikad
attached the plugin
Thanks Mike.

also -
i have set the AllowInvoiceNumberOverride system setting manually not via code. I was expecting the sales order object to read that from the system.
i will try the SystemSettings.AllowInvoiceNumberOverride

Re: Allow Invoice Number Override

PostPosted: Wed Dec 07, 2016 9:37 am
by indikad
Hi Mike,

I have another anomaly now.
since I created a manual order ( by manually keying in ) - the file watcher plugin gets an error -
"Error: Cannot insert duplicate key row in object 'dbo.SO_Main' with unique index 'SO_MainInvoiceNo'. The duplicate key value is (100687)."

The number 100687 is the number I keyed in manually.
This error is with and without auto numbering on the plugin. ( I used the salesOrder.SystemSettings.AllowInvoiceNumberOverride = True as well)

Looks like the plugin does not want to recognise the keyed in sales order ???
how can I fix this pls ?

Re: Allow Invoice Number Override  Topic is solved

PostPosted: Wed Dec 07, 2016 7:17 pm
by Mike.Sheen
indikad wrote:Hi Mike,

I have another anomaly now.
since I created a manual order ( by manually keying in ) - the file watcher plugin gets an error -
"Error: Cannot insert duplicate key row in object 'dbo.SO_Main' with unique index 'SO_MainInvoiceNo'. The duplicate key value is (100687)."

The number 100687 is the number I keyed in manually.
This error is with and without auto numbering on the plugin. ( I used the salesOrder.SystemSettings.AllowInvoiceNumberOverride = True as well)

Looks like the plugin does not want to recognise the keyed in sales order ???
how can I fix this pls ?


Edit the system number for the next sales order ("Central" is the default) in the system numbers form to make it a number after the most recent sales order InvoiceNo.