Ubercart Integration

 

Overview

The uc_edi_xtuple module (which is available in the xChange) allows you to export order and payment information from your Ubercart store into an XML file that is formatted for import into xTuple ERP.

The uc_edi_xtuple module gets almost all of its code from the uc_edi module, developed by Ryan Szama, the man behind Ubercart. We modified this module to make it more capable of exporting xml. We're hoping that our changes will be incorporated back into the core uc_edi module, but if you want to use Ubercart and xTuple for now, you'll need to use the custom uc_edi_xtuple module, available in the xTuple xChange.

The settings below will allow you to import both order and sales or information from Ubercart into xTuple. The orders will be imported as Open Sales Orders, and the payments will be imported as Miscellaneous Credit Memos.

Prerequisites

To set up a webstore using Ubercart you'll need to have the following environment installed:

  • Drupal 6.x (make sure you don't select Drupal 7--we don't support that version yet)
  • Ubercart 2.x (again, make sure to select the Ubercart version that is compatible with Drupal 6) 

This is not meant to be a guide to installing and configuring Drupal and Ubercart, which is a complex multistep process. You can find instructions fo that at the pages above. Of course, we recommend that you install your Drupal site on a PostgreSQL database, but that's just us.

You'll need to install the uc_edi_xtuple module and enable it, and then follow the configuration instructions below, in order to export orders into a format that can be imported into xTuple.

Configuring uc_edi_xtuple

You're going to configure the ux_edi_xtuple module to export data into an xml format. The xml file that is generated will contain all the information needed to insert the customer, salesorder, salesline and payment (armemo) information into xTuple.

Note that there are some hard coded values in the Order Export Pattern section below, which may not apply to your company. In particular, you'll probably want to change the values for the following nodes:

<sales_rep>jsmith</sales_rep>
<tax_zone>VA TAX</tax_zone>
<terms>PREPAY</terms>
 
You may want to change the value of the <shipvia> node value as well. 

Once you've installed the uc_xtuple_edi module and enabled it, go to <yoursite>/admin/store/settings/edi to access edi configuration page. Expand the “Order export settings” section and enter the following settings:

 

Export directory: [Specify the directory on your web server where the module will place the exported file. This directory will need to be writable, so it should be a file outside of your web root]

Export archive directory:

[Specify the directory where the exported file will be moved when it is archived.]
Export file prefix: [Enter a prefix to use for your exported order files. Leave blank for none.]
Export file extension: xml
Export by email settings: [Configure this section if you want to get emails. This will be a handy way to keep track of activity if you've automated everything.]
Export method: [Pick one.]

Export frequency

[Select the frequency at which automatic exports should occur.]
Ready for export order status: Payment received
Exported order status: Completed
Export order comment:     -
Order export prefix:     <?xml version="1.0"?>
    <!DOCTYPE xtupleimport SYSTEM "xtupleapi.dtd">
    <xtupleimport>
Order export suffix:     </xtupleimport>
Order export pattern:
!_,
<customer ignore="true">, !_,
<customer_number quote="false">, !_,
getCustNumberFromInfo(',!primary_email,'&#44;, !_, 
',!billing_company,'&#44;, !_,
',!billing_first_name,'&#44;, !_,
',!billing_last_name,'&#44;, !_,
',!billing_name,'&#44;, !_,
'true'), !_,
</customer_number>, !_,
<customer_name quote="false">, !_,
getCustNameFromInfo(',!primary_email,'&#44;, !_,
',!billing_company,'&#44;, !_,
',!billing_first_name,'&#44;, !_,
',!billing_last_name,'&#44;, !_,
',!billing_name,'&#44;, !_,
'true'), !_,
</customer_name>, !_,
<ship_via>Parcel Post</ship_via>, !_,
<default_currency>USD</default_currency>, !_,
<billing_contact_first>,!billing_first_name,</billing_contact_first>, !_,
<billing_contact_last>,!billing_last_name,</billing_contact_last>, !_,
<billing_contact_voice>,!billing_phone,</billing_contact_voice>, !_,
<billing_contact_email>,!primary_email,</billing_contact_email>, !_,
<billing_contact_address1>,!billing_company,</billing_contact_address1>, !_,
<billing_contact_address2>,!billing_street1,</billing_contact_address2>, !_,
<billing_contact_address3>,!billing_street2,</billing_contact_address3>, !_,
<billing_contact_city>,!billing_city,</billing_contact_city>, !_,
<billing_contact_state>,!billing_zone_code,</billing_contact_state>, !_,
<billing_contact_postalcode>,!billing_postal_code,</billing_contact_postalcode>, !_,
<billing_contact_country>,!billing_country_name,</billing_contact_country>, !_,
<billing_contact_address_change value="CHANGEALL"/>, !_,
<correspond_contact_first>,!billing_first_name,</correspond_contact_first>, !_,
<correspond_contact_last>,!billing_last_name,</correspond_contact_last>, !_,
<correspond_contact_voice>,!billing_phone,</correspond_contact_voice>, !_,
<correspond_contact_email>,!primary_email,</correspond_contact_email>, !_,
<correspond_contact_address1>,!billing_company,</correspond_contact_address1>, !_,
<correspond_contact_address2>,!billing_street1,</correspond_contact_address2>, !_,
<correspond_contact_address3>,!billing_street2,</correspond_contact_address3>, !_,
<correspond_contact_city>,!billing_city,</correspond_contact_city>, !_,
<correspond_contact_state>,!billing_zone_code,</correspond_contact_state>, !_,
<correspond_contact_postalcode>,!billing_postal_code,</correspond_contact_postalcode>, !_,
<correspond_contact_country>,!billing_country_name,</correspond_contact_country>, !_,
<notes></notes>, !_,
</customer>, !_,
<salesorder>, !_,
<order_number>,!order_id,</order_number>, !_,
<order_date>,!created_date,</order_date>, !_,
<pack_date>,!created_date,</pack_date>, !_,
<originated_by value="Internet"/>, !_,
<sales_rep>jsmith</sales_rep>, !_,
<tax_zone>VA TAX</tax_zone>, !_,
<terms>PREPAY</terms>, !_,
<customer_number quote="false">, !_,
getCustNumberFromInfo(',!primary_email,'&#44;, !_,
', !billing_company,'&#44;, !_,
', !billing_first_name,'&#44;, !_,
', !billing_last_name,'&#44;, !_,
', !billing_name,'&#44;, !_,
'true'), !_,
</customer_number>, !_,
<billto_name>,!billing_name,</billto_name>, !_,
<billto_address1>,!billing_company,</billto_address1>, !_,
<billto_address2>,!billing_street1,</billto_address2>, !_,
<billto_address3>,!billing_street2,</billto_address3>, !_,
<billto_city>,!billing_city,</billto_city>, !_,
<billto_state>,!billing_zone_code,</billto_state>, !_,
<billto_postal_code>,!billing_postal_code,</billto_postal_code>, !_,
<billto_country>,!billing_country_name,</billto_country>, !_,
<shipto_number quote="false">, !_,
getShiptoNumberFromInfo(, !_,
getCustNameFromInfo(',!primary_email,'&#44;, !_,
',!delivery_company,'&#44;, !_,
',!delivery_first_name,'&#44;, !_,
',!delivery_last_name,'&#44;, !_,
',!delivery_name,'&#44;, !_,
'false'), !_,
&#44;, !_,
''&#44;, !_,
''&#44;, !_,
',!delivery_first_name,'&#44;, !_,
',!delivery_last_name,'&#44;, !_,
',!delivery_name,'&#44;, !_,
',!delivery_street1,'&#44;, !_,
',!delivery_street2,'&#44;, !_,
NULL&#44;, !_,
',!delivery_city,'&#44;, !_,
',!delivery_zone_code,'&#44;, !_,
',!delivery_postal_code,'&#44;, !_,
',!delivery_country_name,'&#44;, !_,
true&#44;, !_,
true), !_,
</shipto_number>, !_,
<shipto_name>,!delivery_name,</shipto_name>, !_,
<shipto_address1>,!delivery_street1,</shipto_address1>, !_,
<shipto_address2>,!delivery_street2,</shipto_address2>, !_,
<shipto_city>,!delivery_city,</shipto_city>, !_,
<shipto_state>,!delivery_zone_code,</shipto_state>, !_,
<shipto_postal_code>,!delivery_postal_code,</shipto_postal_code>, !_,
<shipto_country>,!delivery_country_name,</shipto_country>, !_,
<ship_via>Parcel Post</ship_via>, !_,
<currency>USD</currency>, !_,
<freight>,!uc_shipping_charges,</freight>, !_,
<order_notes></order_notes>, !_,
</salesorder>, !_,
!products, !_,
<armemo>, !_,
<customer_number quote="false">, !_,
getCustNumberFromInfo(',!primary_email,'&#44;, !_, 
', !billing_company,'&#44;, !_,
', !billing_first_name,'&#44;, !_,
', !billing_last_name,'&#44;, !_,
', !billing_name,'&#44;, !_,
'true'), !_,
</customer_number>, !_,
<document_date>,!created_date,</document_date>, !_,
<due_date>,!created_date,</due_date>, !_,
<document_number quote="false">,fetcharmemonumber(),</document_number>, !_,
<document_type>,Credit Memo,</document_type>, !_,
<amount>,!order_total,</amount>, !_, 
<alternate_prepaid_account quote="false">,formatglaccount(109),</alternate_prepaid_account>,!_,   
</armemo>, !_,
Order product export pattern:
<salesline>, !_,
<order_number>,!order_id,</order_number>, !_,
<line_number>,!#,</line_number>, !_,
<item_number>,!model,</item_number>, !_,
<qty_ordered>,!qty,</qty_ordered>, !_,
<net_unit_price>,!price,</net_unit_price>, !_,
<scheduled_date quote="false">',!scheduled_date,'</scheduled_date>, !_,
<notes></notes>, !_,
</salesline>, !_,
Export pattern delimiter:     nothing
Next order batch ID: [leave it blank.]

Exporting a file from Ubercart

Once you have some orders placed on your store, you are ready to export them.

Go to <mysite>/admin/store/edi to get to the EDI Import/Export page.

You will see a coundt of any orders that are in “Payment Received” status, meaning they are ready to be exported.

Click on the “Export Orders Now” button to generate the export file. It will be written to the export directory you specified on the configuration page.

You will probably need a mechanism to move the exported file from that directory to one where xTuple ERP can pick it up for importing. In our own implementation we wrote a script that checks the export  directory for any files and move them to a directory on a different server, where we have our xTuple ERP database.

Configuring xTuple ERP to import the xml file you exported from Ubercart

Here's the cool part: because the file we exported from Ubercart is already formatted in xml according to the xtupleapi DTD, you can import it directly into xTuple without transforming it. You still need to do some basic configuration to get xTuple ready for importing, however, which is described here.

Create import/export directories

You will need to set up a directory on the file system to store the xsl files for import and export filtering. You will also need to specify a default directory where xTuple will look for files to import, and where it will place exported files.

If you plan to run xTuple Connect to get or put files via FTP, keep in mind that all files will be transferred to and from directories relative to the system where Connect (Batch Manager) is running. If the Connect client and the xTuple client are running on different systems, make sure that both systems have access to the same file resource at the same relative path. 
 
You'll need to set up these three directories first, and then continue to the configuration step.
  • import
  • export
  • xslt

Configure XML Import and Export

Go to System | Setup and select Configure Import and Export
 
On the XLST Settings tab
 
Set a Default XSLT Directory (e.g. Users/xTuple/xslt)
 

In the XSLT Processor section, if you're using a Mac, enter this:

Macintosh: xsltproc %x %f

If you're not on a Mac, follow the instructions for setting up an xslt processor for your system, available here: http://www.xtuple.org/YahooStoreIntegration

Go to the Import Settings tab

Set a Default Import File Directory (e.g. /Users/xTuple/import)

Go to the XML Export tab

Set a Default Import File Directory (e.g. /Users/xTuple/export)

Click SAVE

Make sure your items are set up

Before you try to import any orders, make sure you have created items in xTuple to match those in the online catalog. To work properly, the value of the Ubercart SKU field must match up with your xTuple Item Number filed.

xTuple Item Number = Ubercart SKU

Miscellaneous Settings

System->Configure Modules->Sales, Uncheck “Use calculated freight values by default”

System > Configure Modules > Sales, change Sales Order# Generation to either "Automatic, Allow Override" or "Manual".

System > Master Information > Configure Data Import and Export

Import the Order

Once all your import/export settings are configured, and you have an xml file from ubercart in your local import directory, you are ready to import the file.

Go to System | Utilities | Import Data

If you did it right, you'll see the file there, ready to import. Highlight the file and click IMPORT SELECTED

You should now have an open Sales Order created in xTuple.

In xTuple, find and process the order (you can find open orders on the Issue to Shipping screen, and from there you can Ship them and Post the Invoice). 

Configure the Export from xTuple

Now it's time to configure the system so you can export the order status. Here's what to do:

Prepare your xslt file

For the export we will need to do a small xsl transformation, to convert the xml file that is exported into a csv file that can be parsed by Ubercart.

Copy the text below and save it into a file called xmltocsv.xsl:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="iso-8859-1"/>
<xsl:template match="//shippedOrders">
<xsl:value-of select="thing" />, <xsl:value-of select="cohead_number" />, <xsl:value-of select="shiphead_shipvia" />, <xsl:value-of select="shiphead_tracknum" />
</xsl:template>
</xsl:stylesheet>

Put the file into the xslt directory you created earlier.

Configure xTuple to use the xslt file

Go to System | Setup and select Configure Import/Export

On the XSLT Settings tab, find the section labelled: Map of XSLT Import and Export Filters.

Click on NEW and enter the following info:

Map Name: xmltocsv

Document Type: xtupleimport

System Identifier: xtupleapi.dtd

Export XSLT File Name: [your local path]/xslt/xmltocsv.xsl

Click SAVE

Configure the Export

Go to System | Utilities | Export Data

You'll need to define a new query set that will find the orders that have been shipped, and output the data that needs to be returned to Ubercart.

In the Query Set section, click NEW and enter the following info:

Name: UpdateShippedOrders
Description: Select shipped orders to update store status

Queries in this set: 

You need to define two queries for this set. Click NEW to define the first one with these values:

Name: shippedOrders

Order: 0
Type of Query: Custom Query

Paste in this text for the query:

SELECT 'ORD' AS thing, cohead_number, shiphead_shipvia, shiphead_tracknum
FROM shiphead, cohead
WHERE cohead_id = shiphead_order_id
AND shiphead_shipped = 't'
AND shiphead_notes NOT LIKE '%exported%'

And click SAVE

Click NEW and enter the second query:

Name: markAsExported
Order: 1

Query text:

UPDATE shiphead SET shiphead_notes = (shiphead_notes || ' exported')
WHERE shiphead_shipped = 't'
AND shiphead_notes NOT LIKE '%exported%';

Click SAVE

Execute the export

While you are still in the Export Data screen, Click on Alternate XML and select the xmltocsv file you set up earlier.

Select the UpdateShippedOrders query set, and click EXPORT.

Give the export file a useful name and save it into your default export directory.

This method will work fine for testing, but you will probably eventually want to use the Schedule method to set up Connect to FTP the file to a server on a periodic basis, rather than manually exporting each time.

Import the Order Status data into Ubercart

The final step is to import the file into Ubercart. Place the file you exported from xTuple into your default import directory for the uc_edi module.

Go to your ubercart site and to to admin/store/edi. You should see that there is 1 file ready to import.

Click IMPORT ORDERS NOW.

You should see all your shipped orders are now complete.

 
VapnJeff's picture
Offline
Joined: 04/05/2010
Notes

I just updated the EDI file on my ubercart store today to a full 1.0 version... and I'm assuming because of this I no longer see options for Export Prefix and Suffix. I hope I'm doing this right.....LOL... let the disaster unfold. Actually.... if this works as advertised I'll be happy as pig in mud. Thanks for this option... I can finally run everything on my MAC and OSX.... so no PC's in my business.... nadda

 
bcwilson's picture
Offline
Joined: 12/30/2008
Our EDI module is different

VapnJeff, the uc_edi module that we use to export to xtuple has been forked from the standard uc_edi module, and so you cannot upgrade to the standard one if you want to keep the features we added. I tried to work with the keeper of the module to incorporate our changes into the core, but I never got a response. Our changes would be a useful addition to the module because the prefix and suffix fields are required to be able to export in an xml format, but someone will have to convince the module-keeper of that.

 
VapnJeff's picture
Offline
Joined: 04/05/2010
bc.... I logged into my

bc.... I logged into my drupal/ubercart site today trying to finish it up to open my store and i got a notification that I needed to update the Ubercart EDI module to the newer 6.x-1.x-dev Should I have not done this? Do I need to go back to the other one which I think was 6.x-0.9..... ? before I made the settings match what's above the export file extension was "edi" by default... and not .xml.

Once i get this going and if the ubercart/xtuple combo work half as well as I think they will.... I'll start ranting and raving about it on every ERP site I had the misfortune of trying to labor through before I finally decided Xtuple was my match. And see if I can get the Ubercart guy to open up a little.... or if I start making decent money with this new ecig business I'll offer to pay him ....LOL.

Thanks,
Jeffrey

 
VapnJeff's picture
Offline
Joined: 04/05/2010
Another update

Sorry for the additional posts here but it might be useful to someone who goes and makes the same little boo boo I did. Okay... I shut off the Ubercart EDI module that I had installed.... then I uninstalled it in drupal... then deleted it from the server. So that's now gone. I hadn't noticed that the folder names were different so the older EDI file I originally installed from Xtuple was still there. Upon installed the Ubercart EDI module it make the Xtuple module just not show in my listings of modules that I could activate.

After getting rid of the the Ubercart EDI module I ran update.php.... I then went back into my modules directory and turned on the Xtuple EDI module. After doing this I got the following error:

user warning: Duplicate entry 'edi_export' for key 1 query: INSERT INTO uc_order_statuses (order_status_id, title, state, weight, locked) VALUES ('edi_export', 'Order processed', 'edi_processing', 15, 1),('edi_pending', 'Shipment pending', 'edi_processing', 16, 1); in /home/vaprzco/public_html/sites/all/modules/uc_xtuple_edi/uc_edi.install on line 16.

I am NOW going to go through the same setup steps listed above and see if I see any problems. Or can make any corrections with the duplication that's showing up. Will report back with what happens.

 
VapnJeff's picture
Offline
Joined: 04/05/2010
Last Update and Question

I went through all the installation instructions as before, after moving the Xtuple EDI module back into place. Upon running another update after that I didn't see any errors appear on the reports page, nor did I see an addition error show up in the log.

Everything makes sense for setting up Xtuple to accept the xml file.... except all instructions seem to lead to what is needed for a Yahoo store. Since I'm using Drupal/Ubercart.... is this directory reference file/XSIT Mapping file not required?

NOTE.... if you are viewing this page in Safari and are scratching your head as to where which block of code above should go into which field in Drupal.... well. Switch to the Firefox browser, the table is not showing the internal blocks with Safari for some reason.

 
bcwilson's picture
Offline
Joined: 12/30/2008
No xslt required

VapnJeff,

If you followed the steps above to format your xsl export then your file will already be in a format that xTuple can import. However, the Import/Export XML setup process in xTuple requires you to have an xslt processor in place, just in case. The only reason I directed people to the Yahoo Store setup page is to get the instructions for setting up the xslt processor. If you're on a Mac, you already have xsltproc on your system, and you just need to enter the path to that app in the import settings config screen in xTuple.

 
VapnJeff's picture
Offline
Joined: 04/05/2010
Last question... promise

LOL.... Thanks for your added info demoprocess..... When I look at the "Configure Import/Export" window there is nothing in the first three fields.... but where is says "Map of XSLT import and export filters:".... there is a listing showing the name of Yahoo. Is this what you are referring to? I think I'm getting my wires crossed and suddenly not feeling happy about choosing Xtuple over dumping $500 on some stupid converter for QB for win (god forbid). I took a look at the Yahoo instruction. And since I couldn't find anything that resembled and XSLT processor on my Mac I downloaded Xalan and installed it in with the rest of my applications. Although this really looks more like it's a script as double clicking on the application opens the terminal window. So.... Take a look at this image... hopefully it will come through. Please also understand I'm not very well versed going into terminal mode in Unix minus a few basic commands like ping, traceroute and showing hidden files...

So from looking at the above image and what I think you're trying to tell me.... I need to create a directory where I put my exported orders that come out of Xtuple EDI/ubercart... I then need to put in some kind of command to tell Xtuple to run the file through this XSLT conversion (of sorts) before it imports the which should now be in the proper format to do so. I don't have a clue what to enter in this field.

Am I understanding this or is my head up my rear?.....LOL. Thanks for your help... sorry to sound like such a newbie.... Just seems like this should be easier so I'm ether totally missing something you're telling me... or I just do not yet understand.

Thanks,
Jeffrey

 
VapnJeff's picture
Offline
Joined: 04/05/2010
For the record

I ended up following setting the "settings" in the Mac fields to what was indicated in the online documentation. I'm also going to have to recheck the info I put into the "export settings" as when I ran two test orders in ubercart, I went to the EDI admin page and got the following errors. I don't know if this is because I'm running the site in "test mode" and not allowing the sync to authorize.net to work at the moment.

Here's the ERROR.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'text) FROM orderseq WHERE (orderseq_name='CmNumber')' at line 1 query: SELECT CAST(orderseq_number AS text) FROM orderseq WHERE (orderseq_name='CmNumber') in /home/vaprzco/public_html/sites/all/modules/uc_xtuple_edi/uc_edi.module on line 915.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'text) FROM orderseq WHERE (orderseq_name='CmNumber')' at line 1 query: SELECT CAST(orderseq_number AS text) FROM orderseq WHERE (orderseq_name='CmNumber') in /home/vaprzco/public_html/sites/all/modules/uc_xtuple_edi/uc_edi.module on line 881.

Just checked MyPHPAdmin....
MySQL Server Version 5.0.91-community
Client Version (don't think this will make a difference) 4.1.22

Thank you in advance if anyone can shed any light on this error...

Jeffrey

 
VapnJeff's picture
Offline
Joined: 04/05/2010
Update

Okay, no responses yet.... pout....
I was able to import sales order data despite the errors shown. There are a couple of issues though:

1) When I first tried to import the test data I had yet to enter a single customer.... so it said I don't have a customer "my name which was on the order" and I don't think it imported anything. I just went into the customer listing and added my name. I went back to import the the file from my ubercart/drupal site and voila.... we imported. But..... there's something else missing which I'll get to next. But am I going to have to go through this exercise every time I import data, unless the customer is already in the system??

2) Sales tax data was not transferred. The freight came across just fine but no sales tax. In Ubercart I've got sales tax named "Texas Sales Tax", since this is the only state I'll be charging sales tax on. Does this need to be an exact match to what's in the system? Either "State Sales Tax Revenue" or "State Sales Tax Expense".... or do I change one of their names to match what I've got on in Ubercart?.... will that fix the problem? Or does this have anything to do with the database errors previously listed?

If you guys could get this tweaked a little, along with what I'm now seeing as a potential small headache dealing with receiving batched credit card payments from my processor.... well... then I'm sure you'd get people leaving QB in droves.... especially Mac freaks like myself. QB for Mac isn't anywhere up to snuff with QB Pro last i checked....

Anyway... anyone in the know with additional info for me .... well.... thanks in advance.

Jeffrey

 
ned
ned's picture
Offline
Joined: 10/20/2008
Jeffrey, we'd love to help

Jeffrey, we'd love to help you, but we're probably about at the point where you'd need to buy some consulting time. Please contact sales@xtuple.com, or better yet, buy a block of five hours here :)

 
VapnJeff's picture
Offline
Joined: 04/05/2010
Would love to

Ned,
Believe me I'd love to do that right now but it's just not doable. I've got what will hopefully become $20K in stock in my office waiting for me to make sure I've got my brain wrapped around Xtuple just enough to make sure I'm processing orders (doing the accounting) right. This is for the new company I've started. I have a day job that hasn't paid me in over 6 weeks now and I'm job hunting on the side. I'm just trying to make sure I understand just enough to make sure I don't create an accounting abortion in the process of getting this off the ground. I'm extremely well versed in programs like QB pro and MYOB.... and as I learn Xtuple it basically seems similar except there's a roadblock placed between each transaction...ie... things like vouchers. It's starting to make sense to me in that in a large manufacturing gig, or even a smaller one... you'd be able to delegate jobs/responsibilities with the right road blocks in place to make sure there are the necessary checks and balances. It just takes some getting used to. Very similar to my experience from going from Static web sites development to Drupal. My brain feels like we're in college again taking 19 hours a semester....LOL.

As soon as I can afford to I'll fork over some cash to see how you guys can make this processes easier on me...

Thanks,
Jeffrey

 
asorgenfrei10's picture
Offline
Joined: 03/08/2011
Linux--wget Error 403 Forbidden

Hi all, I work at a company that runs its website off a Linux-server. I normally use the wget command and paste the download link to download a tar.gz file when uploading a Drupal module. However, that doesn't seem to work here. I am trying to upload the uc_edi_xtuple-1.2.gz to our development site for testing and when I use wget, I get an Error 403-Forbidden message.

Does anyone know how to get around this or if there is a tar.gz version of this module?

Thanks,

Andrew

 
bcwilson's picture
Offline
Joined: 12/30/2008
The link is protected

asorgenfrei, the link to download the file from your My Accounts section is a special link that only works when clicked from that page. The file itself is fine, but you will need to download it to a local server and then upload it to your local site. Your wget method will not work to transfer the file from directly from the download site.

 
asorgenfrei10's picture
Offline
Joined: 03/08/2011
protected link

okay, well I am not sure if I am able to all that. normally, I upload modules purely through terminal. I did copy the file to the local server as you suggested but have hit a wall at this point

 
bcwilson's picture
Offline
Joined: 12/30/2008
how about ftp?

It's a pretty common practice to use ftp to transfer files to a server. Does your host not allow that method?

 
asorgenfrei10's picture
Offline
Joined: 03/08/2011
re:ftp

well, our server uses samba shares

 
asorgenfrei10's picture
Offline
Joined: 03/08/2011
xml error

hello,

when running tests with the uc_xtuple_edi module, I am getting a strange xml error. it looks like this:

XML Parsing Error: junk after document element
Location: file:///tmp/2071.xml
Line Number 46, Column 1:
^

I guess something is wonky with the xml. I configured the module according to the xtuple documentation.

Thoughts?

 
bcwilson's picture
Offline
Joined: 12/30/2008
Look carefully

Andrew,

Look carefully at the text you pasted into the module. You may have left extra spaces or characters at the end.

BC

 
aki
aki's picture
Offline
Joined: 10/19/2009
I have followed these

I have followed these instructions meticulously (even when they weren't totally clear) but the import keeps throwing errors. I have massaged it into compliance, with the exception two:

  • Ignored error while importing customer: ERROR: duplicate key value violates unique constraint "custinfo_cust_number_key"

    • This error is ignorable, as xtuple works around it, but it's really annoying. Is there a way to either prevent or supress this error message?
  • The second error prevents orderlines from being added to Sales Orders, and is a show-stopper. Is there something obvious that I'm missing that is causing this?

    • <!--ERROR: Function insertSalesLine failed with unknown failure to retrieve Sales Order
      QPSQL: Unable to create query-->
 
bcwilson's picture
Offline
Joined: 12/30/2008
Sounds like you're close

aki,

It sounds like you are very close to getting this working. You're right about the first issue--that dupe key error is just a warning. There's not a way to turn it off, but you can ignore it.

As for the second issue, I can't think of anything obvious that would cause that. We would need to dig in more deeply to determine the problem. Please go ahead and contact us via the customer support page (http://www.xtuple.org/support), and we can assist you.

 
aki
aki's picture
Offline
Joined: 10/19/2009
As for the first issue, I'm

As for the first issue, I'm trying to find a workaround. When the importer finds multiple potential matches, it throws an error and doesn't import the order. I'll probably write my own version of getcustnamefrominfo to only look for and match email addresses. I'm going to have to write a version of getbillingaddress, shipping address, etc too. (Unless there's a way to make the importer just pick a customer if multiples match?)

The second issue was an easy fix- may not work for everyone, but I just hard-coded into the xml.

 
lkujala's picture
Offline
Joined: 03/25/2011
Found a Bug

I have found a bug in the module (dont see any place under issues to report it though).

Cause: if you run the export and have no orders, the module throws a warning: Invalid argument supplied for foreach() in ...\httpdocs\sites\all\modules\uc_edi\uc_edi.module on line 701.

HERE is the Block of code...

while ($order = db_fetch_object($result)) {
// Keep array of orders to modify after successfull export.
$orders[] = $order;
// Load each valid order and create its export string.
$order = uc_order_load($order->order_id);
// Create each order's export string.
$contents .= uc_edi_generate_order_export($order);
}

//added by Steven
if (!empty($contents))
{
$contents .= variable_get('uc_edi_order_export_xmlsuffix', '');
}

// Create the export file.
if (uc_edi_create_export('order', $filename, $contents)) {
// Pull the EDI Export trigger on all the orders.
foreach ($orders as $order) {
ca_pull_trigger('uc_edi_order_export', $order);
}

// Update the order export timestamp.
variable_set('uc_edi_order_export_last', time());

return $filename;
}

---
The $orders variable is defined in the While loop and later referenced in the ForEach loop....

however, if there are No orders, the while loop exits immediately without defining the $orders variable (a classic PHP undefined reference error).

---

Obviously this is a boundary case that occurs when you try to export nothing...

Note: the xml file seems to be created correctly as an empty xml file...

<?xml version="1.0"?>

 
VapnJeff's picture
Offline
Joined: 04/05/2010
Question-Drupal 7?

Does anyone know if there are any plans to port this module over to Drupal 7 and Ubercart 3? I was able to get this thing working just fine and dandy with the business I needed it for, but, due to several contributing factors, I had to shut it down(business). May relaunch the effort but I do have several other Drupal sites I've already converted over to Drupal 7. I'd like to open stores on a couple of them. Would be cool if I could get this same function with the newer system. D7 is soooooooooo much better than Drupal 6. Kind of like going from Mac OS 9 to OS X in my opinion. If anyone knows about this, please respond.

Thanks,
Jeffrey

 
ned
ned's picture
Offline
Joined: 10/20/2008
Eventually. It's on our

Eventually. It's on our "nice to have, no one is sponsoring it" list.

 
VapnJeff's picture
Offline
Joined: 04/05/2010
Curiosity

Just roughly how much would something like that cost to "sponsor"?

Thanks,
Jeffrey

 
bcwilson's picture
Offline
Joined: 12/30/2008
Porting module to D7.

VapnJeff,

We have no plan to update the module at this time, as we are not planning to migrate to Drupal 7 this year. However, this being community software, we would LOVE it if you or another would step in and take a stab at updating the edi module for D7 before we get around to it.

Thanks.
BC

 
VapnJeff's picture
Offline
Joined: 04/05/2010
If it were only that easy... for me..:)

LOL... sorry.... that idea seems so impossibly funny at the moment. I'm presently trying to shove all the data in my head so that I can finally create custom themes in D6 and more so in D7. Once I get half decent at that I'll start expanding my skill set for module development. Lots for me to learn there for sure... heck... maybe the first module I can try to totally screw up could be in turning the EDI from D6 to D7....LOL.

I think I might be better suited to coming up with the cash to pay someone who gave me a bid for the job though... Only time will tell. But thanks for the encouragement BC.

All my best,
Jeffrey

 
ned
ned's picture
Offline
Joined: 10/20/2008
Actually...

More likely we will be using Drupal Commerce when we upgrade to Drupal 7.

 
VapnJeff's picture
Offline
Joined: 04/05/2010
Never fails

Of course......LOL. Can't stand what I've seen of the interface for Drupal Commerce.... but then I haven't installed in on any of my D7 sites. I'll do that soon to start learning it. However, I think DC is really kind of over rated. Ubercart is really a nice system, easy to use, install and work with, all important for small business owners. While Drupal Commerce may offer more ability to scale up far above and beyond Ubercart, the ease of use isn't there best I can tell at the moment. I also hope you guys don't drop integration with UC to find that DC goes the way of Drupal eCommerce. Just a thought but thanks for your heads up.

Jeffrey