<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — No edit in supplier invoice quick entry]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7306&amp;type=atom" />
	<updated>2019-03-19T14:44:10Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7306</id>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34503#p34503" />
			<content type="html"><![CDATA[<p>@BraathbWaate.</p><p>Ok I will commit it later.</p><p>Joe</p><p><a href="https://github.com/FrontAccountingERP/FA/commit/c001557f8ebee630494c6323477bd865a61942d9">Committed</a></p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-03-19T14:44:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34503#p34503</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34502#p34502" />
			<content type="html"><![CDATA[<p>@joe</p><p>I really didn&#039;t do any testing, but I think it is safe, because the edit just is a copy of the existing delete code, and then just defaults the newline to the edit line values, so it shouldn&#039;t cause any harm.</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2019-03-19T11:18:20Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34502#p34502</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34501#p34501" />
			<content type="html"><![CDATA[<p>@Braath Waate.</p><p>Is this safe to implement in the core now?</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-03-19T06:34:27Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34501#p34501</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34497#p34497" />
			<content type="html"><![CDATA[<p>@Braath Waate&nbsp; Thank you, thank you, thank you very much!&nbsp; &nbsp;This works perfect!&nbsp; </p><p>I really don&#039;t know if it works correctly for manufacturing or normal retail profit businesses because all I have done is Church accounting for the last 10 years.&nbsp; If anyone else uses this for the above type profit businesses and it doesn&#039;t mess up the taxes or other costs, then you wholeheartedly have my vote to get this put into the core for the next release.</p><p>Thank you again for your immediate support!</p><p>JimmyC</p>]]></content>
			<author>
				<name><![CDATA[JimmyC]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42434</uri>
			</author>
			<updated>2019-03-19T01:51:47Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34497#p34497</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34496#p34496" />
			<content type="html"><![CDATA[<p>Sorry.&nbsp; &nbsp;The supplier_invoice.php changes should have been:</p><div class="codebox"><pre><code>+++ b/core/purchasing/supplier_invoice.php
@@ -352,6 +352,20 @@ if ($id4 != -1)
        $Ajax-&gt;activate(&#039;gl_items&#039;);
 }
 
+$id5 = find_submit(&#039;Edit&#039;);
+if ($id5 != -1)
+{
+    $_POST[&#039;gl_code&#039;] = $_SESSION[&#039;supp_trans&#039;]-&gt;gl_codes[$id5]-&gt;gl_code;
+    $_POST[&#039;dimension_id&#039;] = $_SESSION[&#039;supp_trans&#039;]-&gt;gl_codes[$id5]-&gt;gl_dim;
+    $_POST[&#039;dimension2_id&#039;] = $_SESSION[&#039;supp_trans&#039;]-&gt;gl_codes[$id5]-&gt;gl_dim2;
+    $_POST[&#039;amount&#039;] = $_SESSION[&#039;supp_trans&#039;]-&gt;gl_codes[$id5]-&gt;amount;
+    $_POST[&#039;memo_&#039;] = $_SESSION[&#039;supp_trans&#039;]-&gt;gl_codes[$id5]-&gt;memo_;
+
+       $_SESSION[&#039;supp_trans&#039;]-&gt;remove_gl_codes_from_trans($id5);
+       reset_tax_input();
+       $Ajax-&gt;activate(&#039;gl_items&#039;);
+}
+
 $id2 = -1;
 if ($_SESSION[&quot;wa_current_user&quot;]-&gt;can_access(&#039;SA_GRNDELETE&#039;))
 {</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2019-03-18T19:57:55Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34496#p34496</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34495#p34495" />
			<content type="html"><![CDATA[<p>@Braath Waate&nbsp; Thank you very much for for the code snippet from above.&nbsp; It should completely fulfill my request but I have either made a change wrong or my existing version of FA isn&#039;t updated to the correct level.</p><p>To begin with, I am using Version 2.4.4 Build 17.03.2018.&nbsp; When I try Purchases -&gt; Supplier Invoices -&gt; Go to add an entry using the Quick Entry method, I get the entry added correctly but with the &quot;red x&quot; in the next to last right side field and the &quot;Edit Pencil&quot; in the right most field.&nbsp; To me, that is what I was hoping for but when I press either the &quot;red x&quot; or &quot;Edit Pencil&quot;, the line is deleted and all that is left is the original partially empty default line that is there when first entering this input form.&nbsp; </p><p>Also, the &quot;Edit Pencil&quot; not only deletes the Quick Entry line but then displays a light green banner across the top of the form with the Account Number of the default entry centered in the green banner and &quot;Edit line from document&quot; box on the far right side of the form&#039;s title line.</p><p>I have attached copied code snippets that I changed for both of my files below:</p><p>Part 1 of changes to invoice_ui.inc:<br /></p><div class="codebox"><pre><code>//--------------------------------------------------------------------------------------------------
function display_gl_controls(&amp;$supp_trans, $k)
{
    $accs = get_supplier_accounts($supp_trans-&gt;supplier_id);
    if (!isset($_POST[&#039;gl_code&#039;]))
        $_POST[&#039;gl_code&#039;] = $accs[&#039;purchase_account&#039;] ? 
            $accs[&#039;purchase_account&#039;] : get_company_pref(&#039;default_cogs_act&#039;);</code></pre></div><p>Part 2 of changes to invoice_ui.inc:<br /></p><div class="codebox"><pre><code>            {
                delete_button_cell(&quot;Delete2&quot; . $entered_gl_code-&gt;Counter, _(&quot;Delete&quot;),
                      _(&#039;Remove line from document&#039;));
                edit_button_cell(&quot;Edit&quot; . $entered_gl_code-&gt;Counter, _(&quot;Edit&quot;),
                        _(&#039;Edit line from document&#039;));            
            }    
            end_row();
            if ($mode &gt; 1) {</code></pre></div><p>1 set of changes in purchasing/supplier_invoice.php:<br /></p><div class="codebox"><pre><code>    $Ajax-&gt;activate(&#039;gl_items&#039;);
}

$id4 = find_submit(&#039;Edit&#039;);
if ($id4 != -1)
{
       display_notification($_POST[&#039;gl_code&#039;]);
       $_SESSION[&#039;supp_trans&#039;]-&gt;remove_gl_codes_from_trans($id4);
       reset_tax_input();
       $Ajax-&gt;activate(&#039;gl_items&#039;);
}

$id2 = -1;
if ($_SESSION[&quot;wa_current_user&quot;]-&gt;can_access(&#039;SA_GRNDELETE&#039;))
{</code></pre></div><p>Thank you for all of the help that you have done.&nbsp; If you or anyone can find what I have done wrong, it will be greatly appreciated.</p><p>JimmyC</p>]]></content>
			<author>
				<name><![CDATA[JimmyC]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42434</uri>
			</author>
			<updated>2019-03-18T14:05:47Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34495#p34495</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34488#p34488" />
			<content type="html"><![CDATA[<p>@joe: is it to be added in the core?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-03-17T03:34:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34488#p34488</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34479#p34479" />
			<content type="html"><![CDATA[<p>My five minute edit solution (delete the g/l item but then default the fields on the new line) is:<br /></p><div class="codebox"><pre><code>diff --git a/core/purchasing/includes/ui/invoice_ui.inc b/core/purchasing/includes/ui/invoice_ui.inc
index b6d3d4f..53b4f3c 100644
--- a/core/purchasing/includes/ui/invoice_ui.inc
+++ b/core/purchasing/includes/ui/invoice_ui.inc
@@ -199,6 +199,7 @@ function invoice_totals(&amp;$supp_trans)
 function display_gl_controls(&amp;$supp_trans, $k)
 {
        $accs = get_supplier_accounts($supp_trans-&gt;supplier_id);
+    if (!isset($_POST[&#039;gl_code&#039;]))
        $_POST[&#039;gl_code&#039;] = $accs[&#039;purchase_account&#039;] ? 
                $accs[&#039;purchase_account&#039;] : get_company_pref(&#039;default_cogs_act&#039;);
 
@@ -316,7 +317,8 @@ function display_gl_items(&amp;$supp_trans, $mode=0)
                        {
                                delete_button_cell(&quot;Delete2&quot; . $entered_gl_code-&gt;Counter, _(&quot;Delete&quot;),
                                          _(&#039;Remove line from document&#039;));
-                               label_cell(&quot;&quot;);
+                               edit_button_cell(&quot;Edit&quot; . $entered_gl_code-&gt;Counter, _(&quot;Edit&quot;),
+                                         _(&#039;Edit line from document&#039;));
                        }       
                        end_row();
                        if ($mode &gt; 1) {
diff --git a/core/purchasing/supplier_invoice.php b/core/purchasing/supplier_invoice.php
index 3e1bcdc..a0bb0fd 100644
--- a/core/purchasing/supplier_invoice.php
+++ b/core/purchasing/supplier_invoice.php
@@ -352,6 +352,15 @@ if ($id4 != -1)
        $Ajax-&gt;activate(&#039;gl_items&#039;);
 }
 
+$id4 = find_submit(&#039;Edit&#039;);
+if ($id4 != -1)
+{
+       display_notification($_POST[&#039;gl_code&#039;]);
+       $_SESSION[&#039;supp_trans&#039;]-&gt;remove_gl_codes_from_trans($id4);
+       reset_tax_input();
+       $Ajax-&gt;activate(&#039;gl_items&#039;);
+}
+
 $id2 = -1;
 if ($_SESSION[&quot;wa_current_user&quot;]-&gt;can_access(&#039;SA_GRNDELETE&#039;))
 {</code></pre></div><p>Use at your own risk.</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2019-03-15T12:11:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34479#p34479</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34474#p34474" />
			<content type="html"><![CDATA[<p>@poncho1234</p><p>I have followed your request for this &quot;edit&quot; option since I started using FA in April of 2018.&nbsp; In my research, a similar question was asked in 2010 and 2011.&nbsp; &nbsp;That is all I could find and no one has expanded on your post of 02/03/2018.</p><p>I have a need for this option for the way I use FA for a not for profit organization.&nbsp; &nbsp;All I desire is to be able to edit the supplier invoice quick entry while creating the &quot;GL Items for this Invoice&quot;. I am using quick entries for the individual line items needed to generate the GL items for the supplier invoice.&nbsp; Note that these Quick Entries are simple single Expense Account assignments to a specific service account number provided without any Tax, surcharge, shipping or anything added in.</p><p>The fields that I would like to edit could be one or all of the normal fields available when entering a GL entry into the empty grid;<br />&nbsp; Name<br />&nbsp; Dimension 1<br />&nbsp; Dimension 2<br />&nbsp; Amount<br />&nbsp; Memo</p><p>To see what is changed or added in the database, I made a single quick entry for one supplier and used WinMerge to show all changes.&nbsp; Since I am not knowledgeable of SQL, I could not see any calculations behind the scenes other than saving exacting what I entered in the lines after clicking &quot;Enter Invoice&quot;.&nbsp; I even compared the changes when entering a different one, &quot;deleting&quot; this Quick Entry and manually entering the data for the correct entry and the database changes were the same.&nbsp; </p><p>Because of this, I could not see any reason why being able to edit a GL line entry before it is &quot;saved&quot; or &quot;posted&quot; is prohibited. I am not asking to be able to pull up an existing processed supplier invoice and change it, I&#039;m only asking to be able to edit the GL items for the new invoice that is currently being created before it is ever saved.</p><p>If you need any specifics, please ask and I will explain as much as I can since what I am asking is not proprietary in any way and I think is much needed by current users of FA.</p>]]></content>
			<author>
				<name><![CDATA[JimmyC]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42434</uri>
			</author>
			<updated>2019-03-15T03:42:15Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34474#p34474</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30707#p30707" />
			<content type="html"><![CDATA[<p>When would the avg cost be calculated? After the invoice is processed I think?</p><p>Also, one of the advantages / functions of quick entries is that you can enter any amount in and the same calculation is completed, so avg cost will fluctuate anyway.</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-02-03T14:36:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30707#p30707</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30702#p30702" />
			<content type="html"><![CDATA[<p>Possibly an edit might confuse the system&#039;s average / costing computation. It is easier to revert to the previous cost and then compute anew when entered again.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-02-03T06:20:29Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30702#p30702</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[No edit in supplier invoice quick entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30700#p30700" />
			<content type="html"><![CDATA[<p>Hi,</p><p>When creating a quick entry for the following:-</p><p>bank deposits,<br />payments, <br />journal entries</p><p>You have the opportunity to edit or delete the row or rows created</p><p>But in supplier invoice there is only the option to delete the row or rows; there is no option to edit?</p><p>Is this correct? If so what is the reasoning behind it?</p><p><s>Edit: Is this because the suppier invoice is for items received but not yet invoiced?</s></p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-02-02T23:57:17Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30700#p30700</id>
		</entry>
</feed>
