Allow Invoice Number Override  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Allow Invoice Number Override

Postby indikad » Tue Dec 06, 2016 10:14 pm

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.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Allow Invoice Number Override

Postby Mike.Sheen » Tue Dec 06, 2016 10:41 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Allow Invoice Number Override

Postby indikad » Wed Dec 07, 2016 7:44 am

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
Attachments
PluginFile Watcher_ImportOrders - Copy.xml
(57.61 KiB) Downloaded 488 times
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Allow Invoice Number Override

Postby indikad » Wed Dec 07, 2016 9:37 am

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 ?
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Allow Invoice Number Override  Topic is solved

Postby Mike.Sheen » Wed Dec 07, 2016 7:17 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 0 guests