<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — How to modify this function add_po]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=8030</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8030&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How to modify this function add_po.]]></description>
		<lastBuildDate>Fri, 16 Jul 2021 09:50:39 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to modify this function add_po]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39731#p39731</link>
			<description><![CDATA[<p>Hi,<br />Were you able to solve this, I too need requisition process before PO.</p>]]></description>
			<author><![CDATA[null@example.com (lawmaina78)]]></author>
			<pubDate>Fri, 16 Jul 2021 09:50:39 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39731#p39731</guid>
		</item>
		<item>
			<title><![CDATA[How to modify this function add_po]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=34389#p34389</link>
			<description><![CDATA[<p>created a new page called purchase request but my problems is i copied original file from purchase order now my problems is the purchase request insert its data into purch_order instead of my new database purch_request how do i make my new page purchase request go into databse purch_request? </p><div class="codebox"><pre><code> //-----&gt; this for my purch_request database how or where do i find the function name for add_po so i could change it?.
function add_po_request(&amp;$po_obj)
{
    global $Refs;

    begin_transaction();
    hook_db_prewrite($po_obj, ST_PURCHORDER);

     /*Insert to purchase order header record */
     $sql = &quot;INSERT INTO &quot;.TB_PREF.&quot;purch_request (supplier_id, request_name, Comments, ord_date, reference,
         requisition_no, into_stock_location, delivery_address, total, tax_included, prep_amount) VALUES (&quot;;
     $sql .= db_escape($po_obj-&gt;supplier_id) . &quot;,&quot; .
          db_escape($po_obj-&gt;request_name) . &quot;,&quot; .
         db_escape($po_obj-&gt;Comments) . &quot;,&#039;&quot; .
         date2sql($po_obj-&gt;orig_order_date) . &quot;&#039;, &quot; .
         db_escape($po_obj-&gt;reference) . &quot;, &quot; .
         db_escape($po_obj-&gt;supp_ref) . &quot;, &quot; .
         db_escape($po_obj-&gt;Location) . &quot;, &quot; .
         db_escape($po_obj-&gt;delivery_address) . &quot;, &quot; .
         db_escape($po_obj-&gt;get_trans_total()). &quot;, &quot; .
         db_escape($po_obj-&gt;tax_included). &quot;, &quot; .
         db_escape($po_obj-&gt;prep_amount). &quot;)&quot;;

    db_query($sql, &quot;The purchase order header record could not be inserted&quot;);

     /*Get the auto increment value of the order number created from the sql above */
     $po_obj-&gt;order_no = db_insert_id();

     /*Insert the purchase order detail records */
     foreach ($po_obj-&gt;line_items as $line_no =&gt; $po_line)
     {
        $sql = &quot;INSERT INTO &quot;.TB_PREF.&quot;purch_order_request (order_no, item_code, description, delivery_date,    unit_price,    quantity_ordered) VALUES (&quot;;
        $sql .= $po_obj-&gt;order_no . &quot;, &quot; . db_escape($po_line-&gt;stock_id). &quot;,&quot; .
        db_escape($po_line-&gt;item_description). &quot;,&#039;&quot; .
        date2sql($po_line-&gt;req_del_date) . &quot;&#039;,&quot; .
        db_escape($po_line-&gt;price) . &quot;, &quot; .
        db_escape($po_line-&gt;quantity). &quot;)&quot;;
        db_query($sql, &quot;One of the purchase order detail records could not be inserted&quot;);
        $po_obj-&gt;line_items[$line_no]-&gt;po_detail_rec = db_insert_id();
     }

    $Refs-&gt;save(ST_PURCHORDER, $po_obj-&gt;order_no, $po_obj-&gt;reference);

    add_audit_trail(ST_PURCHORDER, $po_obj-&gt;order_no, $po_obj-&gt;orig_order_date);
    hook_db_postwrite($po_obj, ST_PURCHORDER);
    commit_transaction();

    return $po_obj-&gt;order_no;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ryanayao)]]></author>
			<pubDate>Sun, 03 Mar 2019 06:28:55 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=34389#p34389</guid>
		</item>
	</channel>
</rss>
