<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — email sale order to customer from inquiry page]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=4151</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4151&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in email sale order to customer from inquiry page.]]></description>
		<lastBuildDate>Tue, 11 Jun 2013 01:53:54 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[email sale order to customer from inquiry page]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=16827#p16827</link>
			<description><![CDATA[<p>if you want to be able to send and resend emails to your customers from your inquiry page here&#039;s my hack for this:</p><p>in sales/inquiry/sales_orders_view.php page add this line under -&nbsp; function prt_link($row) - around line 122</p><div class="codebox"><pre><code>function send_email($row)
{
    global $trans_type;
    return print_email_link($row[&#039;order_no&#039;], _(&quot;Email&quot;), true, $trans_type, ICON_DOC);
}</code></pre></div><p> in same file line 318 (this will put the link on your page) right under: _(&quot;Tmpl&quot;) =&gt; array(&#039;insert&#039;=&gt;true, &#039;fun&#039;=&gt;&#039;tmpl_checkbox&#039;)</p><div class="codebox"><pre><code>array(&#039;insert&#039;=&gt;true, &#039;fun&#039;=&gt;&#039;send_email&#039;),</code></pre></div><br /><p>in file - reporting/includedes/reporting.inc - just add this entire block an the bottom of the page. ( just before ?&gt;&nbsp; php end)</p><div class="codebox"><pre><code>//email link from sale order page - added by Cristi
    
function print_email_link($doc_no, $link_text, $link=true, $type_no, 
$icon=false, $class=&#039;printlink&#039;, $id=&#039;&#039;, $email=1, $extra=0)
{
    global $path_to_root, $def_print_orientation;
    include_once($path_to_root . &quot;/includes/types.inc&quot;);

    $url = $path_to_root.&#039;/reporting/prn_redirect.php?&#039;;
    $def_orientation = (isset($def_print_orientation) &amp;&amp; $def_print_orientation == 1 ? 1 : 0);

    switch ($type_no)
    {
        case ST_SALESQUOTE :
            $rep = 111;
            // from, to, currency, email, comments, orientation
            $ar = array(
                &#039;PARAM_0&#039; =&gt; $doc_no, 
                &#039;PARAM_1&#039; =&gt; $doc_no, 
                &#039;PARAM_2&#039; =&gt; &#039;&#039;, 
                &#039;PARAM_3&#039; =&gt; $email, 
                &#039;PARAM_4&#039; =&gt; &#039;&#039;,
                &#039;PARAM_5&#039; =&gt; $def_orientation);
            break;
        case ST_SALESORDER :
            $rep = 109;
            // from, to, currency, email, quote, comments, orientation
            $ar = array(
                &#039;PARAM_0&#039; =&gt; $doc_no, 
                &#039;PARAM_1&#039; =&gt; $doc_no, 
                &#039;PARAM_2&#039; =&gt; &#039;&#039;, 
                &#039;PARAM_3&#039; =&gt; $email, 
                &#039;PARAM_4&#039; =&gt; 0, 
                &#039;PARAM_5&#039; =&gt; &#039;&#039;,
                &#039;PARAM_6&#039; =&gt; $def_orientation);
            break;
        case ST_CUSTDELIVERY :
            $rep = 110;
            // from, to, email, packing slip, comments, orientation
            $ar = array(
                &#039;PARAM_0&#039; =&gt; $doc_no, 
                &#039;PARAM_1&#039; =&gt; $doc_no, 
                &#039;PARAM_2&#039; =&gt; $email,
                &#039;PARAM_3&#039; =&gt; $extra,
                &#039;PARAM_4&#039; =&gt; &#039;&#039;,
                &#039;PARAM_5&#039; =&gt; $def_orientation);
            break;
        case ST_SALESINVOICE : // Sales Invoice
        case ST_CUSTCREDIT : // Customer Credit Note
            $rep = $type_no==ST_CUSTCREDIT ? 113 : 107;
            // from, to, currency, email, paylink, comments, orientation
            $ar = array(
                &#039;PARAM_0&#039; =&gt; $doc_no, 
                &#039;PARAM_1&#039; =&gt; $doc_no, 
                &#039;PARAM_2&#039; =&gt; &#039;&#039;, 
                &#039;PARAM_3&#039; =&gt; $email, 
                &#039;PARAM_4&#039; =&gt; &#039;&#039;,
                &#039;PARAM_5&#039; =&gt; &#039;&#039;, 
                &#039;PARAM_6&#039; =&gt; $def_orientation);
            break;
        case ST_PURCHORDER :
            $rep = 209;
            // from, to, currency, email, comments, orientation
            $ar = array(
                &#039;PARAM_0&#039; =&gt; $doc_no, 
                &#039;PARAM_1&#039; =&gt; $doc_no, 
                &#039;PARAM_2&#039; =&gt; &#039;&#039;, 
                &#039;PARAM_3&#039; =&gt; $email, 
                &#039;PARAM_4&#039; =&gt; &#039;&#039;,
                &#039;PARAM_5&#039; =&gt; $def_orientation);
            break;
        case ST_CUSTPAYMENT :
            $rep = 112;
            // from, to, currency, comments, orientation
            $ar = array(
                &#039;PARAM_0&#039; =&gt; $doc_no, 
                &#039;PARAM_1&#039; =&gt; $doc_no, 
                &#039;PARAM_2&#039; =&gt; &#039;&#039;, 
                &#039;PARAM_3&#039; =&gt; &#039;&#039;,
                &#039;PARAM_4&#039; =&gt; $def_orientation);
            break;
        case ST_SUPPAYMENT :
            $rep = 210;
            // from, to, currency, email, comments, orientation
            $ar = array(
                &#039;PARAM_0&#039; =&gt; $doc_no, 
                &#039;PARAM_1&#039; =&gt; $doc_no, 
                &#039;PARAM_2&#039; =&gt; &#039;&#039;, 
                &#039;PARAM_3&#039; =&gt; $email, 
                &#039;PARAM_4&#039; =&gt; &#039;&#039;,
                &#039;PARAM_5&#039; =&gt; $def_orientation);
            break;
        case ST_WORKORDER :
            $rep = 409;
            // from, to, email, comments orientation
            $ar = array(
                &#039;PARAM_0&#039; =&gt; $doc_no, 
                &#039;PARAM_1&#039; =&gt; $doc_no, 
                &#039;PARAM_2&#039; =&gt; $email, 
                &#039;PARAM_3&#039; =&gt; &#039;&#039;, 
                &#039;PARAM_4&#039; =&gt; $def_orientation);
            break;
//        default: $ar = array();
    }
    
    return print_link($link_text, $rep, $ar, &quot;&quot;, $icon, $class, $id);
}</code></pre></div><br /><p>if you want to be able to send emails from other pages like customer_inquiry.php, or delivery page, all you have to do it&#039;s add the first part of the script from above in that page...</p>]]></description>
			<author><![CDATA[null@example.com (cristiart)]]></author>
			<pubDate>Tue, 11 Jun 2013 01:53:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=16827#p16827</guid>
		</item>
	</channel>
</rss>
