<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Recurrent Sales Orders]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=10501</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=10501&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Recurrent Sales Orders.]]></description>
		<lastBuildDate>Mon, 10 Jun 2024 13:00:32 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43150#p43150</link>
			<description><![CDATA[<p>Interesting.&nbsp; I haven&#039;t received the date error message lately, but now I don&#039;t get it copying at all, but rather, showing a page with no data and a &quot;Back&quot; link.</p><p>I did try your suggestion of changing the Ref number.&nbsp; That didn&#039;t seem to help.&nbsp; I still get the &quot;Back&quot; link with no new sales order when I click the &quot;Copy&quot; button.</p>]]></description>
			<author><![CDATA[null@example.com (jeskremer)]]></author>
			<pubDate>Mon, 10 Jun 2024 13:00:32 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43150#p43150</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43147#p43147</link>
			<description><![CDATA[<p>Maybe it doesn&#039;t support date in the transaction reference?<br />I already had my ref setup without a date. So I didn&#039;t get that, I only use numbers.<br />If you want to do that go here in the app.<br />Setup-&gt;Transaction References</p><p>then change sales order to &#039;{00001}&#039; </p><p>I would like to look into the date thing but don&#039;t have the time right now</p>]]></description>
			<author><![CDATA[null@example.com (trafficpest)]]></author>
			<pubDate>Mon, 03 Jun 2024 16:33:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43147#p43147</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43143#p43143</link>
			<description><![CDATA[<p>I did get all of this code inputted, however, when I copy a Sales Order, I get the following yellow caution bar at the top:</p><p>Missing refline context data: &#039;date&#039;</p><p>In the Reference Number box, I also get this: YYYY-0001</p>]]></description>
			<author><![CDATA[null@example.com (jeskremer)]]></author>
			<pubDate>Fri, 31 May 2024 12:46:31 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43143#p43143</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43141#p43141</link>
			<description><![CDATA[<p>Thank you!</p>]]></description>
			<author><![CDATA[null@example.com (jeskremer)]]></author>
			<pubDate>Wed, 29 May 2024 03:05:46 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43141#p43141</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43140#p43140</link>
			<description><![CDATA[<p>sorry to take so long on this just saw this</p><p>this one is a little more involved so do this.<br />if you need I can make a branch of the repo to see the changes, so let me know.</p><p>in &#039;sales/inquiry/sales_orders_view.php&#039; do much like you did before. create a copy function and paste it near the edit function about line 115 in the page<br /></p><div class="codebox"><pre><code>function copy_link($row) 
{
    global $page_nested;

  return pager_link(_(&quot;Copy Order&quot;) ,
      &quot;/sales/sales_order_entry.php?CopyOrder=&quot;. $row[&#039;order_no&#039;], ICON_DOC); 
}</code></pre></div><p>then in that same file call it in the salesorder if statement around line 330 at the end of the file. (you could add it to other vues on the page if desired. the changed elseif should look like this. NOTE: it has the closing bracket from the last elseif above.<br /></p><div class="codebox"><pre><code>} elseif ($trans_type == ST_SALESORDER) {
     array_append($cols,array(
            _(&quot;Tmpl&quot;) =&gt; array(&#039;insert&#039;=&gt;true, &#039;fun&#039;=&gt;&#039;tmpl_checkbox&#039;),
                    array(&#039;insert&#039;=&gt;true, &#039;fun&#039;=&gt;&#039;edit_link&#039;),
                    array(&#039;insert&#039;=&gt;true, &#039;fun&#039;=&gt;&#039;copy_link&#039;),
                    array(&#039;insert&#039;=&gt;true, &#039;fun&#039;=&gt;&#039;dispatch_link&#039;),
                    array(&#039;insert&#039;=&gt;true, &#039;fun&#039;=&gt;&#039;prt_link&#039;)));
};</code></pre></div><p>Now the problem is the cart doesn&#039;t support copying orders like it did on deliveries/invoices. so we will add it.<br />in file &#039;sales/sales_order_entry.php&#039; in the top array about line 36 add a CopyOrder type. the finished array should look like this.<br /></p><div class="codebox"><pre><code>    array(    &#039;NewOrder&#039; =&gt; &#039;SA_SALESORDER&#039;,
            &#039;CopyOrder&#039; =&gt; &#039;SA_SALESORDER&#039;,
            &#039;ModifyOrderNumber&#039; =&gt; &#039;SA_SALESORDER&#039;,
            &#039;AddedID&#039; =&gt; &#039;SA_SALESORDER&#039;,
            &#039;UpdatedID&#039; =&gt; &#039;SA_SALESORDER&#039;,
            &#039;NewQuotation&#039; =&gt; &#039;SA_SALESQUOTE&#039;,
            &#039;ModifyQuotationNumber&#039; =&gt; &#039;SA_SALESQUOTE&#039;,
            &#039;NewQuoteToSalesOrder&#039; =&gt; &#039;SA_SALESQUOTE&#039;,
            &#039;AddedQU&#039; =&gt; &#039;SA_SALESQUOTE&#039;,
            &#039;UpdatedQU&#039; =&gt; &#039;SA_SALESQUOTE&#039;,
            &#039;NewDelivery&#039; =&gt; &#039;SA_SALESDELIVERY&#039;,
            &#039;AddedDN&#039; =&gt; &#039;SA_SALESDELIVERY&#039;, 
            &#039;NewInvoice&#039; =&gt; &#039;SA_SALESINVOICE&#039;,
            &#039;AddedDI&#039; =&gt; &#039;SA_SALESINVOICE&#039;
            )</code></pre></div><p>in the same file the function create_cart() needs to be modified to allow this new &#039;CopyOrder&#039; type to pass as a template. change the function to look like this<br /></p><div class="codebox"><pre><code>function create_cart($type, $trans_no)
{ 
    global $Refs, $SysPrefs;

    if (!$SysPrefs-&gt;db_ok) // create_cart is called before page() where the check is done
        return;

    processing_start();

    if (isset($_GET[&#039;NewQuoteToSalesOrder&#039;]))
    {
        $trans_no = $_GET[&#039;NewQuoteToSalesOrder&#039;];
        $doc = new Cart(ST_SALESQUOTE, $trans_no, true);
        $doc-&gt;Comments = _(&quot;Sales Quotation&quot;) . &quot; # &quot; . $trans_no;
        $_SESSION[&#039;Items&#039;] = $doc;
    }    
  elseif(($type != ST_SALESORDER || isset($_GET[&#039;CopyOrder&#039;])) &amp;&amp; $type != ST_SALESQUOTE &amp;&amp; $trans_no != 0) { // this is template

        $doc = new Cart(ST_SALESORDER, array($trans_no));
        $doc-&gt;trans_type = $type;
        $doc-&gt;trans_no = 0;
        $doc-&gt;document_date = new_doc_date();
        if ($type == ST_SALESINVOICE) {
            $doc-&gt;due_date = get_invoice_duedate($doc-&gt;payment, $doc-&gt;document_date);
            $doc-&gt;pos = get_sales_point(user_pos());
        } else
            $doc-&gt;due_date = $doc-&gt;document_date;
        $doc-&gt;reference = $Refs-&gt;get_next($doc-&gt;trans_type, null, array(&#039;date&#039; =&gt; Today()));
        //$doc-&gt;Comments=&#039;&#039;;
        foreach($doc-&gt;line_items as $line_no =&gt; $line) {
            $doc-&gt;line_items[$line_no]-&gt;qty_done = 0;
        }
        $_SESSION[&#039;Items&#039;] = $doc;
    } else
        $_SESSION[&#039;Items&#039;] = new Cart($type, array($trans_no));
    copy_from_cart();
}</code></pre></div><p>@apmuthu and @joe <br />here is an idea though I dont think it should be in core. People can already template an order and copy invoices and deliveries. if you copy or direct deliver you will get a delivery ref number and that could be used for an api unique ID. Or if you have to use an order could you not use the order# already?</p>]]></description>
			<author><![CDATA[null@example.com (trafficpest)]]></author>
			<pubDate>Tue, 28 May 2024 22:28:22 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43140#p43140</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43126#p43126</link>
			<description><![CDATA[<p>I was doing some looking at the code tonight and can&#039;t quite figure it out.&nbsp; Obviously with this code posted previously by @trafficpest, we&#039;re copying an order from the &quot;Customer Transactions&quot; tab.</p><p>This is working great, however, we have one little hiccup.&nbsp; I was trying to see if I could do the following from the Sales Order Inquiry screen or Customers tab:</p><p>Copy a Sales Order so that it gets an actual unique reference number instead of auto.</p><p>What you are doing now works great, except that, we are really close to getting a software called ShipSync to connect to ShipStation and post tracking back to Front Accounting.&nbsp; The problem?&nbsp; It does need a unique reference number or it won&#039;t work.</p><p>It is working great on unique and new orders, but if we start copying orders and only getting auto, it won&#039;t work.</p><p>We have dumped Quick Books for your software and are really excited to get this fully implemented in our business.&nbsp; I think there is a HUGE market for Open Source programs like this.&nbsp; I&#039;d even be willing to pay someone a few bucks to help fine tune the end product for us.</p>]]></description>
			<author><![CDATA[null@example.com (jeskremer)]]></author>
			<pubDate>Fri, 24 May 2024 02:26:22 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43126#p43126</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43124#p43124</link>
			<description><![CDATA[<p>That should only be on direct invoice the direct delivery gets an auto for ref but the invoice gets the next number. <br />That is normal behavior when you skip the delivery step. if you copy the delivery it will get a ref number than invoice against that invoice.</p>]]></description>
			<author><![CDATA[null@example.com (trafficpest)]]></author>
			<pubDate>Thu, 23 May 2024 16:30:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43124#p43124</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43122#p43122</link>
			<description><![CDATA[<p>I also noticed that it does not create an actual reference number.&nbsp; It just calls it &quot;auto&quot;.</p>]]></description>
			<author><![CDATA[null@example.com (jeskremer)]]></author>
			<pubDate>Wed, 22 May 2024 22:09:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43122#p43122</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43106#p43106</link>
			<description><![CDATA[<p>CAUTION<br />I just want to give a heads up for people using this.</p><p>If you have a client that you have updated the mailing address and you use this copy invoice or delivery. IT WILL NOT HAVE THE NEW ADDRESS. It will copy the mailing address from the prior order so, take caution.</p><p>While the order is open you can press F3 to open the branch &amp; verify the current mailing address on file to be safe</p><p>Otherwise I have been using daily with no other notes.</p>]]></description>
			<author><![CDATA[null@example.com (trafficpest)]]></author>
			<pubDate>Wed, 15 May 2024 17:19:05 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43106#p43106</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43085#p43085</link>
			<description><![CDATA[<p>Yes, that is correct.&nbsp; We get an order, schedule delivery, and then invoice.&nbsp; Thus, the need to replicate the Sales Order end of things first.</p><p>I have been using this for a little bit now, but still can&#039;t find a duplicate button for Sales Orders when I query them.&nbsp; There is one when searching customer transactions for the Sales Invoice and Delivery Note, but nothing next to Sales Order.</p>]]></description>
			<author><![CDATA[null@example.com (jeskremer)]]></author>
			<pubDate>Wed, 08 May 2024 13:05:10 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43085#p43085</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43072#p43072</link>
			<description><![CDATA[<p>It will auto create a new sales order for you.<br />It works on delivery or invoice both will make an new order for you.<br />Im guessing you get a order and schedule a delivery?</p>]]></description>
			<author><![CDATA[null@example.com (trafficpest)]]></author>
			<pubDate>Mon, 29 Apr 2024 17:35:33 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43072#p43072</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43068#p43068</link>
			<description><![CDATA[<p>I did try this and it works great for Direct Invoice.&nbsp; What would you recommend adjusting to replicate a Sales Order?</p>]]></description>
			<author><![CDATA[null@example.com (jeskremer)]]></author>
			<pubDate>Sat, 27 Apr 2024 21:13:33 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43068#p43068</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43063#p43063</link>
			<description><![CDATA[<p>This has been implemented as a new feature. Pushed to stable repo. Not needed to be an extra flag in company setup. It will be official from minor 2.4.19.</p><p>You can download the files <a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/sales/inquiry/customer_inquiry.php">/sales/inquiry/customer_inquiry.php</a> and <a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/lang/new_language_template/LC_MESSAGES/empty.po">/lang/new_language_template/empty.po</a> and replace on your server and it will work immediately.</p><p>Thanks @trafficpest for proposing this. Very good!</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Fri, 26 Apr 2024 12:28:00 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43063#p43063</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43062#p43062</link>
			<description><![CDATA[<p>Will do.</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Fri, 26 Apr 2024 08:21:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43062#p43062</guid>
		</item>
		<item>
			<title><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43061#p43061</link>
			<description><![CDATA[<p>@joe: appears to be a useful feature. Care to place it in the core with an toggle flag in the per company options?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 26 Apr 2024 05:47:02 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43061#p43061</guid>
		</item>
	</channel>
</rss>
