Import XML to Job Costing Sales Order. Type = ?  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Import XML to Job Costing Sales Order. Type = ?

Postby DannyC » Fri Oct 29, 2021 11:54 am

Back in Jiwa 6, when importing an XML into sales orders as a job costing invoice, we'd specify
Code: Select all
<JiwaDocument Type="JobSalesOrder">


I can't find the equivalent for Jiwa 7.
How do we specify the
Code: Select all
Type=
bit so that a new sales order is imported as a JobCost sales order?
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Import XML to Job Costing Sales Order. Type = ?

Postby Mike.Sheen » Fri Oct 29, 2021 1:48 pm

What have you tried?

This works for me in the demo data - if I import a file with the contents shown below, it creates a job invoice:

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<JiwaDocument Type="JobSalesOrder">
   <InvoiceInitDate xmlns="JiwaFinancials.Jiwa.JiwaSales.SalesOrder.XML">2021-10-29T00:00:00</InvoiceInitDate>
   <OrderNo></OrderNo>
   <SOReference></SOReference>
   <JobCosting xmlns="JiwaFinancials.Jiwa.JiwaSales.SalesOrder.XML">
      <JobCostID>335464701f5b441fa395</JobCostID>
      <JobCostNo>003</JobCostNo>
      <Description>Training room fit out</Description>      
   </JobCosting>
   <JobCostNo>003</JobCostNo>
    <Lines xmlns="JiwaFinancials.Jiwa.JiwaSales.SalesOrder.XML">
      <Line>
         <CostCenter>300</CostCenter>
         <Stage>030</Stage>         
      </Line>
      <Line>
         <CostCenter>400</CostCenter>
         <Stage>070</Stage>         
      </Line>
      <Line>
         <CostCenter>400</CostCenter>
         <Stage>080</Stage>         
      </Line>
   </Lines>
</JiwaDocument>
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: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Import XML to Job Costing Sales Order. Type = ?

Postby DannyC » Fri Oct 29, 2021 2:46 pm

Ah ha!
So that gives me some clues.
Firstly, you're providing more tags than I was in the JobCosting section. I only had JobCostNo but you're supplying JobCostID and Description.
Some quick testing & it looks like the JobCostID is essential but not the description.

Secondly, the Type is simply "JobSalesOrder". I didn't know if I needed to supply the full JiwaFinancials.Jiwa blah blah....

Thirdly, I am getting an error Input string was no in a correct format. Module: ParseDouble.
Pretty sure it's on the lines so maybe CostCenter and Stage isn't enough. When I click OK to the error, no lines have been imported. I'll fiddle about and see what I find.

In the meantime, I can see in the
Code: Select all
ConsumeJobSalesOrderXML(SalesOrder xmlSalesOrder)
section of your code that it looks like the lines require not just CostCenter and Stage but also PriceExGst and PriceIncGst.

Anyway, thanks for the hints. That gives me some progress.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Import XML to Job Costing Sales Order. Type = ?

Postby Mike.Sheen » Fri Oct 29, 2021 2:49 pm

DannyC wrote:it looks like the lines require not just CostCenter and Stage but also PriceExGst and PriceIncGst


You'll run into DEV-8976 if you do supply PriceExGst and PriceIncGst. Look closer at the code and you'll is there is a bug there throwing an exception if you do supply either of those two values.
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: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Import XML to Job Costing Sales Order. Type = ?

Postby DannyC » Fri Oct 29, 2021 3:15 pm

OK.
There's still something causing that error. I thought it might be an erroneous plugin but I have disabled all plugins.
I still get the error:
2021-10-29 15_12_38-Jiwa 7.2.1 (JiwaDemo72) registered to Jiwa Financials Evaluation.png
2021-10-29 15_12_38-Jiwa 7.2.1 (JiwaDemo72) registered to Jiwa Financials Evaluation.png (5.35 KiB) Viewed 525 times


EDIT: I get the error whether there are lines in the XML file or not, so it's not the lines.
And it doesn't matter what value I have in InvoiceInitDate, it always displays on the new sales order as today. I just need the tag there but seems the value is irrelevant.
Last edited by DannyC on Fri Oct 29, 2021 3:28 pm, edited 1 time in total.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Import XML to Job Costing Sales Order. Type = ?

Postby Mike.Sheen » Fri Oct 29, 2021 3:26 pm

DannyC wrote:OK.
There's still something causing that error. I thought it might be an erroneous plugin but I have disabled all plugins.
I still get the error:
2021-10-29 15_12_38-Jiwa 7.2.1 (JiwaDemo72) registered to Jiwa Financials Evaluation.png


Maybe a sample file will help me to understand the cause for your ParseDouble error.
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: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Import XML to Job Costing Sales Order. Type = ?

Postby DannyC » Fri Oct 29, 2021 3:29 pm

See my file attached.
Attachments
Test Import XML Job 2 SalesOrder.XML
(610 Bytes) Downloaded 58 times
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Import XML to Job Costing Sales Order. Type = ?  Topic is solved

Postby Mike.Sheen » Fri Oct 29, 2021 3:48 pm

DannyC wrote:See my file attached.


Thanks.

That worked for me on my 7.2.5 DEV build - so I tried it on 7.2.1 and there is a bug which is causing this.

I've logged this for you as DEV-8978.
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: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Import XML to Job Costing Sales Order. Type = ?

Postby DannyC » Tue Nov 16, 2021 9:43 am

there is a bug


Any chance of a rush job on this one? Or a temporary plugin we can deploy until SR6 comes out? It's just that the client is anxious to have it resolved asap.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30


Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 1 guest