251

(9 replies, posted in Setup)

To see what FA does, create a dummy company, and play around with some ideas.   Look at the reports, balance sheet, p/l, g/l entries and convince yourself how everything will look before using it on live data.

252

(9 replies, posted in Setup)

If you are prepaying freight, it is really an asset account, it is not an expense or cogs at the time you purchase the freight, because the customer transaction has not yet taken place.

I go back to my first suggestion: make a Shipping and Handling a G/L Asset account instead of a Revenue account.    A sales order with shipping will credit this account and purchasing freight will debit this account.  You won't have any revenue or expense in this scenario.

In the more usual scenario, the customer pays for freight up front, generating revenue.   Later, the carrier bills the sender, generating an expense.

cogs is another issue entirely, used for freight in when you are purchasing items to resell.

253

(9 replies, posted in Setup)

By using the Shipping field on the sales order, the customer is charged for the shipping.   This is no different from using a service item and adding it to the sales order.  Conceptually, shipping is a service that is being offered to and then paid by the customer.

As I said, the only reason I can see to use a separate JE is if the customer does not pay for the shipping.

254

(9 replies, posted in Setup)

Perhaps setup prepayments to the freight consolidator as an Asset account (Prepaid Shipping), then change your FA G/L setup Shipping Charged Account to Prepaid Shipping, so that when you enter the FA invoice, the Shipping field uses the Prepaid Shipping account.

If you have multiple shippers with different g/l accounts, you would have to create Service items (e.g. Fedex, UPS, Prepaid USPS, etc) rather than using the provided Shipping field.

If you are offering free shipping, then you would not put any shipping on the sales order, but use a separate JE each time you ship a sales order.   As far as I can tell, there is no way for FA to tie the two together (ie. offer free shipping on the FA sales order and expense it elsewhere).

255

(2 replies, posted in Manufactoring)

Because the workorder table would add the the BOM identifier, disassembly would use the correct BOM and the correct components would be sent back to inventory.

Separate manufactured items for the same product do not meet my requirement, because that would result in separate inventory, and result in sales complexity, since the customer should be offered only one product, not a choice of separate items that are actually the same thing.

256

(2 replies, posted in Manufactoring)

As far as I can tell, the FA manufacturing module does not support part substitution, meaning that a common manufactured item is built in more than one way, using different parts.

So I am thinking of changing the code.  The BOM editor would need to support entry of a manufactured item with multiple BOMs.   Work order creation would need to select the manufactured item to be built as well as the BOM to be used.

This would require database changes, adding a BOM identifier to the bom and workorders tables to identify distinct BOMs.

Does this make sense or would someone suggest a different approach?

This will be my last post on alaa's question, because I don't mean to redirect it off-topic.

However, for the record, the back link in FA calls javascript history.go(), which is identical to the browser back button (see, https://www.w3schools.com/jsref/met_his_back.asp).

Thus, both techniques are open to exactly the same browser cache issue (will the back button display the cached page or will it refresh it?).   I haven't run into this issue with FA, as it seems to always refresh the page in my testing.  If it doesn't, a coder can force it to refresh using cache-control.

The pull request is a standard AJAX coding approach, nothing more (see, https://webmasters.stackexchange.com/questions/88790/how-should-the-back-button-behave-when-a-site-is-built-with-ajax-and-javascript). 

Finally, Web user interface design recommendations discourage placing a back link on a page if it duplicates the browser back button (page clutter).  If it does not duplicate the browser back button, then then link should be called something else.

258

(19 replies, posted in Accounts Payable)

One idea, but I haven't tried it out yet.

https://github.com/apmuthu/frontac24/pull/7 allows service costs to be wrapped into purchased item costs on a single P/O or direct invoice and offers three methods for the calculation.

Thus, using the example offered, each computer is $100 and 10 computers are ordered.   A Freight service item for $100 is added to the P/O, and using the Quantity method, the price of the computer is automatically recalculated to $110 and the service item is zeroed.

While this does not directly address the issue of wrapping in P/Os from multiple vendors, such as DHL, it may be possible to do this by leaving the P/O open until the DHL bill arrives:

1.  When the DHL bill comes in, add the freight to the original P/O, which is then incorporated into the item pricing as described above.

2.  Because now this overstates the amount payable to the vendor of the original P/O, when the P/O is invoiced, the Freight account must be added as a G/L item to the invoice using the negative amount of the DHL payment.

3.  The amount invoiced should now be correct for the original vendor.

4.  DHL is paid in the usual manner against the G/L Freight account.

5.  The net Freight expense is zero, because the negative amount on the invoice offsets the positive amount of the DHL payment.

Result: the cost of the DHL freight is captured in the item price and will be reflected in COGS when the item is sold.

The disadvantage of this approach is that the P/O had to remain open to wait for the DHL freight billing, which delays deliveries, and therefore may not be acceptable.

I wrote the pull request to operate on the P/O, but perhaps it would preferable for it to operate when the invoice is created, which should work because item prices are not firmed up in FA until then.  That would allow the delivery to go forward before the DHL freight bill was received.

Note: https://github.com/apmuthu/frontac24/pull/8 addressed this issue.

260

(13 replies, posted in Reporting)

Or you could modify your FA installation with this pull request:
https://github.com/FrontAccountingERP/FA/pull/26

I would give it a shot, it might just work.

Make a backup first.  Then form a mysql query of the gl_trans table to select all the wrong postings.  Change the query to an update of the right account.

Run through all the reports and see if anything broke.  If so, you can just restore from backup.

Let us know how it turns out.

You can also experiment with making the journal entries and see if that breaks any report.  In theory, it should result in the totals you expect.

Good point.  That function is "Cancel Order", which happens to appear on the edit screen.

But why would anyone actually want to change any of the Sales Order Items or Order Delivery Details on the sales order after it was invoiced?

Just curious if anyone finds it useful to edit a sales order after being invoiced.  While the sales order remains editable after being invoiced, it does not appear to have any impact once it has been invoiced.

264

(8 replies, posted in Setup)

If you want to use the cash basis accounting method with FA, all you need to do is change the "Accounts Receivables" account group from an Asset to an Income account.   The Profit and Loss and Balance Sheet reports and tools will then report on the cash basis.  Its really that simple.

This should suffice for most simple businesses.  If you offer customer financing or prepayment, it gets a little more complex, because you may want to split interest from sales because of reporting requirements, and have to deal with negative A/R.   For example, customer A prepays $100 without an order and customer B makes a $100 order but hasn't paid yet.   Is your income -100, zero or $100 using cash basis accounting?  Good question on an accountant exam.

Caveat: this technique is broken if you use dimensions until FA is updated with a pull request I made.

If you use Accounts Payable, you would have to change it from a Liability to an Expense account (I haven't tested this).

Note: you can change the account group of "Accounts Receivable" back and forth with no harm done if you want to switch between cash to accrual basis.

265

(3 replies, posted in Accounts Payable)

Voiding purchase order deliveries did not work in 2.4.1 (https://frontaccounting.com/punbb/viewtopic.php?id=6875).  Fixed in 2.4.2 I think: https://github.com/FrontAccountingERP/FA/commit/f8e530e76327a6e95854d7a46504c2eb977ae43e.

266

(10 replies, posted in Setup)

Just restating what apmuthu said, follow the instructions by  trafficpest to import the customers.

Good job.  If you would like to share for future users, post your process or scripts.  I am guessing you did an export in Quickbooks, then wrote some script to map and push into the FA mysql database tables.

I wrote some scripts that can aid in a Quickbooks / FA migration: https://gist.github.com/braathwaate/250e13959d437f616b6936025ecd9f56.  They are not turnkey and would require coding skill to get working on another migration.

If all you want is the customer list, you could use the qbimport.sh script that uses facebook/webdriver and selenium to remote control the FA customer entry page.   The advantage of doing an import this way is that you don't need to know anything about the FA database structure.  Its also fun to watch the import.

I did not import the invoices, so each customer started out with zero balance.   Payments after the migration were double entered in Quickbooks and FA (until the customer in both accounting systems reached the same outstanding balance; i.e. all payments from Quickbooks era invoices were received).   Payments from invoices from the Quickbooks era were entered in FA journal entry.

269

(154 replies, posted in Modules Add-on's)

Well I guess you don't need to instrument the code now, as you found the bug, because all three mysql queries should be the same.   The last one is in error.

I will fix the bug in my fork and ask apmuthu to fix the master.   My first thought is to change the line in import_transactions/includes/import_transactions.inc from:

$sql = "SELECT counter, type, type_no, amount FROM " . TB_PREF . "gl_trans ORDER BY counter DESC LIMIT 1";

to

$sql = "select max(type_no) as type_no FROM " . TB_PREF . "gl_trans where type=0";

I haven't tested this, and it may not be the way I will fix it in the master, but its worth a try.

The reason you ran into this problem is because the last gl transaction in your DB happens to be a bank payment.  So another workaround is to make a dummy journal entry as the last transaction then try import transactions again.

270

(154 replies, posted in Modules Add-on's)

The 0-169 entries as you describe appear to be correct, so missing entries in gl_trans must not be the problem.

I was assuming that the error is coming from the call:

     add_journal(ST_JOURNAL, $curEntryId[ST_JOURNAL], ...

in import_transactions.   $curEntryId[ST_JOURNAL] is supposed to be 1 past the last transaction.   It should not be 169 if the last journal transaction is 2187.  You could instrument the code (add the line display_notification(...)) to try to determine why it is not  2187.   Instrument this call and in last_transno().

You could also use mysql to see if the following queries all return the same number:

select max(type_no) from gl_trans where type=0;
select max(trans_no) from journal where type=0;
SELECT counter, type, type_no, amount FROM gl_trans ORDER BY counter DESC LIMIT 1;

271

(154 replies, posted in Modules Add-on's)

Import transactions uses the basic assumption that transaction numbers of type ST_JOURNAL (0) in the GL database "gl_trans" and the journal database "journal" are the same.   As I read the code in FA I believe this should always be true.  So when transactions are imported, the next transaction number to add is the last ST_JOURNAL transaction in the GL database plus one (see last_transno()).  This is used for both the gl_trans and journal DBs.

But if your database somehow violates this assumption, then you could get the error you experienced.

I would start by searching for the duplicate entries (e.g. 0-169) in the GL database.  You can use the mysql tool to do this.   I have to guess that the duplicate entries are not in the GL database; otherwise last_transno() would have found them and set the next transaction number past them.

Why would your database violate the assumption?   Due to some bug in FA where GL database entries were cleared but left in "journal"?

Let me know what you find out.

272

(154 replies, posted in Modules Add-on's)

For initial testing, try creating a file with just one transaction.   Then examine the bottom of the green page.   If it says "xx would have been successful if imported. Uncheck Trial check before importing" then there is some problem with unclicking the trial check.  If it says "xx have been imported", then the item should have been imported, and the next step is to try to find it.   You should notice it on Trial Balance.  Look at the G/L for the account that was imported.  If you can't find it, then post the data line you tried to import.

That makes sense, however I don't know how to do it.

If I try to void the PO Delivery (GRN) before removing the invoice, the message

       The entered transaction does not exist or cannot be voided

still occurs.

Note that the code that actually voids the transaction (void_transaction) still calls exists_grn_on_invoices():

                case ST_SUPPRECEIVE : // it's a GRN
                        if (exists_grn_on_invoices($type_no))
                                return _('This GRN cannot be voided because it was already invoiced.');

But this seems to be prevented from running now by the earlier call to exists_grn() in admin/void_transaction.php.

In 2.3, one can void a PO delivery by voiding the invoice and then voiding the PO delivery.  The voiding of the invoice clears quantity in supp_inv_items.  This allows the void of the PO delivery to proceed because it calls:

function exists_grn_on_invoices($grn_batch)
{
        $sql = "SELECT ".TB_PREF."supp_invoice_items.id FROM ".TB_PREF."supp_invoice_items,".TB_PREF."grn_items
                WHERE ".TB_PREF."supp_invoice_items.grn_item_id=".TB_PREF."grn_items.id
                AND quantity != 0
                AND grn_batch_id=".db_escape($grn_batch);
        $result = db_query($sql, "Cannot query GRNs");

    return (db_num_rows($result) > 0);
}

and disallows the void only if "quantity != 0".

This code changed in 2.4.1.   It now calls exists_grn() which simply checks for a grn_batch entry, and if it exists it disallows the void.   Yet the grn_batch entry still exists after an invoice has been voided and thus returns the error:

         The entered transaction does not exist or cannot be voided.

To test this, create a direct supplier invoice in both 2.3 and 2.4.1, void the invoice and then void the PO Delivery.