<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Import Transactions Direct Invoice paid by card]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9122&amp;type=atom" />
	<updated>2020-12-19T12:45:43Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=9122</id>
		<entry>
			<title type="html"><![CDATA[Re: Import Transactions Direct Invoice paid by card]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38786#p38786" />
			<content type="html"><![CDATA[<p>Thanks for that suggestion, I will investigate...</p>]]></content>
			<author>
				<name><![CDATA[drgrumpy]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=40696</uri>
			</author>
			<updated>2020-12-19T12:45:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38786#p38786</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Import Transactions Direct Invoice paid by card]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38784#p38784" />
			<content type="html"><![CDATA[<p>@apmuthu:&nbsp; This function is in my osCommerce and Square extensions.&nbsp; These extensions import sales orders into FA, which is the same purpose as Import Transactions -&gt; Sales Orders.&nbsp; The function retrieves the FA sales point by name suitable for populating $cart-&gt;pos, which allows an order to specify the bank account for a direct invoice payment.</p><p>The function isn&#039;t necessary.&nbsp; &nbsp;The core provides <em>get_sales_point($id)</em> (<strong>sales/includes/db/sales_points_db.inc</strong>) which can be used to populate $cart-&gt;pos, if you know the mysql key to the sales point.&nbsp; &nbsp;The function that I suggested allows the sales point to be retrieved by name rather than id.</p><p>Import Transactions -&gt; Sales Orders does not have the ability to specify multiple sales points and neither does the core.&nbsp; By design, the core relies on a <a href="https://frontaccounting.com/fawiki/index.php?n=Help.POSSettings">single POS per user</a>.&nbsp; All user transactions use this POS.&nbsp; To me, that design seems rather inflexible, and <a href="https://frontaccounting.com/punbb/viewtopic.php?id=5039">discussions about changing that design have not been well received</a>.</p><p>Therefore, customization is required to pick and choose multiple sales points when running under a single user.&nbsp; Import Transactions -&gt; Sales Order could be customized by adding a sales point field (id or name) to the import file and then in the code setting $cart-&gt;pos = get_sales_point($id) or $cart-&gt;pos = get_sales_point_by_name($name).</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2020-12-18T11:47:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38784#p38784</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Import Transactions Direct Invoice paid by card]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38781#p38781" />
			<content type="html"><![CDATA[<p>@braathwaate: Please specify which file this function can be in and how and where it may be called in the extension. Is it specific to your version of the Import Transactions extension?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2020-12-18T04:55:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38781#p38781</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Import Transactions Direct Invoice paid by card]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38773#p38773" />
			<content type="html"><![CDATA[<p>Yes, that is the behavior that I would expect because import transactions inherits the POS from the user profile, which is why I suggested trying it as a first measure.</p><p>You could change the import transactions code to assign the POS based on some key in your input file.&nbsp; It is not difficult.&nbsp; The cart has a pos variable.&nbsp; You just need to populate it with the pos that you want to use.&nbsp; Define one POS for each payment method (cash, credit card, check, gift card, etc).</p><div class="codebox"><pre><code>function get_sales_point_by_name($name)
{
        $sql = &quot;SELECT pos.*, loc.location_name, acc.bank_account_name FROM &quot;
                .TB_PREF.&quot;sales_pos as pos
                LEFT JOIN &quot;.TB_PREF.&quot;locations as loc on pos.pos_location=loc.loc_code
                LEFT JOIN &quot;.TB_PREF.&quot;bank_accounts as acc on pos.pos_account=acc.id
                WHERE pos.pos_name=&quot;.db_escape($name);

        $result = db_query($sql, &quot;could not get POS definition&quot;);

        return db_fetch($result);
}

$cart-&gt;pos=get_sales_point_by_name(&quot;Credit Card&quot;);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2020-12-17T20:19:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38773#p38773</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Import Transactions Direct Invoice paid by card]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38772#p38772" />
			<content type="html"><![CDATA[<p>So after some further testing....</p><p>If I log in as a user with &#039;card payments POS&#039; then when I import, all payments are credited to the &#039;merchant account&#039; even if they were cash payments with a payment_id of 4.</p><p>In the short term I can sort the payments into two separate files, then login as different users to import as cash and card... but this is not really satisfactory....</p>]]></content>
			<author>
				<name><![CDATA[drgrumpy]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=40696</uri>
			</author>
			<updated>2020-12-17T18:34:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38772#p38772</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Import Transactions Direct Invoice paid by card]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38771#p38771" />
			<content type="html"><![CDATA[<p>Hmm, thanks for the suggestion Braath Waite but I already have my &#039;merchant account&#039; set as Cash account.</p><p>I have been importing as super admin, but perhaps I need to be logged in as specific user.</p><p>In trying to figure out how the code works, I see that payment_id is used to get payment terms<br />$cart-&gt;payment_terms = get_payment_terms($payment_id);</p><p>But I cannot locate where the get_payment_terms() function is defined.... <br /><s>I have searched the code, if anyone can give me a clue...</s><br />found it in <strong>db/company_db.inc</strong></p>]]></content>
			<author>
				<name><![CDATA[drgrumpy]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=40696</uri>
			</author>
			<updated>2020-12-17T18:07:11Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38771#p38771</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Import Transactions Direct Invoice paid by card]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38767#p38767" />
			<content type="html"><![CDATA[<p>@joe: Can we have a company specific flag to choose this option as a sys_prefs record? Or should we just have &quot;cash and bank&quot; accounts available in the select box?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2020-12-17T17:17:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38767#p38767</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Import Transactions Direct Invoice paid by card]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38766#p38766" />
			<content type="html"><![CDATA[<p>FA limits direct customer sales invoices to cash accounts.&nbsp; This is because Setup-&gt;Points Of Sales-&gt;Default Cash Account is limited to cash accounts.&nbsp; This is easily overridden with the code change:<br /></p><div class="codebox"><pre><code>--- a/core/sales/manage/sales_points.php
+++ b/core/sales/manage/sales_points.php
@@ -130,7 +130,11 @@ text_row_ex(_(&quot;Point of Sale Name&quot;).&#039;:&#039;, &#039;name&#039;, 20, 30);
 if($cash) {
        check_row(_(&#039;Allowed credit sale terms selection:&#039;), &#039;credit&#039;, check_value(&#039;credit_sale&#039;));
        check_row(_(&#039;Allowed cash sale terms selection:&#039;), &#039;cash&#039;,  check_value(&#039;cash_sale&#039;));
-       cash_accounts_list_row(_(&quot;Default cash account&quot;).&#039;:&#039;, &#039;account&#039;);
+
+        // POS systems often allow direct deposit into bank accounts,
+        // so do not restrict the POS &quot;cash sale&quot; to cash accounts
+       // cash_accounts_list_row(_(&quot;Default cash account&quot;).&#039;:&#039;, &#039;account&#039;);
+       bank_accounts_list_row(_(&quot;Default account&quot;).&#039;:&#039;, &#039;account&#039;);
 } else {
        hidden(&#039;credit&#039;, 1);
        hidden(&#039;account&#039;, 0);</code></pre></div><p>By making this code change, a pos can be created with a non-cash account.&nbsp; &nbsp;Then use Setup-&gt;User Accounts Setup to create a user with this POS.&nbsp; Then try import transactions using this user.</p><p>I do not know if this will work, but it may get you further than before.</p><p>I do know that the rest of FA tolerates this change because my site uses this.&nbsp; But I do not use Import Transactions for this purpose.</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2020-12-17T16:48:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38766#p38766</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Import Transactions Direct Invoice paid by card]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38763#p38763" />
			<content type="html"><![CDATA[<p>For some time I have been successfully using:<br />Import Transactions -&gt; Direct Sales Invoice Processing<br />to import our cash sales...</p><p>Recently we started taking card payments,<br />so I set up the card payment terms, created a gl account and bank account, and POS for credit cards...</p><p>So I thought that in order to import the card payments I would just set the payment id in the csv to &#039;11&#039; (the card payment terms id from lookup), they are all imported without error, but the payment goes to the petty cash bank account instead of card merchant bank account</p><p>It seems to ignore the payment id of 11 and behaves as if it was set to 4</p><p>Am I missing something, or is it not possible - or where do I need to modify code to get the required result for payment id of 11?</p>]]></content>
			<author>
				<name><![CDATA[drgrumpy]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=40696</uri>
			</author>
			<updated>2020-12-17T15:42:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38763#p38763</id>
		</entry>
</feed>
