<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Enhance DB activities to allow more extensions]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7360&amp;type=atom" />
	<updated>2018-02-28T02:08:42Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7360</id>
		<entry>
			<title type="html"><![CDATA[Re: Enhance DB activities to allow more extensions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30931#p30931" />
			<content type="html"><![CDATA[<p>You will need to pull in the data from FA into your application from within your application or program a trigger in the FA DB to populate your application DB.</p><p>To pull in FA data from within your application, use the FA SlimAPI to create a script that can be run on demand or in a cron job.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-02-28T02:08:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30931#p30931</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Enhance DB activities to allow more extensions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30929#p30929" />
			<content type="html"><![CDATA[<p>Does the SlimAPI work on a push out of FA basis?&nbsp; </p><p>When I add or update a customer in FA, I want that details pushed to Suite.&nbsp; And in Suite, I have a module that will push to the other integration points when it updates records.</p><p>Thanks</p>]]></content>
			<author>
				<name><![CDATA[fraserks]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41872</uri>
			</author>
			<updated>2018-02-27T19:35:14Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30929#p30929</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Enhance DB activities to allow more extensions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30926#p30926" />
			<content type="html"><![CDATA[<p>Connecting to other applications is best done using the REST API (See SlimAPI in the wiki).</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-02-27T19:07:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30926#p30926</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Enhance DB activities to allow more extensions]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30921#p30921" />
			<content type="html"><![CDATA[<p>Greetings all,</p><p>I am working on an extension to send customer data from Front Accounting to our newly implemented SuiteCRM instance (and eventually our WooCommerce shop).&nbsp; I see in the Sales area, there are hook_prewrite and _postwrite calls passing the shopping cart, which would let me send sales data.</p><p>I would like to suggest we enhance the other areas of FA similarly.&nbsp; To this end, I&#039;ve started in the customer area.&nbsp; I have defined some new types CT_ADDCUST etc.&nbsp; I have also added the pre and post hook calls in the 6 routines that add/update/delete customers and branches.&nbsp; </p><p>define(&#039;CT_ADDCUST&#039;, 50 );<br />define(&#039;CT_UPDATECUST&#039;, 51 );<br />define(&#039;CT_DELETECUST&#039;, 52 );<br />define(&#039;CT_ADDBRANCH&#039;, 55 );<br />define(&#039;CT_UPDATEBRANCH&#039;, 56 );<br />define(&#039;CT_DELETEBRANCH&#039;, 57 );</p><p>To allow this to be upgrade safe and the extension module not needing to know the triggering core module, the types defined in includes/types.inc would need to be renumbered so that each transaction type is unique (they currently restart at 1). (e.g. BT_TRANSFER 1)</p><p>Ideally, all of the core modules would pass an object, similar to the CART in the sales area, but an interim step that I have working would be to use func_get_args() to pass an array:</p><p>$arr = func_get_args();<br />hook_db_prewrite( $arr, CT_ADDBRANCH );<br />db_query(...);<br />//if there is a returned index value (i.e. on insert) we could add that into the $arr...<br />hook_db_postwrite( $arr, CT_ADDBRANCH );</p><p>I am currently developing against 2.3.22 but also did a quick check in 2.4.1 to see if there had been any changes along this lines in the customer/branch codes.</p><p>As I have only started working this, I am very open to ideas on how to architect this, and if anyone can identify reasons for FA to NOT have these enhancements.</p><p>Have a great day!</p>]]></content>
			<author>
				<name><![CDATA[fraserks]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41872</uri>
			</author>
			<updated>2018-02-27T16:59:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30921#p30921</id>
		</entry>
</feed>
