[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CLI order and invoice scripts (was: COGS and part setup)
- Subject: Re: CLI order and invoice scripts (was: COGS and part setup)
- From: Charley Tiggs <..hidden..>
- Date: Thu, 28 Jun 2007 02:15:48 -0500
A little later than I wanted but here's what I promised, in all it's bug
ugly, messy glory. I'll explain a little. Please bear in mind that
I've never released any code to a larger community like this so there
may be pieces/components needed that I didn't include. Please ask. I
can't release the entire shopping cart because each cart is written with
specific business rules for each of my clients and none of them wanted
to give permission to release a sanitized version of their cart. But
the core class that interfaces with LSMB is almost exactly the same,
with the exception of the submit_order() and submit_product() functions
within the lsmb_mgr class.
List of files:
dao_lsmb.php - abstract data access class that allows me to interact
directly with the LSMB schema and treat each row as an object
lsmb_mgr.php - core class used to interact with LSMB. The views that
drove some of the functions are included near bottom of the file.
misc_functions.php - these are helper functions
vendor_mgr.php - very first class created to interact with LSMB. I
ended up stripping this down to the bare necessities and just passing
data to the cli instead of writing directly to the database.
None of these files are very well documented. I did take the time to
get examples of arrays that are passed to each function and include with
the class. Other than that, these are presented as is.
There are several assumptions being made by the core class that you need
to keep in mind:
1) there are two schemas here, not one. One to help drive the
e-commerce logic, one for lsmb itself.
2) writes are all one-way. Information is collected by the e-commerce
app and sent to LSMB. So, the assumption is that what exists in LSMB
should exist in the e-commerce application before it gets into LSMB. If
I need some information from LSMB, I either created a view or accessed
tables directly, but only for reading purposes. In fact, the e-commerce
user has read-only access to the ledgersmb schema. I am hoping, though,
that 1.3 and later of LSMB will allow me to start consolidating these
into one db one schema and that reading would become easier to manage.
3) taxes are treated as a service. That means all customers are marked
as having no tax rules within LSMB. It was more important to make sure
the rules were functioning correctly in the e-commerce app. At that
point, it was easier to pass in the result than to try to replicate
those rules within LSMB.
I'm sure there are other assumptions I made that probably need to be
clarified. Please feel free to ask some questions.
Hope that helps. Let me know if you have any questions.
Jeff Kowalczyk wrote:
Could I prevail on you to release some version of your scripts? I need to
implement this same functionality on a short timetable, and would rather assist
in generalizing working scripts for wider use than reinventing the wheel.
The REST API does not appear to be sufficiently far along to use yet.
Subject: Re: CLI order and invoice scripts (was: COGS and part setup)
From: Jeff Kowalczyk <..hidden..>
Date: Sat, 31 Mar 2007 12:46:28 -0400
Charley Tiggs wrote:
I'm using the cli interface to add orders and invoices. It's working
like a champ and, aside from a few glitches, we couldn't be more
Charley, would you add some version of those CLI scripts to the wiki
documentation or a submit them for inclusion in a /contrib location in the
I'm very interested in a quick method to implement order and invoice automation
prior to the REST interface slated for 1.3.
It would be good for the community to comment on and document a best-practice
for this, since so many users need it.
Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
Ledger-smb-devel mailing list