<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Enhance DB activities to allow more extensions]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7360</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7360&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Enhance DB activities to allow more extensions.]]></description>
		<lastBuildDate>Wed, 28 Feb 2018 02:08:42 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Enhance DB activities to allow more extensions]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30931#p30931</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 28 Feb 2018 02:08:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30931#p30931</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enhance DB activities to allow more extensions]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30929#p30929</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (fraserks)]]></author>
			<pubDate>Tue, 27 Feb 2018 19:35:14 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30929#p30929</guid>
		</item>
		<item>
			<title><![CDATA[Re: Enhance DB activities to allow more extensions]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30926#p30926</link>
			<description><![CDATA[<p>Connecting to other applications is best done using the REST API (See SlimAPI in the wiki).</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 27 Feb 2018 19:07:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30926#p30926</guid>
		</item>
		<item>
			<title><![CDATA[Enhance DB activities to allow more extensions]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30921#p30921</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (fraserks)]]></author>
			<pubDate>Tue, 27 Feb 2018 16:59:52 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30921#p30921</guid>
		</item>
	</channel>
</rss>
