<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Bug in Supplier Credit Note Edit]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8889&amp;type=atom" />
	<updated>2020-07-31T08:20:09Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8889</id>
		<entry>
			<title type="html"><![CDATA[Re: Bug in Supplier Credit Note Edit]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37883#p37883" />
			<content type="html"><![CDATA[<p>Hello Guys,</p><p>I couldn&#039;t find any better solution, so I have followed @Braath Waate&#039;s solution. I hope it works and please help testing it.</p><p>The changes will be committed to repo asap.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2020-07-31T08:20:09Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37883#p37883</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in Supplier Credit Note Edit]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37875#p37875" />
			<content type="html"><![CDATA[<p>@joe: check if it needs to get into the core.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2020-07-30T19:50:47Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37875#p37875</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in Supplier Credit Note Edit]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37865#p37865" />
			<content type="html"><![CDATA[<p>@BraathWate it worked. Thanks</p>]]></content>
			<author>
				<name><![CDATA[boxygen]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20175</uri>
			</author>
			<updated>2020-07-29T13:15:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37865#p37865</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in Supplier Credit Note Edit]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37864#p37864" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>diff --git a/core/purchasing/includes/supp_trans_class.inc b/core/purchasing/includes/supp_trans_class.inc
index be9ec00..5a17f86 100644
--- a/core/purchasing/includes/supp_trans_class.inc
+++ b/core/purchasing/includes/supp_trans_class.inc
@@ -66,7 +66,7 @@ class supp_trans
                        read_supp_invoice($trans_no, $trans_type, $this);
                        if ($trans_type == ST_SUPPCREDIT)
                        {
-                               $this-&gt;src_docs = find_src_invoices($trans_no);
+                               $this-&gt;src_docs = find_src_invoices($this);
                        }
                        read_supplier_details_to_trans($this, $this-&gt;supplier_id);
                }
diff --git a/core/purchasing/supplier_credit.php b/core/purchasing/supplier_credit.php
index 461c804..070afda 100644
--- a/core/purchasing/supplier_credit.php
+++ b/core/purchasing/supplier_credit.php
@@ -28,8 +28,12 @@ if (user_use_date_picker())
 
 //----------------------------------------------------------------------------------------
 
-if (isset($_GET[&#039;ModifyCredit&#039;]))
+if (isset($_GET[&#039;ModifyCredit&#039;])) {
        check_is_editable(ST_SUPPCREDIT, $_GET[&#039;ModifyCredit&#039;]);
+    $_SESSION[&#039;page_title&#039;] = sprintf( _(&quot;Modifying Supplier Credit # %d&quot;), $_GET[&#039;ModifyCredit&#039;]);
+    $_SESSION[&#039;supp_trans&#039;] = new supp_trans(ST_SUPPCREDIT, $_GET[&#039;ModifyCredit&#039;]);
+}
+

 
 //---------------------------------------------------------------------------------------------------</code></pre></div><p>I doubt the old code ever worked.&nbsp; I looked at the change history for related files and nothing has been changed that would have caused this to break.&nbsp; The proposed change above is incomplete and untested; G/L line items cannot be edited, only added or deleted.</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2020-07-29T13:02:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37864#p37864</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Bug in Supplier Credit Note Edit]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37863#p37863" />
			<content type="html"><![CDATA[<p>When I tried to Edit Credit Note of Supplier in FA 2.4.8 I faced following bug. My PHP is 7.4</p><div class="codebox"><pre><code>Trying to get property &#039;Comments&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 16
/home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc:80:    copy_from_trans(&#039;&#039;)
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;tran_date&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 17
/home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc:80:    copy_from_trans(&#039;&#039;)
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;due_date&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 18
/home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc:80:    copy_from_trans(&#039;&#039;)
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;supp_reference&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 19
/home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc:80:    copy_from_trans(&#039;&#039;)
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;reference&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 20
/home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc:80:    copy_from_trans(&#039;&#039;)
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;supplier_id&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 21
/home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc:80:    copy_from_trans(&#039;&#039;)
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;dimension&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 22
/home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc:80:    copy_from_trans(&#039;&#039;)
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;dimension2&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 23
/home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc:80:    copy_from_trans(&#039;&#039;)
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;ex_rate&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 25
/home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc:80:    copy_from_trans(&#039;&#039;)
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;trans_type&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 86
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;trans_no&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 97
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Trying to get property &#039;supplier_id&#039; of non-object in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 104
/home/pakerp/web/core.pakerp.net/public_html/purchasing/supplier_credit.php:348:    invoice_header(&#039;&#039;)
Unhandled exception [0]: Call to a member function clear_items() on null. in file: /home/pakerp/web/core.pakerp.net/public_html/purchasing/includes/ui/invoice_ui.inc at line 109
exception_handler((Error Object))</code></pre></div><p>I don&#039;t think its a PHP related bug. The Session Variable is not instantiated.</p><p>Here is the Screen shot <a href="https://prnt.sc/tqcosv">https://prnt.sc/tqcosv</a></p>]]></content>
			<author>
				<name><![CDATA[boxygen]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20175</uri>
			</author>
			<updated>2020-07-29T07:19:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37863#p37863</id>
		</entry>
</feed>
