<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — After creating Sales Order - sending email: PDF without a name?]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=8996</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8996&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in After creating Sales Order - sending email: PDF without a name?.]]></description>
		<lastBuildDate>Tue, 29 Sep 2020 22:38:46 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: After creating Sales Order - sending email: PDF without a name?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=38426#p38426</link>
			<description><![CDATA[<p>Thanks Joe!<br />Updated and works fine.</p>]]></description>
			<author><![CDATA[null@example.com (incocare)]]></author>
			<pubDate>Tue, 29 Sep 2020 22:38:46 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=38426#p38426</guid>
		</item>
		<item>
			<title><![CDATA[Re: After creating Sales Order - sending email: PDF without a name?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=38415#p38415</link>
			<description><![CDATA[<p>This fix has now been committed to stable repo.</p><p>The fixed file can be downloaded <a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/reporting/rep109.php">here</a>.</p><p>/joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Tue, 29 Sep 2020 14:34:27 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=38415#p38415</guid>
		</item>
		<item>
			<title><![CDATA[Re: After creating Sales Order - sending email: PDF without a name?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=38414#p38414</link>
			<description><![CDATA[<div class="codebox"><pre><code>git apply &lt;diff file&gt;</code></pre></div><p>or edit the source file manually.</p>]]></description>
			<author><![CDATA[null@example.com (Braath Waate)]]></author>
			<pubDate>Tue, 29 Sep 2020 12:03:00 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=38414#p38414</guid>
		</item>
		<item>
			<title><![CDATA[Re: After creating Sales Order - sending email: PDF without a name?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=38412#p38412</link>
			<description><![CDATA[<p>@Braath Waate: sorry for my late reaction and thanks for posting this.<br />Please excuse my ignorance - I&#039;m not very experienced with git - with what do I parse this script to change the source file?</p><p>/cheers Andreas</p>]]></description>
			<author><![CDATA[null@example.com (incocare)]]></author>
			<pubDate>Tue, 29 Sep 2020 03:48:31 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=38412#p38412</guid>
		</item>
		<item>
			<title><![CDATA[Re: After creating Sales Order - sending email: PDF without a name?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=38345#p38345</link>
			<description><![CDATA[<p>I don&#039;t know. Probably. I will have a look tomorrow.</p><p>/joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Tue, 15 Sep 2020 23:34:16 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=38345#p38345</guid>
		</item>
		<item>
			<title><![CDATA[Re: After creating Sales Order - sending email: PDF without a name?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=38344#p38344</link>
			<description><![CDATA[<p>@joe: can it be safely used in the core?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 14 Sep 2020 16:15:32 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=38344#p38344</guid>
		</item>
		<item>
			<title><![CDATA[Re: After creating Sales Order - sending email: PDF without a name?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=38334#p38334</link>
			<description><![CDATA[<p>The report that prints sales orders (not invoices) could be simplified.&nbsp; Try this:</p><div class="codebox"><pre><code>diff --git a/core/reporting/rep109.php b/core/reporting/rep109.php
index ba6c86c..434deb8 100644
--- a/core/reporting/rep109.php
+++ b/core/reporting/rep109.php
@@ -57,14 +57,6 @@ function print_sales_orders()
 
     $cur = get_company_Pref(&#039;curr_default&#039;);
 
-    if ($email == 0)
-    {
-
-        if ($print_as_quote == 0)
-            $rep = new FrontReport(_(&quot;SALES ORDER&quot;), &quot;SalesOrderBulk&quot;, user_pagesize(), 9, $orientation);
-        else
-            $rep = new FrontReport(_(&quot;QUOTE&quot;), &quot;QuoteBulk&quot;, user_pagesize(), 9, $orientation);
-    }
     if ($orientation == &#039;L&#039;)
         recalculate_cols($cols);
 
@@ -77,34 +69,26 @@ function print_sales_orders()
         $baccount = get_default_bank_account($myrow[&#039;curr_code&#039;]);
         $params[&#039;bankaccount&#039;] = $baccount[&#039;id&#039;];
         $branch = get_branch($myrow[&quot;branch_code&quot;]);
-        if ($email == 1)
-            $rep = new FrontReport(&quot;&quot;, &quot;&quot;, user_pagesize(), 9, $orientation);
+
+        if ($i == $from || $email == 1)
+            $rep = new FrontReport(&quot;&quot;, &quot;&quot;, user_pagesize(), 9, $orientation);
+        if ($print_as_quote == 1)
+        {
+            $rep-&gt;title = _(&#039;QUOTE&#039;);
+            $rep-&gt;filename = &quot;Quote&quot; . $i . &quot;.pdf&quot;;
+        }
+        else
+        {
+            $rep-&gt;title = _(&quot;SALES ORDER&quot;);
+            $rep-&gt;filename = &quot;SalesOrder&quot; . $i . &quot;.pdf&quot;;
+        }
         $rep-&gt;SetHeaderType(&#039;Header2&#039;);
         $rep-&gt;currency = $cur;
         $rep-&gt;Font();
-        if ($print_as_quote == 1)
-        {
-            $rep = new FrontReport(&quot;&quot;, &quot;&quot;, user_pagesize(), 9, $orientation);
-            if ($print_as_quote == 1)
-            {
-                $rep-&gt;title = _(&#039;QUOTE&#039;);
-                $rep-&gt;filename = &quot;Quote&quot; . $i . &quot;.pdf&quot;;
-            }
-            else
-            {
-                $rep-&gt;title = _(&quot;SALES ORDER&quot;);
-                $rep-&gt;filename = &quot;SalesOrder&quot; . $i . &quot;.pdf&quot;;
-            }
-        }
-        else
-            $rep-&gt;title = ($print_as_quote==1 ? _(&quot;QUOTE&quot;) : _(&quot;SALES ORDER&quot;));
-        $rep-&gt;currency = $cur;
-        $rep-&gt;Font();
         $rep-&gt;Info($params, $cols, null, $aligns);
 
         $contacts = get_branch_contacts($branch[&#039;branch_code&#039;], &#039;order&#039;, $branch[&#039;debtor_no&#039;], true);
         $rep-&gt;SetCommonData($myrow, $branch, $myrow, $baccount, ST_SALESORDER, $contacts);
-        $rep-&gt;SetHeaderType(&#039;Header2&#039;);
         $rep-&gt;NewPage();
 
         $result = get_sales_order_details($i, ST_SALESORDER);
@@ -218,12 +202,8 @@ function print_sales_orders()
             $rep-&gt;TextCol(1, 7, $myrow[&#039;curr_code&#039;] . &quot;: &quot; . $words, - 2);
         }    
         $rep-&gt;Font();
-        if ($email == 1)
-        {
-            $rep-&gt;End($email);
-        }
+        if ($i == $to || $email == 1)
+            $rep-&gt;End($email);
     }
-    if ($email == 0)
-        $rep-&gt;End();
 }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Braath Waate)]]></author>
			<pubDate>Sat, 12 Sep 2020 01:02:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=38334#p38334</guid>
		</item>
		<item>
			<title><![CDATA[After creating Sales Order - sending email: PDF without a name?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=38331#p38331</link>
			<description><![CDATA[<p>Using 2.4.8 and also tried in 2.4.6:<br />1. create new sales order<br />2. Click on &quot;Email this order&quot;<br />3. Email will be correctly send with PDF attachment</p><p>But the name of the attachment is just &quot;.pdf&quot; - many clients can&#039;t open the file.<br />I remember that it was in the past a proper name... what am I missing?</p><p>When emailing quotes or invoices the PDF files have their random IDs...</p>]]></description>
			<author><![CDATA[null@example.com (incocare)]]></author>
			<pubDate>Thu, 10 Sep 2020 23:12:46 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=38331#p38331</guid>
		</item>
	</channel>
</rss>
