<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Total Weight on Packing Slip]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8692&amp;type=atom" />
	<updated>2021-07-15T18:19:14Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8692</id>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39720#p39720" />
			<content type="html"><![CDATA[<p>Items &amp; Number of Packages. For example “Pallet x 12”. Note that the packing list template in FA should allow you to add multiple products into 1 package.<br />It itemizes the amount and kind of merchandise contained in each individual package that is to be loaded aboard a truck, railcar, vessel or aircraft.</p><div class="quotebox"><cite>detkenn wrote:</cite><blockquote><p>Packing slip was already present in FA. <br />What was added here was the total weight and volume so YES you can print the Packing Slip.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[geesyscare]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42046</uri>
			</author>
			<updated>2021-07-15T18:19:14Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39720#p39720</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37517#p37517" />
			<content type="html"><![CDATA[<p>Packing slip was already present in FA. <br />What was added here was the total weight and volume so YES you can print the Packing Slip.</p>]]></content>
			<author>
				<name><![CDATA[detkenn]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45282</uri>
			</author>
			<updated>2020-05-14T17:10:47Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37517#p37517</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37513#p37513" />
			<content type="html"><![CDATA[<p>Can you please confirm the following information?<br />does this features contains Any pdf document likely to be generated as &quot;Packing Slip&quot;. <br />Is it possible to print the packing slip?</p>]]></content>
			<author>
				<name><![CDATA[geesyscare]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42046</uri>
			</author>
			<updated>2020-05-14T14:28:26Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37513#p37513</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37140#p37140" />
			<content type="html"><![CDATA[<p>This has been put on the wish list for 2.5 a while ago. We are waiting for a merge of 2.5.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2020-03-13T06:08:26Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37140#p37140</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37135#p37135" />
			<content type="html"><![CDATA[<p>@joe Any progress on this issue?</p>]]></content>
			<author>
				<name><![CDATA[detkenn]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45282</uri>
			</author>
			<updated>2020-03-12T14:23:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37135#p37135</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37110#p37110" />
			<content type="html"><![CDATA[<p>@joe&nbsp; , do the needful with core update</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2020-03-06T15:24:15Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37110#p37110</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37105#p37105" />
			<content type="html"><![CDATA[<p><strong>This Modification affects various sections. I have highlighted in red sections that have changed except for the report.</strong></p><p><strong>File: \inventory\manage\items.php</strong></p><div class="quotebox"><blockquote><p>...</p><p>function clear_data()<br />{<br />&nbsp; &nbsp; unset($_POST[&#039;long_description&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;description&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;category_id&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;tax_type_id&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;units&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;mb_flag&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;NewStockID&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;dimension_id&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;dimension2_id&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;no_sale&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;no_purchase&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;depreciation_method&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;depreciation_rate&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;depreciation_factor&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;depreciation_start&#039;]);<br />&nbsp; &nbsp; <span style="color: #FF0000">unset($_POST[&#039;weight&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;weight_uom&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;volume&#039;]);<br />&nbsp; &nbsp; unset($_POST[&#039;volume_uom&#039;]);</span><br />}</p><p>//------------------------------------------------------------------------------------</p><p>if (isset($_POST[&#039;addupdate&#039;])) <br />{</p><p>&nbsp; &nbsp; $input_error = 0;<br />&nbsp; &nbsp; if ($upload_file == &#039;No&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; $input_error = 1;<br />&nbsp; &nbsp; if (strlen($_POST[&#039;description&#039;]) == 0) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $input_error = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; display_error( _(&#039;The item name must be entered.&#039;));<br />&nbsp; &nbsp; &nbsp; &nbsp; set_focus(&#039;description&#039;);<br />&nbsp; &nbsp; } <br />&nbsp; &nbsp; elseif (strlen($_POST[&#039;NewStockID&#039;]) == 0) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $input_error = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; display_error( _(&#039;The item code cannot be empty&#039;));<br />&nbsp; &nbsp; &nbsp; &nbsp; set_focus(&#039;NewStockID&#039;);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; elseif (strstr($_POST[&#039;NewStockID&#039;], &quot; &quot;) || strstr($_POST[&#039;NewStockID&#039;],&quot;&#039;&quot;) || <br />&nbsp; &nbsp; &nbsp; &nbsp; strstr($_POST[&#039;NewStockID&#039;], &quot;+&quot;) || strstr($_POST[&#039;NewStockID&#039;], &quot;\&quot;&quot;) || <br />&nbsp; &nbsp; &nbsp; &nbsp; strstr($_POST[&#039;NewStockID&#039;], &quot;&amp;&quot;) || strstr($_POST[&#039;NewStockID&#039;], &quot;\t&quot;)) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $input_error = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; display_error( _(&#039;The item code cannot contain any of the following characters -&nbsp; &amp; + OR a space OR quotes&#039;));<br />&nbsp; &nbsp; &nbsp; &nbsp; set_focus(&#039;NewStockID&#039;);</p><p>&nbsp; &nbsp; }<br />&nbsp; &nbsp; elseif ($new_item &amp;&amp; db_num_rows(get_item_kit($_POST[&#039;NewStockID&#039;])))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $input_error = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display_error( _(&quot;This item code is already assigned to stock item or sale kit.&quot;));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_focus(&#039;NewStockID&#039;);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; if (get_post(&#039;fixed_asset&#039;)) {<br />&nbsp; &nbsp; if ($_POST[&#039;depreciation_rate&#039;] &gt; 100) {<br />&nbsp; &nbsp; &nbsp; $_POST[&#039;depreciation_rate&#039;] = 100;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; elseif ($_POST[&#039;depreciation_rate&#039;] &lt; 0) {<br />&nbsp; &nbsp; &nbsp; $_POST[&#039;depreciation_rate&#039;] = 0;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; $move_row = get_fixed_asset_move($_POST[&#039;NewStockID&#039;], ST_SUPPRECEIVE);<br />&nbsp; &nbsp; if (isset($_POST[&#039;depreciation_start&#039;]) &amp;&amp; strtotime($_POST[&#039;depreciation_start&#039;]) &lt; strtotime($move_row[&#039;tran_date&#039;])) {<br />&nbsp; &nbsp; &nbsp; display_warning(_(&#039;The depracation cannot start before the fixed asset purchase date&#039;));<br />&nbsp; &nbsp; }<br />&nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if ($input_error != 1)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (check_value(&#039;del_image&#039;))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $filename = company_path().&#039;/images/&#039;.item_img_name($_POST[&#039;NewStockID&#039;]).&quot;.jpg&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (file_exists($filename))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unlink($filename);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if (!$new_item) <br />&nbsp; &nbsp; &nbsp; &nbsp; { /*so its an existing one */<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF0000">update_item($_POST[&#039;NewStockID&#039;], $_POST[&#039;description&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;long_description&#039;], $_POST[&#039;category_id&#039;], <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;tax_type_id&#039;], get_post(&#039;units&#039;),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_post(&#039;fixed_asset&#039;) ? &#039;F&#039; : get_post(&#039;mb_flag&#039;), $_POST[&#039;sales_account&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;inventory_account&#039;], $_POST[&#039;cogs_account&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;adjustment_account&#039;], $_POST[&#039;wip_account&#039;], <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;dimension_id&#039;], $_POST[&#039;dimension2_id&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_value(&#039;no_sale&#039;), check_value(&#039;editable&#039;), check_value(&#039;no_purchase&#039;),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_post(&#039;depreciation_method&#039;), input_num(&#039;depreciation_rate&#039;), input_num(&#039;depreciation_factor&#039;), get_post(&#039;depreciation_start&#039;),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_post(&#039;fa_class_id&#039;),&nbsp; input_num(&quot;weight&quot;), get_post(&quot;weight_uom&quot;),&nbsp; input_num(&quot;volume&quot;), get_post(&quot;volume_uom&quot;));</span></p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; update_record_status($_POST[&#039;NewStockID&#039;], $_POST[&#039;inactive&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;stock_master&#039;, &#039;stock_id&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; update_record_status($_POST[&#039;NewStockID&#039;], $_POST[&#039;inactive&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;item_codes&#039;, &#039;item_code&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_focus(&#039;stock_id&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Ajax-&gt;activate(&#039;stock_id&#039;); // in case of status change<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display_notification(_(&quot;Item has been updated.&quot;));<br />&nbsp; &nbsp; &nbsp; &nbsp; } <br />&nbsp; &nbsp; &nbsp; &nbsp; else <br />&nbsp; &nbsp; &nbsp; &nbsp; { //it is a NEW part</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF0000">add_item($_POST[&#039;NewStockID&#039;], $_POST[&#039;description&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;long_description&#039;], $_POST[&#039;category_id&#039;], $_POST[&#039;tax_type_id&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;units&#039;], get_post(&#039;fixed_asset&#039;) ? &#039;F&#039; : get_post(&#039;mb_flag&#039;), $_POST[&#039;sales_account&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;inventory_account&#039;], $_POST[&#039;cogs_account&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;adjustment_account&#039;], $_POST[&#039;wip_account&#039;], <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;dimension_id&#039;], $_POST[&#039;dimension2_id&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_value(&#039;no_sale&#039;), check_value(&#039;editable&#039;), check_value(&#039;no_purchase&#039;),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_post(&#039;depreciation_method&#039;), input_num(&#039;depreciation_rate&#039;), input_num(&#039;depreciation_factor&#039;), get_post(&#039;depreciation_start&#039;),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_post(&#039;fa_class_id&#039;),&nbsp; input_num(&quot;weight&quot;), get_post(&quot;weight_uom&quot;),&nbsp; input_num(&quot;volume&quot;), get_post(&quot;volume_uom&quot;));</span></p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display_notification(_(&quot;A new item has been added.&quot;));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;stock_id&#039;] = $_POST[&#039;NewStockID&#039;] = <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;description&#039;] = $_POST[&#039;long_description&#039;] = &#039;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;no_sale&#039;] = $_POST[&#039;editable&#039;] = $_POST[&#039;no_purchase&#039;] =0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_focus(&#039;NewStockID&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; $Ajax-&gt;activate(&#039;_page_body&#039;);<br />&nbsp; &nbsp; }<br />}</p><p>if (get_post(&#039;clone&#039;)) {<br />&nbsp; &nbsp; unset($_POST[&#039;stock_id&#039;]);<br />&nbsp; &nbsp; $stock_id = &#039;&#039;;<br />&nbsp; &nbsp; unset($_POST[&#039;inactive&#039;]);<br />&nbsp; &nbsp; set_focus(&#039;NewStockID&#039;);<br />&nbsp; &nbsp; $Ajax-&gt;activate(&#039;_page_body&#039;);<br />}</p><p>//------------------------------------------------------------------------------------</p><p>function check_usage($stock_id, $dispmsg=true)<br />{<br />&nbsp; &nbsp; $msg = item_in_foreign_codes($stock_id);</p><p>&nbsp; &nbsp; if ($msg != &#039;&#039;)&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if($dispmsg) display_error($msg);<br />&nbsp; &nbsp; &nbsp; &nbsp; return false;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; return true;<br />}</p><p>//------------------------------------------------------------------------------------</p><p>if (isset($_POST[&#039;delete&#039;]) &amp;&amp; strlen($_POST[&#039;delete&#039;]) &gt; 1) <br />{</p><p>&nbsp; &nbsp; if (check_usage($_POST[&#039;NewStockID&#039;])) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $stock_id = $_POST[&#039;NewStockID&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; delete_item($stock_id);<br />&nbsp; &nbsp; &nbsp; &nbsp; $filename = company_path().&#039;/images/&#039;.item_img_name($stock_id).&quot;.jpg&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; if (file_exists($filename))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unlink($filename);<br />&nbsp; &nbsp; &nbsp; &nbsp; display_notification(_(&quot;Selected item has been deleted.&quot;));<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;stock_id&#039;] = &#039;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; clear_data();<br />&nbsp; &nbsp; &nbsp; &nbsp; set_focus(&#039;stock_id&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; $new_item = true;<br />&nbsp; &nbsp; &nbsp; &nbsp; $Ajax-&gt;activate(&#039;_page_body&#039;);<br />&nbsp; &nbsp; }<br />}</p><p>function item_settings(&amp;$stock_id, $new_item) <br />{<br />&nbsp; &nbsp; global $SysPrefs, $path_to_root, $page_nested, $depreciation_methods;</p><p>&nbsp; &nbsp; start_outer_table(TABLESTYLE2);</p><p>&nbsp; &nbsp; table_section(1);</p><p>&nbsp; &nbsp; table_section_title(_(&quot;General Settings&quot;));</p><p>&nbsp; &nbsp; //------------------------------------------------------------------------------------<br />&nbsp; &nbsp; if ($new_item) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $tmpCodeID=null;<br />&nbsp; &nbsp; &nbsp; &nbsp; $post_label = null;<br />&nbsp; &nbsp; &nbsp; &nbsp; if (!empty($SysPrefs-&gt;prefs[&#039;barcodes_on_stock&#039;]))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $post_label = &#039;&lt;button class=&quot;ajaxsubmit&quot; type=&quot;submit&quot; aspect=\&#039;default\&#039;&nbsp; name=&quot;generateBarcode&quot;&nbsp; id=&quot;generateBarcode&quot; value=&quot;Generate Barcode EAN8&quot;&gt; &#039;._(&quot;Generate EAN-8 Barcode&quot;).&#039; &lt;/button&gt;&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (isset($_POST[&#039;generateBarcode&#039;]))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tmpCodeID=generateBarcode();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;NewStockID&#039;] = $tmpCodeID;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; text_row(_(&quot;Item Code:&quot;), &#039;NewStockID&#039;, $tmpCodeID, 21, 20, null, &quot;&quot;, $post_label);<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;inactive&#039;] = 0;<br />&nbsp; &nbsp; } <br />&nbsp; &nbsp; else <br />&nbsp; &nbsp; { // Must be modifying an existing item<br />&nbsp; &nbsp; &nbsp; &nbsp; if (get_post(&#039;NewStockID&#039;) != get_post(&#039;stock_id&#039;) || get_post(&#039;addupdate&#039;)) { // first item display</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;NewStockID&#039;] = $_POST[&#039;stock_id&#039;];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $myrow = get_item($_POST[&#039;NewStockID&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;long_description&#039;] = $myrow[&quot;long_description&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;description&#039;] = $myrow[&quot;description&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;category_id&#039;]&nbsp; = $myrow[&quot;category_id&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;tax_type_id&#039;]&nbsp; = $myrow[&quot;tax_type_id&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;units&#039;]&nbsp; = $myrow[&quot;units&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;mb_flag&#039;]&nbsp; = $myrow[&quot;mb_flag&quot;];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;depreciation_method&#039;] = $myrow[&#039;depreciation_method&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;depreciation_rate&#039;] = number_format2($myrow[&#039;depreciation_rate&#039;], 1);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;depreciation_factor&#039;] = number_format2($myrow[&#039;depreciation_factor&#039;], 1);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;depreciation_start&#039;] = sql2date($myrow[&#039;depreciation_start&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;depreciation_date&#039;] = sql2date($myrow[&#039;depreciation_date&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;fa_class_id&#039;] = $myrow[&#039;fa_class_id&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;material_cost&#039;] = $myrow[&#039;material_cost&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;purchase_cost&#039;] = $myrow[&#039;purchase_cost&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;sales_account&#039;] =&nbsp; $myrow[&#039;sales_account&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;inventory_account&#039;] = $myrow[&#039;inventory_account&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;cogs_account&#039;] = $myrow[&#039;cogs_account&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;adjustment_account&#039;]&nbsp; &nbsp; = $myrow[&#039;adjustment_account&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;wip_account&#039;]&nbsp; &nbsp; = $myrow[&#039;wip_account&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;dimension_id&#039;]&nbsp; &nbsp; = $myrow[&#039;dimension_id&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;dimension2_id&#039;]&nbsp; &nbsp; = $myrow[&#039;dimension2_id&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;no_sale&#039;]&nbsp; &nbsp; = $myrow[&#039;no_sale&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;no_purchase&#039;]&nbsp; &nbsp; = $myrow[&#039;no_purchase&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;del_image&#039;] = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;inactive&#039;] = $myrow[&quot;inactive&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;editable&#039;] = $myrow[&quot;editable&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF0000">$_POST[&#039;weight&#039;] = $myrow[&quot;weight&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;weight_uom&#039;] = $myrow[&quot;weight_uom&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;volume&#039;] = $myrow[&quot;volume&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;volume_uom&#039;] = $myrow[&quot;volume_uom&quot;];</span><br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; label_row(_(&quot;Item Code:&quot;),$_POST[&#039;NewStockID&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; hidden(&#039;NewStockID&#039;, $_POST[&#039;NewStockID&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; set_focus(&#039;description&#039;);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; $fixed_asset = get_post(&#039;fixed_asset&#039;);</p><p>&nbsp; &nbsp; text_row(_(&quot;Name:&quot;), &#039;description&#039;, null, 52, 200);</p><p>&nbsp; &nbsp; textarea_row(_(&#039;Description:&#039;), &#039;long_description&#039;, null, 42, 3);</p><p>&nbsp; &nbsp; stock_categories_list_row(_(&quot;Category:&quot;), &#039;category_id&#039;, null, false, $new_item, $fixed_asset);</p><p>&nbsp; &nbsp; if ($new_item &amp;&amp; (list_updated(&#039;category_id&#039;) || !isset($_POST[&#039;units&#039;]))) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $category_record = get_item_category($_POST[&#039;category_id&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;tax_type_id&#039;] = $category_record[&quot;dflt_tax_type&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;units&#039;] = $category_record[&quot;dflt_units&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;mb_flag&#039;] = $category_record[&quot;dflt_mb_flag&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;inventory_account&#039;] = $category_record[&quot;dflt_inventory_act&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;cogs_account&#039;] = $category_record[&quot;dflt_cogs_act&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;sales_account&#039;] = $category_record[&quot;dflt_sales_act&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;adjustment_account&#039;] = $category_record[&quot;dflt_adjustment_act&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;wip_account&#039;] = $category_record[&quot;dflt_wip_act&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;dimension_id&#039;] = $category_record[&quot;dflt_dim1&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;dimension2_id&#039;] = $category_record[&quot;dflt_dim2&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;no_sale&#039;] = $category_record[&quot;dflt_no_sale&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;no_purchase&#039;] = $category_record[&quot;dflt_no_purchase&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $_POST[&#039;editable&#039;] = 0;</p><p>&nbsp; &nbsp; }<br />&nbsp; &nbsp; $fresh_item = !isset($_POST[&#039;NewStockID&#039;]) || $new_item <br />&nbsp; &nbsp; &nbsp; &nbsp; || check_usage($_POST[&#039;stock_id&#039;],false);</p><p>&nbsp; &nbsp; // show inactive item tax type in selector only if already set.<br />&nbsp; item_tax_types_list_row(_(&quot;Item Tax Type:&quot;), &#039;tax_type_id&#039;, null, !$new_item &amp;&amp; item_type_inactive(get_post(&#039;tax_type_id&#039;)));</p><p>&nbsp; &nbsp; if (!get_post(&#039;fixed_asset&#039;))<br />&nbsp; &nbsp; &nbsp; &nbsp; stock_item_types_list_row(_(&quot;Item Type:&quot;), &#039;mb_flag&#039;, null, $fresh_item);</p><p>&nbsp; &nbsp; stock_units_list_row(_(&#039;Units of Measure:&#039;), &#039;units&#039;, null, TRUE);</p><p>&nbsp; &nbsp; check_row(_(&quot;Editable description:&quot;), &#039;editable&#039;);</p><p>&nbsp; &nbsp; if (get_post(&#039;fixed_asset&#039;))<br />&nbsp; &nbsp; &nbsp; &nbsp; hidden(&#039;no_sale&#039;, 0);<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; check_row(_(&quot;Exclude from sales:&quot;), &#039;no_sale&#039;);</p><p>&nbsp; &nbsp; check_row(_(&quot;Exclude from purchases:&quot;), &#039;no_purchase&#039;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF0000">$result = get_all_item_units();<br />&nbsp; &nbsp; &nbsp; &nbsp; while ($unit = db_fetch($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $units[$unit[&#039;abbr&#039;]] = $unit[&#039;name&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; amount_row(_(&quot;Weight:&quot;), &quot;weight&quot;, null, null, array_selector(&quot;weight_uom&quot;, null, $units, array(&#039;disabled&#039; =&gt; false)));<br />&nbsp; &nbsp; &nbsp; &nbsp; amount_row(_(&quot;Volume:&quot;), &quot;volume&quot;, null, null, array_selector(&quot;volume_uom&quot;, null, $units, array(&#039;disabled&#039; =&gt; false)));</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ...</p></blockquote></div><p><strong>Modifying add and Update db functions<br />File : inventory\includes\db\items_db.inc</strong></p><div class="quotebox"><blockquote><p>function update_item($stock_id, $description, $long_description, $category_id, <br />&nbsp; &nbsp; $tax_type_id, $units=&#039;&#039;, $mb_flag=&#039;&#039;, $sales_account, $inventory_account, <br />&nbsp; &nbsp; $cogs_account, &nbsp; &nbsp; $adjustment_account, $wip_account, $dimension_id, <br />&nbsp; &nbsp; $dimension2_id, $no_sale, $editable, $no_purchase,<br />&nbsp; &nbsp; $depreciation_method = &#039;D&#039;, $depreciation_rate=100, $depreciation_factor=1,<br />&nbsp; &nbsp; $depreciation_start=null, $fa_class_id=null<span style="color: #FF0000">,$weight = 0,$weight_uom = &#039;&#039;,$volume = 0,$volume_uom = &#039;&#039;</span>)<br />{<br />&nbsp; &nbsp; $sql = &quot;UPDATE &quot;.TB_PREF.&quot;stock_master SET long_description=&quot;.db_escape($long_description).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; description=&quot;.db_escape($description).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; category_id=&quot;.db_escape($category_id).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; sales_account=&quot;.db_escape($sales_account).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; inventory_account=&quot;.db_escape($inventory_account).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; cogs_account=&quot;.db_escape($cogs_account).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; adjustment_account=&quot;.db_escape($adjustment_account).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; wip_account=&quot;.db_escape($wip_account).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; dimension_id=&quot;.db_escape($dimension_id).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; dimension2_id=&quot;.db_escape($dimension2_id).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; tax_type_id=&quot;.db_escape($tax_type_id).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; no_sale=&quot;.db_escape($no_sale).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; no_purchase=&quot;.db_escape($no_purchase).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; editable=&quot;.db_escape($editable).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; depreciation_method=&quot;.db_escape($depreciation_method).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; depreciation_rate=&quot;.db_escape($depreciation_rate).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; depreciation_factor=&quot;.db_escape($depreciation_factor).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; fa_class_id=&quot;.db_escape($fa_class_id);</p><p>&nbsp; &nbsp; if ($units != &#039;&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot;, units=&quot;.db_escape($units);<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF0000">if (is_numeric($weight)){<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot;, weight=&quot;.db_escape($weight);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot;, weight_uom=&quot;.db_escape($weight_uom);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if (is_numeric($volume)){<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot;, volume=&quot;.db_escape($volume);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot;, volume_uom=&quot;.db_escape($volume_uom);<br />&nbsp; &nbsp; &nbsp; &nbsp; }</span></p><p>&nbsp; &nbsp; if ($mb_flag != &#039;&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot;, mb_flag=&quot;.db_escape($mb_flag);</p><p>&nbsp; &nbsp; if ($depreciation_start != &#039;&#039;) {<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot;, depreciation_start=&#039;&quot;.date2sql($depreciation_start).&quot;&#039;&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .&quot;, depreciation_date=&#039;&quot;.date2sql($depreciation_start).&quot;&#039;&quot;;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; $sql .= &quot; WHERE stock_id=&quot;.db_escape($stock_id);</p><p>&nbsp; &nbsp; db_query($sql, &quot;The item could not be updated&quot;);</p><p>&nbsp; &nbsp; update_item_code(-1, $stock_id, $stock_id, $description, $category_id, 1, 0);<br />}</p><p>function add_item($stock_id, $description, $long_description, $category_id, <br />&nbsp; &nbsp; $tax_type_id, $units, $mb_flag,&nbsp; &nbsp; $sales_account, $inventory_account, <br />&nbsp; &nbsp; $cogs_account, $adjustment_account,&nbsp; &nbsp; $wip_account, $dimension_id, <br />&nbsp; &nbsp; $dimension2_id, $no_sale, $editable, $no_purchase,<br />&nbsp; &nbsp; $depreciation_method=&#039;D&#039;, $depreciation_rate=100,&nbsp; $depreciation_factor=1, $depreciation_start=null,<br />&nbsp; &nbsp; $fa_class_id=null<span style="color: #FF0000">,$weight = 0,$weight_uom = &#039;&#039;,$volume = 0,$volume_uom = &#039;&#039;</span>)<br />{<br />&nbsp; &nbsp; $sql = &quot;INSERT INTO &quot;.TB_PREF.&quot;stock_master (stock_id, description, long_description, category_id,<br />&nbsp; &nbsp; &nbsp; &nbsp; tax_type_id, units, mb_flag, sales_account, inventory_account, cogs_account,<br />&nbsp; &nbsp; &nbsp; &nbsp; adjustment_account, wip_account, dimension_id, dimension2_id, no_sale, no_purchase, editable,<br />&nbsp; &nbsp; &nbsp; &nbsp; depreciation_method, depreciation_rate, depreciation_factor, depreciation_start, depreciation_date, fa_class_id, weight, weight_uom, voume, volume_uom)<br />&nbsp; &nbsp; &nbsp; &nbsp; VALUES (&quot;.db_escape($stock_id).&quot;, &quot;.db_escape($description).&quot;, &quot;.db_escape($long_description).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;.db_escape($category_id).&quot;, &quot;.db_escape($tax_type_id).&quot;, &quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; .db_escape($units).&quot;, &quot;.db_escape($mb_flag).&quot;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;.db_escape($sales_account).&quot;, &quot;.db_escape($inventory_account)<br />&nbsp; &nbsp; &nbsp; &nbsp; .&quot;, &quot;.db_escape($cogs_account).&quot;,&quot;.db_escape($adjustment_account)<br />&nbsp; &nbsp; &nbsp; &nbsp; .&quot;, &quot;.db_escape($wip_account).&quot;, &quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; .db_escape($dimension_id).&quot;, &quot;.db_escape($dimension2_id).&quot;,&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; .db_escape($no_sale).&quot;,&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; .db_escape($no_purchase).&quot;,&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; .db_escape($editable).&quot;,&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; .db_escape($depreciation_method).&quot;,&quot;.db_escape($depreciation_rate).&quot;,&quot;.db_escape($depreciation_factor).&quot;,&#039;&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; .date2sql($depreciation_start).&quot;&#039;,&#039;&quot;.date2sql($depreciation_start).&quot;&#039;,&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; .db_escape($fa_class_id).<span style="color: #FF0000">&quot;, &quot;.&nbsp; db_escape($weight).&quot;, &quot;.&nbsp; db_escape($weight_uom).&quot;, &quot;.&nbsp; db_escape($volume).&quot;, &quot;.&nbsp; db_escape($volume_uom).</span>&quot;)&quot;;</p><p>&nbsp; &nbsp; db_query($sql, &quot;The item could not be added&quot;);</p><p>&nbsp; &nbsp; $sql = &quot;INSERT INTO &quot;.TB_PREF.&quot;loc_stock (loc_code, stock_id)<br />&nbsp; &nbsp; &nbsp; &nbsp; SELECT loc_code, &quot;.db_escape($stock_id)<br />&nbsp; &nbsp; &nbsp; &nbsp; .&quot; FROM &quot;.TB_PREF.&quot;locations&quot;;</p><p>&nbsp; &nbsp; db_query($sql, &quot;The item locstock could not be added&quot;);</p><p>&nbsp; &nbsp; add_item_code($stock_id, $stock_id, $description, $category_id, 1, 0);<br />}</p></blockquote></div><p><strong>The Stock master table will change as follows:</strong></p><div class="quotebox"><blockquote><p>ALTER TABLE `0_stock_master` <br />ADD COLUMN `weight` DOUBLE NULL AFTER `fa_class_id`,<br />ADD COLUMN `weight_uom` VARCHAR(20) NULL AFTER `weight`,<br />ADD COLUMN `volume` DOUBLE NULL AFTER `weight_uom`,<br />ADD COLUMN `volume_uom` VARCHAR(20) NULL AFTER `volume`;</p></blockquote></div><p><strong>Modifying Payslip Report..<br />File : rep110</strong></p><div class="quotebox"><blockquote><p>&lt;?php<br />/**********************************************************************<br />&nbsp; &nbsp; Copyright (C) FrontAccounting, LLC.<br />&nbsp; &nbsp; Released under the terms of the GNU General Public License, GPL, <br />&nbsp; &nbsp; as published by the Free Software Foundation, either version 3 <br />&nbsp; &nbsp; of the License, or (at your option) any later version.<br />&nbsp; &nbsp; This program is distributed in the hope that it will be useful,<br />&nbsp; &nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of<br />&nbsp; &nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&nbsp; <br />&nbsp; &nbsp; See the License here &lt;http://www.gnu.org/licenses/gpl-3.0.html&gt;.<br />***********************************************************************/<br />$page_security = $_POST[&#039;PARAM_0&#039;] == $_POST[&#039;PARAM_1&#039;] ?<br />&nbsp; &nbsp; &#039;SA_SALESTRANSVIEW&#039; : &#039;SA_SALESBULKREP&#039;;<br />// ----------------------------------------------------------------<br />// $ Revision:&nbsp; &nbsp; 2.0 $<br />// Creator:&nbsp; &nbsp; Janusz Dobrwolski<br />// date_:&nbsp; &nbsp; 2008-01-14<br />// Title:&nbsp; &nbsp; Print Delivery Notes<br />// ----------------------------------------------------------------<br />$path_to_root=&quot;..&quot;;</p><p>include_once($path_to_root . &quot;/includes/session.inc&quot;);<br />include_once($path_to_root . &quot;/includes/date_functions.inc&quot;);<br />include_once($path_to_root . &quot;/includes/data_checks.inc&quot;);<br />include_once($path_to_root . &quot;/sales/includes/sales_db.inc&quot;);</p><p>//----------------------------------------------------------------------------------------------------</p><p>print_deliveries();</p><p>//----------------------------------------------------------------------------------------------------</p><p>function print_deliveries()<br />{<br />&nbsp; &nbsp; global $path_to_root, $SysPrefs;</p><p>&nbsp; &nbsp; include_once($path_to_root . &quot;/reporting/includes/pdf_report.inc&quot;);</p><p>&nbsp; &nbsp; $from = $_POST[&#039;PARAM_0&#039;];<br />&nbsp; &nbsp; $to = $_POST[&#039;PARAM_1&#039;];<br />&nbsp; &nbsp; $email = $_POST[&#039;PARAM_2&#039;];<br />&nbsp; &nbsp; $packing_slip = $_POST[&#039;PARAM_3&#039;];<br />&nbsp; &nbsp; $comments = $_POST[&#039;PARAM_4&#039;];<br />&nbsp; &nbsp; $orientation = $_POST[&#039;PARAM_5&#039;];</p><p>&nbsp; &nbsp; if (!$from || !$to) return;</p><p>&nbsp; &nbsp; $orientation = ($orientation ? &#039;L&#039; : &#039;P&#039;);<br />&nbsp; &nbsp; $dec = user_price_dec();</p><p>&nbsp; &nbsp; $fno = explode(&quot;-&quot;, $from);<br />&nbsp; &nbsp; $tno = explode(&quot;-&quot;, $to);<br />&nbsp; &nbsp; $from = min($fno[0], $tno[0]);<br />&nbsp; &nbsp; $to = max($fno[0], $tno[0]);</p><p>&nbsp; &nbsp; $cols = array(4, 60, 190, 265, 295, 340, 400, 460, 515);</p><p>&nbsp; &nbsp; // $headers in doctext.inc<br />&nbsp; &nbsp; $aligns = array(&#039;left&#039;,&nbsp; &nbsp; &#039;left&#039;,&nbsp; &nbsp; &#039;right&#039;, &#039;left&#039;, &#039;right&#039;, &#039;right&#039;, &#039;right&#039;, &#039;right&#039;);</p><p>&nbsp; &nbsp; $params = array(&#039;comments&#039; =&gt; $comments, &#039;packing_slip&#039; =&gt; $packing_slip);</p><p>&nbsp; &nbsp; $cur = get_company_Pref(&#039;curr_default&#039;);</p><p>&nbsp; &nbsp; if ($email == 0)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if ($packing_slip == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep = new FrontReport(_(&#039;DELIVERY&#039;), &quot;DeliveryNoteBulk&quot;, user_pagesize(), 9, $orientation);<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep = new FrontReport(_(&#039;PACKING SLIP&#039;), &quot;PackingSlipBulk&quot;, user_pagesize(), 9, $orientation);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; if ($orientation == &#039;L&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; recalculate_cols($cols);<br />&nbsp; &nbsp; for ($i = $from; $i &lt;= $to; $i++)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!exists_customer_trans(ST_CUSTDELIVERY, $i))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $myrow = get_customer_trans($i, ST_CUSTDELIVERY);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $branch = get_branch($myrow[&quot;branch_code&quot;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sales_order = get_sales_order_header($myrow[&quot;order_&quot;], ST_SALESORDER); // ?<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($email == 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep = new FrontReport(&quot;&quot;, &quot;&quot;, user_pagesize(), 9, $orientation);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($packing_slip == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;title = _(&#039;DELIVERY NOTE&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;filename = &quot;Delivery&quot; . $myrow[&#039;reference&#039;] . &quot;.pdf&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;title = _(&#039;PACKING SLIP&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;filename = &quot;Packing_slip&quot; . $myrow[&#039;reference&#039;] . &quot;.pdf&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;currency = $cur;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;Font();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;Info($params, $cols, null, $aligns);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $contacts = get_branch_contacts($branch[&#039;branch_code&#039;], &#039;delivery&#039;, $branch[&#039;debtor_no&#039;], true);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;SetCommonData($myrow, $branch, $sales_order, &#039;&#039;, ST_CUSTDELIVERY, $contacts);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;SetHeaderType(&#039;Header2&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewPage();</p><p>&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = get_customer_trans_details(ST_CUSTDELIVERY, $i);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $SubTotal = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $TotalWeight = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($myrow2=db_fetch($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($myrow2[&quot;quantity&quot;] == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Net = round2(((1 - $myrow2[&quot;discount_percent&quot;]) * $myrow2[&quot;unit_price&quot;] * $myrow2[&quot;quantity&quot;]),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; user_price_dec());<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $SubTotal += $Net;<br />&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; $DisplayPrice = number_format2($myrow2[&quot;unit_price&quot;],$dec);<br />&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; $DisplayQty = number_format2($myrow2[&quot;quantity&quot;],get_qty_dec($myrow2[&#039;stock_id&#039;]));<br />&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; $DisplayNet = number_format2($Net,$dec);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $stock_item = get_item($myrow2[&#039;stock_id&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Weight = $stock_item[&#039;weight&#039;] * $myrow2[&quot;unit_price&quot;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $DisplayWeight = number_format2($Weight,$dec);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $TotalWeight += $Weight;<br />&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; if ($myrow2[&quot;discount_percent&quot;]==0)<br />&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $DisplayDiscount =&quot;&quot;;<br />&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $DisplayDiscount = number_format2($myrow2[&quot;discount_percent&quot;]*100,user_percent_dec()) . &quot;%&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(0, 1,&nbsp; &nbsp; $myrow2[&#039;stock_id&#039;], -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $oldrow = $rep-&gt;row;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextColLines(1, 2, $myrow2[&#039;StockDescription&#039;], -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $newrow = $rep-&gt;row;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;row = $oldrow;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($Net != 0.0&nbsp; || !is_service($myrow2[&#039;mb_flag&#039;]) || !$SysPrefs-&gt;no_zero_lines_amount())<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(2, 3,&nbsp; &nbsp; $DisplayQty, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(3, 4,&nbsp; &nbsp; $myrow2[&#039;units&#039;], -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($packing_slip == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(4, 5,&nbsp; &nbsp; $DisplayPrice, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(5, 6,&nbsp; &nbsp; $DisplayDiscount, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(6, 7,&nbsp; &nbsp; $DisplayWeight, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(7, 8,&nbsp; &nbsp; $DisplayNet, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;row = $newrow;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //$rep-&gt;NewLine(1);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($rep-&gt;row &lt; $rep-&gt;bottomMargin + (15 * $rep-&gt;lineHeight))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewPage();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $memo = get_comments_string(ST_CUSTDELIVERY, $i);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($memo != &quot;&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewLine();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextColLines(1, 3, $memo, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $DisplaySubTot = number_format2($SubTotal,$dec);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;row = $rep-&gt;bottomMargin + (15 * $rep-&gt;lineHeight);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $doctype=ST_CUSTDELIVERY;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($packing_slip == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(3, 7, _(&quot;Sub-total&quot;), -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(7, 8,&nbsp; &nbsp; $DisplaySubTot, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewLine();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($myrow[&#039;ov_freight&#039;] != 0.0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $DisplayFreight = number_format2($myrow[&quot;ov_freight&quot;],$dec);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(3, 7, _(&quot;Shipping&quot;), -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(7, 8,&nbsp; &nbsp; $DisplayFreight, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewLine();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tax_items = get_trans_tax_details(ST_CUSTDELIVERY, $i);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $first = true;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($tax_item = db_fetch($tax_items))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($tax_item[&#039;amount&#039;] == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $DisplayTax = number_format2($tax_item[&#039;amount&#039;], $dec);</p><p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($SysPrefs-&gt;suppress_tax_rates() == 1)<br /> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tax_type_name = $tax_item[&#039;tax_type_name&#039;];<br /> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br /> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tax_type_name = $tax_item[&#039;tax_type_name&#039;].&quot; (&quot;.$tax_item[&#039;rate&#039;].&quot;%) &quot;;</p><p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($myrow[&#039;tax_included&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($SysPrefs-&gt;alternative_tax_include_on_docs() == 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($first)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(3, 7, _(&quot;Total Tax Excluded&quot;), -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(7, 8,&nbsp; &nbsp; number_format2($tax_item[&#039;net_amount&#039;], $dec), -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewLine();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(3, 7, $tax_type_name, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(7, 8,&nbsp; &nbsp; $DisplayTax, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $first = false;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(3, 8, _(&quot;Included&quot;) . &quot; &quot; . $tax_type_name . _(&quot;Amount&quot;) . &quot;: &quot; . $DisplayTax, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(3, 7, $tax_type_name, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(7, 8,&nbsp; &nbsp; $DisplayTax, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewLine();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewLine();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $DisplayTotal = number_format2($myrow[&quot;ov_freight&quot;] +$myrow[&quot;ov_freight_tax&quot;] + $myrow[&quot;ov_gst&quot;] +<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $myrow[&quot;ov_amount&quot;],$dec);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;Font(&#039;bold&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(3, 7, _(&quot;TOTAL DELIVERY INCL. VAT&quot;), - 2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(7, 8,&nbsp; &nbsp; $DisplayTotal, -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $words = price_in_words($myrow[&#039;Total&#039;], ST_CUSTDELIVERY);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($words != &quot;&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewLine(1);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(1, 8, $myrow[&#039;curr_code&#039;] . &quot;: &quot; . $words, - 2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;Font();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(3, 6, _(&quot;Total Weight&quot;), -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;TextCol(6, 7, number_format2($TotalWeight,$dec), -2);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;NewLine();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($email == 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;End($email);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; if ($email == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;End();<br />}</p></blockquote></div><p>and Finally doctext.inc</p><div class="quotebox"><blockquote><p>case ST_CUSTDELIVERY:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;title = ($this-&gt;params[&#039;packing_slip&#039;] ? _(&quot;PACKING SLIP&quot;) : _(&quot;DELIVERY NOTE&quot;));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF0000">$this-&gt;headers = array(_(&quot;Item Code&quot;), _(&quot;Item Description&quot;), _(&quot;Quantity&quot;),<br />&nbsp; &nbsp; &nbsp; &nbsp; _(&quot;Unit&quot;), _(&quot;Price&quot;), _(&quot;Discount %&quot;), _(&quot;Weight&quot;), _(&quot;Total&quot;));</span><br />...</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[detkenn]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45282</uri>
			</author>
			<updated>2020-03-06T13:55:09Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37105#p37105</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37103#p37103" />
			<content type="html"><![CDATA[<p>Just post the modified code. @joe will add it to core and put it for other users benefit</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2020-03-06T06:56:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37103#p37103</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37098#p37098" />
			<content type="html"><![CDATA[<p>I agree with you. How can we ensure this is integrated in FA..</p>]]></content>
			<author>
				<name><![CDATA[detkenn]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45282</uri>
			</author>
			<updated>2020-03-05T08:32:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37098#p37098</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37095#p37095" />
			<content type="html"><![CDATA[<p>This can be useful to calculate shipping cost too. Especially on quotes or sales orders.</p>]]></content>
			<author>
				<name><![CDATA[cristiart]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=17592</uri>
			</author>
			<updated>2020-03-05T02:40:11Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37095#p37095</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Total Weight on Packing Slip]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37014#p37014" />
			<content type="html"><![CDATA[<p>Using FA for a distribution company, we needed the packing slip to show the total weight of the items. This is to ensure that we don&#039;t overload the vehicles. I modified add items form to include weight per unit which is later user to calculate the total weight on the packing slip.</p><p>I was wondering if this modification will be of use to other people.</p>]]></content>
			<author>
				<name><![CDATA[detkenn]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45282</uri>
			</author>
			<updated>2020-02-16T12:43:56Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37014#p37014</id>
		</entry>
</feed>
