<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — refs table]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7473&amp;type=atom" />
	<updated>2018-04-27T16:08:34Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7473</id>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31537#p31537" />
			<content type="html"><![CDATA[<p>The second snippet is from the above transfer.inc , line 59.</p><p>I think I broke functionality for single addition, I will try to fix it and update the example later on.</p>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2018-04-27T16:08:34Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31537#p31537</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31535#p31535" />
			<content type="html"><![CDATA[<p>You might also want to modify the &quot;//Example&quot; in transfer.inc to match your multiple {stock_id, quantity} line entries. In which file did you make the changes listed in your second code snippet above?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-04-27T16:02:56Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31535#p31535</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31532#p31532" />
			<content type="html"><![CDATA[<p>I bring good news. I managed to modify it so it can handle multiple items entry.<br />POST the stock_id, qty, as arrays ex:<br /></p><div class="codebox"><pre><code>stock_id[0]
stock_id[1]
stock_id[2]
quantity[0]
quantity[1]
quantity[2]</code></pre></div><p>Here is the new transfer.inc<br /></p><div class="codebox"><pre><code>&lt;?php
/**********************************************
Author: Andres Amaya
Name: Inventory REST API
Free software under GNU GPL
***********************************************/
$path_to_root = &quot;../..&quot;;
include_once ($path_to_root . &quot;/inventory/includes/inventory_db.inc&quot;);
include_once ($path_to_root . &quot;/inventory/includes/db/items_codes_db.inc&quot;);
include_once ($path_to_root . &quot;/inventory/includes/db/items_locations_db.inc&quot;);
include_once ($path_to_root . &quot;/inventory/includes/db/items_transfer_db.inc&quot;);
include_once ($path_to_root . &quot;/gl/includes/gl_db.inc&quot;);
include_once ($path_to_root . &quot;/includes/ui/items_cart.inc&quot;);
function stock_transfer_add()
{
    $app = \Slim\Slim::getInstance(&#039;SASYS&#039;);
    $req = $app-&gt;request();
    $info = $req-&gt;post();
    // Example
    // $ex = array(&#039;stock_id&#039; =&gt; &#039;PLUMA&#039;, &#039;location_from&#039; =&gt; &#039;DEF&#039;, &#039;location_to&#039; =&gt; &#039;XXX&#039;, &#039;date&#039; =&gt; today(), &#039;reference&#039; =&gt;
    // &#039;123qwe&#039;, &#039;quantity&#039; =&gt; 555, &#039;standard_cost&#039; =&gt; 10, &#039;memo&#039; =&gt; &#039;Proof of API 2&#039;);
    // echo base64_encode(json_encode($ex));
    // print_r($info);
    // Validate Required Fields
    if (! isset($info[&#039;stock_id&#039;])) {
        api_error(412, &#039;Stock Id is required aieu&#039;);
    }
    if (! isset($info[&#039;location_from&#039;])) {
        api_error(412, &#039;Location from is required&#039;);
    }
    if (! isset($info[&#039;location_to&#039;])) {
        api_error(412, &#039;Location to is required&#039;);
    }
    if (! isset($info[&#039;date&#039;])) {
        api_error(412, &#039;Date is required&#039;);
    }
    if (! isset($info[&#039;reference&#039;])) {
        api_error(412, &#039;Reference is required&#039;);
    }
    if (! isset($info[&#039;quantity&#039;])) {
        api_error(412, &#039;Quantity is required&#039;);
    }
    if (! isset($info[&#039;standard_cost&#039;])) {
        $info[&#039;standard_cost&#039;] = 0;
    }
    if (! isset($info[&#039;memo&#039;])) {
        api_error(412, &#039;Memo is required&#039;);
    }
    // Create Adjustment Order
    unset($_SESSION[&#039;transfer_items&#039;]);
    $_SESSION[&#039;transfer_items&#039;] = new items_cart(ST_LOCTRANSFER);
    $_SESSION[&#039;gl_items&#039;] = new items_cart(0);
    $info[&#039;date&#039;] = today();
    if (! is_date_in_fiscalyear($info[&#039;date&#039;]))
        $info[&#039;date&#039;] = end_fiscalyear();
    $_SESSION[&#039;transfer_items&#039;]-&gt;tran_date = $info[&#039;date&#039;];
    $_SESSION[&#039;gl_items&#039;]-&gt;tran_date = $info[&#039;date&#039;];
    // This should never happen
    if ($_SESSION[&#039;transfer_items&#039;]-&gt;find_cart_item($info[&#039;stock_id&#039;]))
        api_error(500, &#039;Item Already Exists In Cart&#039;);
    else {
        for($i = 0; $i &lt; count($info[&#039;stock_id&#039;]); $i++) {
        $_SESSION[&#039;transfer_items&#039;]-&gt;add_to_cart($i, $info[&#039;stock_id&#039;][$i], $info[&#039;quantity&#039;][$i], 0);
        // $code_id, $dimension_id, $dimension2_id, $amount, $reference, $description=null
        // TODO Obtain accounts against which to make seats
        // Product Inventory
        $_SESSION[&#039;gl_items&#039;]-&gt;add_gl_item(&#039;1510&#039;, 0, 0, ($info[&#039;quantity&#039;][$i] * $info[&#039;standard_cost&#039;][$i] * - 1), $info[&#039;memo&#039;]);
        // Configured for Absolute, Own
        $_SESSION[&#039;gl_items&#039;]-&gt;add_gl_item(&#039;4010&#039;, 0, 0, ($info[&#039;quantity&#039;][$i] * $info[&#039;standard_cost&#039;][$i]), $info[&#039;memo&#039;]);
        $_SESSION[&#039;gl_items&#039;]-&gt;order_id = 0;
        $_SESSION[&#039;gl_items&#039;]-&gt;reference = 666;
        }
    }
    /*
     * print_r($_SESSION[&#039;transfer_items&#039;]); echo &quot;----------- GL -------&quot;; print_r($_SESSION[&#039;gl_items&#039;]); echo &quot;------
     * DEBIT: &quot; . $_SESSION[&#039;gl_items&#039;]-&gt;gl_items_total_debit(); echo &quot;------ CREDIT: &quot; .
     * $_SESSION[&#039;gl_items&#039;]-&gt;gl_items_total_credit();
     */
    // Process Order
    $trans_no = add_stock_transfer($_SESSION[&#039;transfer_items&#039;]-&gt;line_items, $info[&#039;location_from&#039;], $info[&#039;location_to&#039;], $info[&#039;date&#039;], $info[&#039;reference&#039;], $info[&#039;memo&#039;]);
    $gl_trans_no = write_journal_entries($_SESSION[&#039;gl_items&#039;], false);
    new_doc_date($info[&#039;date&#039;]);
    $_SESSION[&#039;transfer_items&#039;]-&gt;clear_items();
    unset($_SESSION[&#039;transfer_items&#039;]);
    $_SESSION[&#039;gl_items&#039;]-&gt;clear_items();
    unset($_SESSION[&#039;gl_items&#039;]);
    api_create_response(&quot;Stock Transfer has been added&quot;);
}
?&gt;</code></pre></div><p>I didn&#039;t merge the code with inventory.inc out of fear messing the original entry.</p><p>Here is where some changes is made:<br /></p><div class="codebox"><pre><code>if ($_SESSION[&#039;transfer_items&#039;]-&gt;find_cart_item($info[&#039;stock_id&#039;]))
        api_error(500, &#039;Item Already Exists In Cart&#039;);
    else {
        for($i = 0; $i &lt; count($info[&#039;stock_id&#039;]); $i++) {
        $_SESSION[&#039;transfer_items&#039;]-&gt;add_to_cart($i, $info[&#039;stock_id&#039;][$i], $info[&#039;quantity&#039;][$i], 0);
        // $code_id, $dimension_id, $dimension2_id, $amount, $reference, $description=null
        // TODO Obtain accounts against which to make seats
        // Product Inventory
        $_SESSION[&#039;gl_items&#039;]-&gt;add_gl_item(&#039;1510&#039;, 0, 0, ($info[&#039;quantity&#039;][$i] * $info[&#039;standard_cost&#039;][$i] * - 1), $info[&#039;memo&#039;]);
        // Configured for Absolute, Own
        $_SESSION[&#039;gl_items&#039;]-&gt;add_gl_item(&#039;4010&#039;, 0, 0, ($info[&#039;quantity&#039;][$i] * $info[&#039;standard_cost&#039;][$i]), $info[&#039;memo&#039;]);
        $_SESSION[&#039;gl_items&#039;]-&gt;order_id = 0;
        $_SESSION[&#039;gl_items&#039;]-&gt;reference = 666;
        }
    }</code></pre></div><p>Now, I MacGyvered (figured out) most of my way into the code to make it work. I have zero clue in some areas of the code, example is the &#039;gl_items&#039; entries. I have zero idea what it does in the system and my code may mess something up. I hope someone knowledgeable on it could help me on this.</p>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2018-04-27T14:50:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31532#p31532</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31530#p31530" />
			<content type="html"><![CDATA[<p>@justapeddler: Thanks for your submissions and feedback. This is the real spirit of FA that keeps it ticking!<br />As stock transfers are part of inventory, it might make sense to extend inventory.inc, but keeping it in a separate transfer.inc&nbsp; will make for independent development. Please go thru it thoroughly for different scenarios and then I can add it in to the FA24extensions repo.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-04-27T03:27:03Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31530#p31530</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31529#p31529" />
			<content type="html"><![CDATA[<p>I finally get the stock transfer API to work.</p><p>For anyone interested,</p><p>create a new transfer.inc file at the main api directory:<br /></p><div class="codebox"><pre><code>&lt;?php
/**********************************************
Author: Andres Amaya
Name: Inventory REST API
Free software under GNU GPL
***********************************************/
$path_to_root = &quot;../..&quot;;
include_once ($path_to_root . &quot;/inventory/includes/inventory_db.inc&quot;);
include_once ($path_to_root . &quot;/inventory/includes/db/items_codes_db.inc&quot;);
include_once ($path_to_root . &quot;/inventory/includes/db/items_locations_db.inc&quot;);
include_once ($path_to_root . &quot;/inventory/includes/db/items_transfer_db.inc&quot;);
include_once ($path_to_root . &quot;/gl/includes/gl_db.inc&quot;);
include_once ($path_to_root . &quot;/includes/ui/items_cart.inc&quot;);
function stock_transfer_add()
{
    $app = \Slim\Slim::getInstance(&#039;SASYS&#039;);
    $req = $app-&gt;request();
    $info = $req-&gt;post();
    // Example
    // $ex = array(&#039;stock_id&#039; =&gt; &#039;PLUMA&#039;, &#039;location_from&#039; =&gt; &#039;DEF&#039;, &#039;location_to&#039; =&gt; &#039;XXX&#039;, &#039;date&#039; =&gt; today(), &#039;reference&#039; =&gt;
    // &#039;123qwe&#039;, &#039;quantity&#039; =&gt; 555, &#039;standard_cost&#039; =&gt; 10, &#039;memo&#039; =&gt; &#039;Proof of API 2&#039;);
    // echo base64_encode(json_encode($ex));
    // print_r($info);
    // Validate Required Fields
    if (! isset($info[&#039;stock_id&#039;])) {
        api_error(412, &#039;Stock Id is required aieu&#039;);
    }
    if (! isset($info[&#039;location_from&#039;])) {
        api_error(412, &#039;Location from is required&#039;);
    }
    if (! isset($info[&#039;location_to&#039;])) {
        api_error(412, &#039;Location to is required&#039;);
    }
    if (! isset($info[&#039;date&#039;])) {
        api_error(412, &#039;Date is required&#039;);
    }
    if (! isset($info[&#039;reference&#039;])) {
        api_error(412, &#039;Reference is required&#039;);
    }
    if (! isset($info[&#039;quantity&#039;])) {
        api_error(412, &#039;Quantity is required&#039;);
    }
    if (! isset($info[&#039;standard_cost&#039;])) {
        $info[&#039;standard_cost&#039;] = 0;
    }
    if (! isset($info[&#039;memo&#039;])) {
        api_error(412, &#039;Memo is required&#039;);
    }
    // Create Adjustment Order
    unset($_SESSION[&#039;adj_items&#039;]);
    $_SESSION[&#039;adj_items&#039;] = new items_cart(ST_LOCTRANSFER);
    $_SESSION[&#039;gl_items&#039;] = new items_cart(0);
    $info[&#039;date&#039;] = today();
    if (! is_date_in_fiscalyear($info[&#039;date&#039;]))
        $info[&#039;date&#039;] = end_fiscalyear();
    $_SESSION[&#039;adj_items&#039;]-&gt;tran_date = $info[&#039;date&#039;];
    $_SESSION[&#039;gl_items&#039;]-&gt;tran_date = $info[&#039;date&#039;];
    // This should never happen
    if ($_SESSION[&#039;adj_items&#039;]-&gt;find_cart_item($info[&#039;stock_id&#039;]))
        api_error(500, &#039;Item Already Exists In Cart&#039;);
    else {
        $_SESSION[&#039;adj_items&#039;]-&gt;add_to_cart(count($_SESSION[&#039;adj_items&#039;]-&gt;line_items), $info[&#039;stock_id&#039;], $info[&#039;quantity&#039;], $info[&#039;standard_cost&#039;]);
        // $code_id, $dimension_id, $dimension2_id, $amount, $reference, $description=null
        // TODO Obtain accounts against which to make seats
        // Product Inventory
        $_SESSION[&#039;gl_items&#039;]-&gt;add_gl_item(&#039;1510&#039;, 0, 0, ($info[&#039;quantity&#039;] * $info[&#039;standard_cost&#039;] * - 1), $info[&#039;memo&#039;]);
        // Configured for Absolute, Own
        $_SESSION[&#039;gl_items&#039;]-&gt;add_gl_item(&#039;4010&#039;, 0, 0, ($info[&#039;quantity&#039;] * $info[&#039;standard_cost&#039;]), $info[&#039;memo&#039;]);
        $_SESSION[&#039;gl_items&#039;]-&gt;order_id = 0;
        $_SESSION[&#039;gl_items&#039;]-&gt;reference = 666;
    }
    /*
     * print_r($_SESSION[&#039;adj_items&#039;]); echo &quot;----------- GL -------&quot;; print_r($_SESSION[&#039;gl_items&#039;]); echo &quot;------
     * DEBIT: &quot; . $_SESSION[&#039;gl_items&#039;]-&gt;gl_items_total_debit(); echo &quot;------ CREDIT: &quot; .
     * $_SESSION[&#039;gl_items&#039;]-&gt;gl_items_total_credit();
     */
    // Process Order
    $trans_no = add_stock_transfer($_SESSION[&#039;adj_items&#039;]-&gt;line_items, $info[&#039;location_from&#039;], $info[&#039;location_to&#039;], $info[&#039;date&#039;], $info[&#039;reference&#039;], $info[&#039;memo&#039;]);
    $gl_trans_no = write_journal_entries($_SESSION[&#039;gl_items&#039;], false);
    new_doc_date($info[&#039;date&#039;]);
    $_SESSION[&#039;adj_items&#039;]-&gt;clear_items();
    unset($_SESSION[&#039;adj_items&#039;]);
    $_SESSION[&#039;gl_items&#039;]-&gt;clear_items();
    unset($_SESSION[&#039;gl_items&#039;]);
    api_create_response(&quot;Stock Transfer has been added&quot;);
}
?&gt;</code></pre></div><p>Add this to index.php just below line 131:<br /></p><div class="codebox"><pre><code>// ------------------------------- Stock Transfers -------------------------------
// Add Stock Adjustment
$rest-&gt;post(&#039;/stocktransfer/&#039;, function () use($rest)
{
    include_once (API_ROOT . &quot;/transfer.inc&quot;);
    stock_transfer_add();
});
// ------------------------------- Stock Transfers -------------------------------</code></pre></div><p>The API post path is /stocktransfer/</p><p>I tested it and so far it works as I needed it and no problems found so far.</p><p>Thank you apmuthu for all the assistance!</p>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2018-04-26T13:11:57Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31529#p31529</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31498#p31498" />
			<content type="html"><![CDATA[<p>There is no need for the<strong>$info</strong> argument in <strong>inventory.inc</strong> as it gets assigned inside the <em>function stock_adjustment_add()</em> on <a href="https://github.com/apmuthu/FA24extensions/blob/master/Extensions/api24/inventory.inc#L19">line 19</a>.</p><p><a href="https://github.com/apmuthu/FA24extensions/commit/3ea1a4cf577c7525467f70fddbafcf1a604d1dc6">Committed</a>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-04-23T16:48:49Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31498#p31498</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31497#p31497" />
			<content type="html"><![CDATA[<p>I am still trying the functionality of the /stock/ or stock adjustment api to ensure that it has no problem. Apparently it has.</p><p>I think i also found the problem.</p><p>Inventory.inc line 15:<br /></p><div class="codebox"><pre><code>  
function stock_adjustment_add($info) </code></pre></div><p>index.php line 129:<br /></p><div class="codebox"><pre><code>stock_adjustment_add();</code></pre></div><p>The inventory adjustment api code part in the index.php has different syntax from the rest (it does not use the FAAPI php path). I am currently clueless about this.</p><p>I dont know if omitting the $info argument from the function inside inventory.inc would work, I can only test it tomorrow.</p>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2018-04-23T15:55:40Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31497#p31497</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31496#p31496" />
			<content type="html"><![CDATA[<p>Since stock transfer needs another argument, the prototypes too must be modified.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-04-23T14:46:44Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31496#p31496</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31490#p31490" />
			<content type="html"><![CDATA[<p>My api returned this error:</p><div class="codebox"><pre><code>Slim Application Error

The application could not run because of the following error:
Details
Type: ErrorException
Code: 2
Message: Missing argument 1 for stock_adjustment_add(), called in C:\xampp\htdocs\fa\modules\api24\index.php on line 129 and defined
File: C:\xampp\htdocs\fa\modules\api24\inventory.inc
Line: 15
Trace

#0 C:\xampp\htdocs\fa\modules\api24\inventory.inc(15): Slim\Slim::handleErrors(2, &#039;Missing argumen...&#039;, &#039;C:\\xampp\\htdocs...&#039;, 15, Array)
#1 C:\xampp\htdocs\fa\modules\api24\index.php(129): stock_adjustment_add()
#2 [internal function]: {closure}()
#3 C:\xampp\htdocs\fa\modules\api24\Slim\Route.php(468): call_user_func_array(Object(Closure), Array)
#4 C:\xampp\htdocs\fa\modules\api24\Slim\Slim.php(1355): Slim\Route-&gt;dispatch()
#5 C:\xampp\htdocs\fa\modules\api24\Slim\Middleware\Flash.php(85): Slim\Slim-&gt;call()
#6 C:\xampp\htdocs\fa\modules\api24\Slim\Middleware\MethodOverride.php(92): Slim\Middleware\Flash-&gt;call()
#7 C:\xampp\htdocs\fa\modules\api24\index.php(59): Slim\Middleware\MethodOverride-&gt;call()
#8 C:\xampp\htdocs\fa\modules\api24\Slim\Middleware\ContentTypes.php(81): JsonToFormData-&gt;call()
#9 C:\xampp\htdocs\fa\modules\api24\Slim\Middleware\PrettyExceptions.php(67): Slim\Middleware\ContentTypes-&gt;call()
#10 C:\xampp\htdocs\fa\modules\api24\Slim\Slim.php(1300): Slim\Middleware\PrettyExceptions-&gt;call()
#11 C:\xampp\htdocs\fa\modules\api24\index.php(447): Slim\Slim-&gt;run()
#12 {main}</code></pre></div><p>Do you have any idea what went wrong?</p>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2018-04-23T14:17:11Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31490#p31490</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31459#p31459" />
			<content type="html"><![CDATA[<p>The <strong>$info</strong> variable is populated when the <strong>api24/src/Inventory.php</strong> file got included (see line 65) and the <strong>class Inventory</strong> was instantiated in <strong>api24/index.php</strong> in line 73. The latter file calls the function <strong>stock_adjustment_add()</strong> without any arguments in line 129 where the <strong>$info</strong> gets populated from $_POST of the Ajax Request. In all of these cases, we see that the <em>$info[&#039;type&#039;]</em> and <em>$info[&#039;increase&#039;]</em> do not appear in any validation and hence the validations in the <strong>api24/inventory.inc</strong> file for these elements can be removed as well.</p><p><a href="https://github.com/apmuthu/FA24extensions/commit/bcc61a03411e44e4a826a8881261a33441e4b6c2">Committed</a>.</p><p>Does this satisfy your stock transfer?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-04-19T17:02:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31459#p31459</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31456#p31456" />
			<content type="html"><![CDATA[<p>Also:</p><p>add_stock_transfer method is not implemented yet in the API.</p><p>Is is possible if I just duplicate and modify the inventory.inc file for it to accept another argument (location to be transferred to) so it can handle inventory transfers ?</p>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2018-04-19T04:54:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31456#p31456</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31455#p31455" />
			<content type="html"><![CDATA[<p>Does the field validation also needs to be removed?<br />Line 37-39 and 49-51<br /></p><div class="codebox"><pre><code>    if (! isset($info[&#039;type&#039;])) {
        api_error(412, &#039;Movement Type is required&#039;);
    }</code></pre></div><div class="codebox"><pre><code>    if (! isset($info[&#039;increase&#039;])) {
        api_error(412, &#039;Increase is required. (1 = true, 0 = false)&#039;);
    }</code></pre></div><p>I don&#039;t quite understand how the api $req and $info parses the arguments.</p>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2018-04-19T04:52:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31455#p31455</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31454#p31454" />
			<content type="html"><![CDATA[<p>You are right. We need to remove the type and increase parameters. It is documented at the end of <a href="https://github.com/FrontAccountingERP/FA/blob/master/doc/api_changes.txt">api_changes.txt</a>.</p><p><a href="https://github.com/apmuthu/FA24extensions/commit/6849f02af4ff59ba4e2c3244974b707abad2c471">Committed</a>.</p><p>Verify if any more endpoints are needed to satisfy: ST_LOCTRANSFER / ST_INVADJUST / ST_LOCTRANSFER</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-04-19T03:47:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31454#p31454</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31453#p31453" />
			<content type="html"><![CDATA[<p>I did access the link you provided for, apmuthu. It seems that the inventory.inc hasnt updated yet for 2.4 usage.</p><p>Take a look here: https://github.com/apmuthu/FA24extensions/blob/master/Extensions/api24/inventory.inc</p><p>Line 88:<br /></p><div class="codebox"><pre><code>    $trans_no = add_stock_adjustment($_SESSION[&#039;adj_items&#039;]-&gt;line_items, $info[&#039;location&#039;], $info[&#039;date&#039;], $info[&#039;type&#039;], $info[&#039;increase&#039;], $info[&#039;reference&#039;], $info[&#039;memo&#039;]);</code></pre></div><p>It is still using add_stock_adjustment method for 2.3</p><p>The attachment you provided is also the same.</p>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2018-04-19T03:34:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31453#p31453</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: refs table]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31452#p31452" />
			<content type="html"><![CDATA[<p>The API extension for FA 2.3.x is <a href="https://github.com/apmuthu/frontaccounting/tree/master/extensions/Extensions/api">here</a>.</p><p><s>The API24 version is attached herewith.</s> Looks like you are using the one from the official / source repos that may not be updated.</p><p>The functions you alluded to have since been updated in the FA24extensions repo <s>and attached here</s>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-04-18T16:19:18Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31452#p31452</id>
		</entry>
</feed>
