From: Lindsay H. <li...@bl...> - 2010-04-05 06:11:09
|
On Monday 05 April 2010 16:05:31 Phil Daintree wrote: > I see it the same... > > Similarly sales made at the POS should be logged to perhaps the same > file and processed in the same way through the webERP API... I am not > sure if there is yet an API function to process a sale directly creating > the order etc ... I could do this bit if needed. That bit works! I now regularly create sales orders by downloading an XML file from the online store (VirtualMart running under Joomla), then feed it through a PHP program and into the API. Bingo, sales orders entered. The API does not fully handle invoicing. Tim's application is a hospital, and (I'm guessing) his needs were only for the "executive summary" invoicing, namely transferring funds. There is no stock adjustment and all those other complications. I have been thinking about this for some time. Thuoghts are not fully set yet, but here's a rough sketch. WebERP's code structure should be split into 3 functional groups. 1/ Database manipulation 2/ HTML/web interface 3/ API 4/ POS???? Obviously 2 and 3 make calls into 1. The API is already structured as a 2 layer operation - the first deals with the RPC, converting incoming data to calls to regular PHP functions. And, obviously, doing the reverse on the way back. The other layer verifies the data and meddles with the database. Yet another benefit of this is another project I have for the future. The PHP program I use to transform the XML from VirtualMart is all table driven, coupled with PHP's XML decoding. This could be added to the HTML interface, with a set of tables to translate from XML tags to DB fields. In this instance, it would likely be that the HTML section (basically its job is to upload the XML and feed it into the XML decoder) would call the internal API functions to validate the data before applying it to the database. This is not a UTF style project, requiring it all be done at once. Before being distracted onto other subjects, I started ripping the invoice generating code out of the HTML generating file it is in currently. Then amend the API to use this to transfer stock and do all the other things the current API does not need to do. And then I also want to look at having webERP talk to PayPal. My problem is continuing to think of new ideas :-) Lindsay |