<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Cannot Delete / Cancel invoice from api]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9505&amp;type=atom" />
	<updated>2021-11-02T09:02:13Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=9505</id>
		<entry>
			<title type="html"><![CDATA[Re: Cannot Delete / Cancel invoice from api]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=40198#p40198" />
			<content type="html"><![CDATA[<p>Hi,</p><p>@DrCard</p><p>To &quot;delete&quot; an invoice you need to void the invoice.&nbsp; In src/Journal.php you&#039;ll see the implementation of delete which voids a transaction.&nbsp; This is on the endpoint &#039;/modules/api/journal/&#039;.</p><p>The tests are in tests/Journal_Tets.php which demonstrates a full Create Read Update Delete test cycle.</p><p>You&#039;ll need to do a little research on the $type parameter.&nbsp; I think &quot;10&quot; is for invoice from memory - not sure.</p><p>BTW, I was a contributor to the api back in 2018.</p>]]></content>
			<author>
				<name><![CDATA[cambell]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19447</uri>
			</author>
			<updated>2021-11-02T09:02:13Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=40198#p40198</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Cannot Delete / Cancel invoice from api]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=40102#p40102" />
			<content type="html"><![CDATA[<p>The Api is not officially taken to be a module. It was made with before. 2.4 and after that , there&nbsp; is no maintenance from the original developer. May be If you find him from github, knock him to get its updated version.</p><p>Or hopefully any other developer used it before. They will help you here.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-10-14T16:48:31Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=40102#p40102</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Cannot Delete / Cancel invoice from api]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=40101#p40101" />
			<content type="html"><![CDATA[<p>Hi .</p><p>I was trying to delete or cancel the invoice from api. </p><p>But i found out that the sample code has disabled the function for demonstrating how to delete with a message that it isn&#039;t implemented or tested fully. </p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; /* Delete is currently untested, and not implemented with standard FA<br />&nbsp; &nbsp; &nbsp; &nbsp; // Delete<br />&nbsp; &nbsp; &nbsp; &nbsp; $response = $client-&gt;delete(&#039;/modules/api/sales/&#039; . $id, array(<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;headers&#039; =&gt; TestEnvironment::headers()<br />&nbsp; &nbsp; &nbsp; &nbsp; ));<br />&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;assertEquals(&#039;200&#039;, $response-&gt;getStatusCode());<br />&nbsp; &nbsp; &nbsp; &nbsp; $result = $response-&gt;getBody();<br />&nbsp; &nbsp; &nbsp; &nbsp; $result = json_decode($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // List again<br />&nbsp; &nbsp; &nbsp; &nbsp; $response = $client-&gt;get(&#039;/modules/api/sales/&#039;, array(<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;headers&#039; =&gt; TestEnvironment::headers()<br />&nbsp; &nbsp; &nbsp; &nbsp; ));</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;assertEquals(&#039;200&#039;, $response-&gt;getStatusCode());<br />&nbsp; &nbsp; &nbsp; &nbsp; $result = $response-&gt;getBody();<br />&nbsp; &nbsp; &nbsp; &nbsp; $result = json_decode($result);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $count2 = count($result);<br />&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;assertEquals($count0, $count2);<br />&nbsp; &nbsp; &nbsp; &nbsp; */</p><p>I did further study. i tried to enable the code , It gave me error for loading the class AutoFacturaCore.php.inc .. Which isn&#039;t there int he project. </p><p>I need to know if there is any update on this</p>]]></content>
			<author>
				<name><![CDATA[DrCard]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45206</uri>
			</author>
			<updated>2021-10-14T11:04:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=40101#p40101</id>
		</entry>
</feed>
