<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Recurrent Sales Orders]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=10501&amp;type=atom" />
	<updated>2024-06-10T13:00:32Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=10501</id>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43150#p43150" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[jeskremer]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=47694</uri>
			</author>
			<updated>2024-06-10T13:00:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43150#p43150</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43147#p43147" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[trafficpest]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42061</uri>
			</author>
			<updated>2024-06-03T16:33:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43147#p43147</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43143#p43143" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[jeskremer]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=47694</uri>
			</author>
			<updated>2024-05-31T12:46:31Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43143#p43143</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43141#p43141" />
			<content type="html"><![CDATA[<p>Thank you!</p>]]></content>
			<author>
				<name><![CDATA[jeskremer]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=47694</uri>
			</author>
			<updated>2024-05-29T03:05:46Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43141#p43141</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43140#p43140" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[trafficpest]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42061</uri>
			</author>
			<updated>2024-05-28T22:28:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43140#p43140</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43126#p43126" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[jeskremer]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=47694</uri>
			</author>
			<updated>2024-05-24T02:26:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43126#p43126</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43124#p43124" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[trafficpest]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42061</uri>
			</author>
			<updated>2024-05-23T16:30:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43124#p43124</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43122#p43122" />
			<content type="html"><![CDATA[<p>I also noticed that it does not create an actual reference number.&nbsp; It just calls it &quot;auto&quot;.</p>]]></content>
			<author>
				<name><![CDATA[jeskremer]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=47694</uri>
			</author>
			<updated>2024-05-22T22:09:04Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43122#p43122</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43106#p43106" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[trafficpest]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42061</uri>
			</author>
			<updated>2024-05-15T17:19:05Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43106#p43106</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43085#p43085" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[jeskremer]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=47694</uri>
			</author>
			<updated>2024-05-08T13:05:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43085#p43085</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43072#p43072" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[trafficpest]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42061</uri>
			</author>
			<updated>2024-04-29T17:35:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43072#p43072</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43068#p43068" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[jeskremer]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=47694</uri>
			</author>
			<updated>2024-04-27T21:13:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43068#p43068</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43063#p43063" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2024-04-26T12:28:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43063#p43063</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43062#p43062" />
			<content type="html"><![CDATA[<p>Will do.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2024-04-26T08:21:04Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43062#p43062</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Recurrent Sales Orders]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43061#p43061" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2024-04-26T05:47:02Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43061#p43061</id>
		</entry>
</feed>
