Register    Login    Forum    Search    FAQ

Board index » Installation and Setup » Importing Data




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Web Services Question
 Post Posted: Fri Sep 26, 2008 1:59 pm 
Offline

Joined: Fri Sep 26, 2008 1:54 pm
Posts: 23
Hi Dave,

Great software and you have already helped a lot via email. I wanted to get this into the forum so that other's can understand and learn. I have a question about the ExampleSalesInvoice.xml file.

Are all of the fields required? In my case, I want to import data from another system for patient management. We want to generate the bills in Phreebooks due to inventory issues. We will need to import line items, the customer (although we won't have a customer number the first time), maybe the salesOrder information and the address information. What we DON"T want to import is Payment information (because it hasn't happened yet).

Also, how do we handle if the customer already exists? Do we need to look up the customerId first or will the system be able to dermine from the primaryName?

Thanks so much.

Gil


Top 
 Profile  
 
 Post subject: Re: Web Services Question
 Post Posted: Sun Sep 28, 2008 8:59 am 
Offline

Joined: Fri Oct 26, 2007 3:55 pm
Posts: 3498
Location: Colorado, US
Depends if you want to bulk import your customer database or import as sales orders are generated.

For bulk import, it's best to use the import tool and pull all of the customers in with a single operation. If you are importing sales orders there are required fields, the most important of which is the Customer ID. You will need to decide what method you want to use for customer id's. I'm sure your current patient management system identified each customer by an id. You can use that one or generate one using their name, telephone, email, postal code, or just an arbitrary number. When you sey up your XML string to export, use the same value for the customer id and the customers sales orders will stay together in the same customer record. PhreeBooks uses the customer ID on xml import of sales orders to see if the customer exists in the db or needs to generate a new customer record. With the ZenCart interface, I let the user choose to use the telephone number (stripped of non-aplha characters) or the email address as the custoerm id since the id value assigned to the customer within ZenCart is a simple numeric value starting at 1.

There is also a write-up in the help file (under SOAP -> Sales Orders) about the fields and a briefe description of how they are used. The help file is not complete but most of what you are looking for is there.
Dave


Top 
 Profile  
 
 Post subject: Re: Web Services Question
 Post Posted: Thu Oct 02, 2008 10:19 pm 
Offline

Joined: Fri Sep 26, 2008 1:54 pm
Posts: 23
Thanks so much Dave. That makes sense. What I wasn't sure is what Phreebooks does if it doesn't find the number but this works perfectly.

Gil


Top 
 Profile  
 
 Post subject: Re: Web Services Question
 Post Posted: Thu Oct 02, 2008 11:46 pm 
Offline

Joined: Fri Sep 26, 2008 1:54 pm
Posts: 23
Hi Dave,

Actually one more question. I'm at a loss as to how to call the soap/orders.php. Should I call it as a regular HTTP request and pass the XML file as an argument? Do I send the XML over the commandline?

I tried a few things, mostly with JavaScript but wasn't sure the correct way to call this.

Any advice would be helpful.

Gil


Top 
 Profile  
 
 Post subject: Re: Web Services Question
 Post Posted: Fri Oct 03, 2008 9:14 am 
Offline

Joined: Fri Oct 26, 2007 3:55 pm
Posts: 3498
Location: Colorado, US
I use cURL with the XMl string as POST variables.


Top 
 Profile  
 
 Post subject: Re: Web Services Question
 Post Posted: Fri Oct 03, 2008 2:37 pm 
Offline

Joined: Fri Sep 26, 2008 1:54 pm
Posts: 23
Awesome. I'm moving forward

Thanks,

Gil


Top 
 Profile  
 
 Post subject: Re: Web Services Question
 Post Posted: Sat Oct 04, 2008 2:46 pm 
Offline

Joined: Fri Sep 26, 2008 1:54 pm
Posts: 23
Hi Dave,

I am now having an issue with getting the invoice to post. Below I post my XML. The error I am getting is: SalesInvoiceResponse 1.00 Test Invoice Entry error 90 There was an error posting the sales order. Description - Trial balance is out of balance. Debits: 530 and credits: 435 in period 10

I'm not sure what I am doing wrong. I'm trying to post this as a new customer. One other thing is that I found a few issues in the sample file. It has a BillToAddress node in customer but the code looks for billing outside of customer.

Thanks,

<AccessFunction>SalesInvoiceEntry</AccessFunction>' .
' <SalesOrderEntry>' .
' <OrderRequest>' .
' <Version>1.00</Version>' .
' <RequestAction>New</RequestAction>' .
' <ReferenceName>Test Invoice Entry</ReferenceName>' .
' </OrderRequest>' .
' <SalesOrder>' .
' <OrderSummary>' .
' <SalesOrderDate>2008-10-04</SalesOrderDate>' .
' <OrderTotal>95.00</OrderTotal>' .
' <TaxTotal>0</TaxTotal>' .
' <ShippingTotal>0</ShippingTotal>' .
' </OrderSummary>' .
' <Customer>' .
' <CustomerID>3035551213</CustomerID>' .
' <PrimaryName>George Wells</PrimaryName>' .
' <contact>George Wells</contact>' .
' <Telephone1>3035551212</Telephone1>' .
' <Telephone2>720.555.1234</Telephone2>' .
' <Fax>800-555-6666</Fax>' .
' <Email>john@smithservices.com</Email>' .
' <Website>www.smithservices.com</Website>' .
' <Address1>123 Elm Street</Address1>' .
' <Address2>Suite #3</Address2>' .
' <CityTown>Anytown</CityTown>' .
' <StateProvince>WA</StateProvince>' .
' <PostalCode>98234</PostalCode>' .
' <CountryCode>US</CountryCode>' .
' <SalesGLAccount>4000</SalesGLAccount>' .
' <TaxIDNumber>123456789</TaxIDNumber>' .
' </Customer>' .
' <billing>' .
' <PrimaryName>Smith Services HQ</PrimaryName>' .
' <Contact>Linda Smith</Contact>' .
' <Address1>Attn: Accts Payable</Address1>' .
' <Address2>1 First Street</Address2>' .
' <CityTown>Bothell</CityTown>' .
' <StateProvince>WA</StateProvince>' .
' <PostalCode>98433</PostalCode>' .
' <CountryCode>US</CountryCode>' .
' </billing>' .
' <shipping>' .
' <PrimaryName>Jones Repair</PrimaryName>' .
' <Contact>Jim Jones</Contact>' .
' <Address1>Attn: Receiving</Address1>' .
' <Address2>14433 32nd Street</Address2>' .
' <CityTown>San Diege</CityTown>' .
' <StateProvince>CA</StateProvince>' .
' <PostalCode>92305-4251</PostalCode>' .
' <CountryCode>US</CountryCode>' .
' <DropShipIndicator />' .
' <BlindShipIndicator />' .
' </shipping>' .
' <LineItemDetails>' .
' <ItemID>90876</ItemID>' .
' <Description>Neurofeedback</Description>' .
' <Quantity>1</Quantity>' .
' <UnitPrice>95.00</UnitPrice>' .
' <SalesTax>0</SalesTax>' .
' </LineItemDetails>' .
' </SalesOrder>' .
' </SalesOrderEntry>' .


Top 
 Profile  
 
 Post subject: Re: Web Services Question
 Post Posted: Mon Oct 06, 2008 10:51 am 
Offline

Joined: Fri Oct 26, 2007 3:55 pm
Posts: 3498
Location: Colorado, US
There error is showing because you are missing some fields (probably not in the template). The out of balance is because the post needs several accounts to post a sale, Sales GL Account, Receivables GL Account, and an inventory account for each item.

After SalesGLAccount, add a field called ReceivablesGLAccount (should be 1100 in the retail demo accounts)
Also, make sure you have a valid GL account defined for the inventory item sku = 90876, that is the account used to charge each line item against the receivables account. I have been mostly working with the ZenCart interface so when we get this working, send me an updated template for the next release.
Dave


Top 
 Profile  
 
 Post subject: Re: Web Services Question
 Post Posted: Mon Oct 06, 2008 1:06 pm 
Offline

Joined: Fri Sep 26, 2008 1:54 pm
Posts: 23
Thanks for the reply Dave. I think something else is happening. I can add a value with no problem using the interface. It's through SOAP that it's not allowing the add. I made the changes you suggested and it is still happening.

Is there a way to trace this using SOAP? I turned debug on but it doesn't seem to be calling the out statements (or picking up the debug tag).

Also, what do you mean by the last part of this? There error is showing because you are missing some fields (probably not in the template).

In any case, thanks. You confirmed what the problem was but I still am not sure the issue. I may play around with a separate installation to see if I can cause the error.


Top 
 Profile  
 
 Post subject: Re: Web Services Question
 Post Posted: Mon Oct 06, 2008 4:46 pm 
Offline

Joined: Fri Oct 26, 2007 3:55 pm
Posts: 3498
Location: Colorado, US
Add the following to /soap/orders.php line 71:
Code:
$messageStack->write_debug();

go to Company -> Website Maintenace and enable debug trace generation.
Try the transfer again and your trace file should be in /my_files/db_name/trace.txt or Tools -> Debug Download. That should help isolate the problem, if you want to PM me the text file, I'll have a look.
Dave


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 10 posts ] 

Board index » Installation and Setup » Importing Data


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron