Page 1 of 1

Import XML to Job Costing Sales Order. Type = ?

PostPosted: Fri Oct 29, 2021 11:54 am
by DannyC
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?

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

PostPosted: Fri Oct 29, 2021 1:48 pm
by Mike.Sheen
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>

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

PostPosted: Fri Oct 29, 2021 2:46 pm
by DannyC
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.

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

PostPosted: Fri Oct 29, 2021 2:49 pm
by Mike.Sheen
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.

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

PostPosted: Fri Oct 29, 2021 3:15 pm
by DannyC
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 9570 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.

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

PostPosted: Fri Oct 29, 2021 3:26 pm
by Mike.Sheen
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.

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

PostPosted: Fri Oct 29, 2021 3:29 pm
by DannyC
See my file attached.

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

PostPosted: Fri Oct 29, 2021 3:48 pm
by Mike.Sheen
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.

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

PostPosted: Tue Nov 16, 2021 9:43 am
by DannyC
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.