2,201

(16 replies, posted in Accounts Receivable)

Any modifications to the code in the current scripts without altering db schema will entail hardcoding for a specific install with account names / types and ids and that will not be generic. Both Cash and Credit Card are of Cash Type as far as the Payment Terms classification is concerned and that is why the simplified entry form gets displayed. If English is the only language to be used, then hardcoding to see if the word "Cash" is present in the name of the description of the Payment Terms can be attempted. The ramifications of the default POS being different from the one in the user's table will have to be studied. There could be several credit card merchant accounts in one installation where this would fail. Appending the account code to the last part of the Payment Terms description is the only way out for now.

@joe: what say you?

2,202

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

Actually, the Sales Invoices import was coded later and old PHP's graceful degradation based on loose type acceptance is no longer available.

Try this version now.

2,203

(16 replies, posted in Accounts Receivable)

The ERD is now on the Wiki.

2,204

(16 replies, posted in Accounts Receivable)

Wiki updated.

2,205

(16 replies, posted in Accounts Receivable)

Line 580 in sales/includes/ui/sales_order_ui.inc:

        label_row(_("Cash account:"), $order->pos['bank_account_name']);

is responsible for the choice of account. It comes from the field sales_pos.pos_account which is looked up on the field bank_accounts.id whose corresponding field bank_accounts.account_code is the account to which the money flows. The field bank_accounts.bank_account_name is what gets displayed.

The POS is fixed in the users table and hence it this that ultimately determines the hardcoded value of the cash account! Hence, create a user and assign the Credit Card POS and link it to the Credit Card Cash Type account and login as that user to perform such transactions.

When we first login to FA, there is no $_SESSION[$cartname] available.

When we then choose Sales => Direct Sales Invoice and then we change the payment terms first we get the error:
This edit session has been abandoned by opening sales document in another browser tab. You cannot edit more than one sales document at once.

The fix is to change line 49 in sales/includes/sales_ui.inc:

    if ((!isset($SysPrefs->no_check_edit_conflicts) || $SysPrefs->no_check_edit_conflicts==0) && $cart_id && $cart_id != $_SESSION[$cartname]->cart_id) {

to

    if ((!isset($SysPrefs->no_check_edit_conflicts) || $SysPrefs->no_check_edit_conflicts==0) && $cart_id && isset($_SESSION[$cartname]) && $cart_id != $_SESSION[$cartname]->cart_id) {

2,207

(16 replies, posted in Accounts Receivable)

The issue here is to make the hardcoded Petty Cash Account as a dropdown set of bank accounts for Cash term sales documents. Otherwise, should a default hardcoded account to receive payments into be set in the Payment Terms for Cash Type using an extra field?

2,208

(16 replies, posted in Accounts Receivable)

Setup => payment Terms => create new payment terms as Cash type but name it credit card. make an account code similar to cash and call it credit card. Make it a bank account - your merchant bank account.

It appears that the first non default cash type of account in the bank accounts gets hard coded in creating a direct invoice.

Quick Entries as in this post may be useful.

@joe: What is the correct way to make a "Cash" sale (Payment Terms) for a credit card transaction.

2,209

(21 replies, posted in Reporting)

This error comes since you are not using the FA 2.4.3+ master. This error has since been fixed in the repo. Last week's commit and the update 3 days ago fixed it.

The zip of changed files from the release are available in this post.

Tax is set to be included in your price so 5000 * 0.05 / 1.05 = 238.10 SR. Setting it to be Tax Excluded will result in 250 SR = 5000 * 0.05. This setting is in Sales => Sales Types => Tax Incl (checkbox).

Then it should be a browser and version issue / OS issue.

2,212

(21 replies, posted in Reporting)

Unzip into modules folder and a subfolder called rep_customer_ledger will get created. Now in your default company (generally company #0) go to Setup => Install/Update Extensions and "Install" the extension rep_customer_ledger. Then in the top dropdown box, choose Activate for target company and tick checkbox there. Logout and now login to your target company. Read the wiki.

Does the Ajax work for the Item field?

2,214

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

Updated extension in last post with heading line fixed in template. I thought there was an export feature in it. The import_items extension has it though.

2,215

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

Overwrite the corresponding files in <FA webRoot>/modules/import_transactions folder with the ones updated and attached here.

Export a set of transactions and use that format for importing transactions.

2,216

(2 replies, posted in Reporting)

You have quoted from the Wiki.
There is no YouTube video for this. You can create one and paste the link here.

In the text box before the dropdown select box for Items, only the item code can be typed. The dropdown will show the item name only and will be prefixed with the item code only if the "Show Item Codes" checkbox is ticked in the Preferences menu. Where do you get/see "symbols"?

If however, in Setup => Company Setup, the Search Items checkbox is ticked, then the textbox besfore the Items dropdown can be searched by Item Name when by Ajax, the dropdown will get filtered.

Yes. The Ajax should be out of the "if" construct.
Attached is the "beautified" page.

It is possible that somewhere in your code prior to displaying the form field, you are doing something like this:

$_POST['item'] = '';

or

$_POST['item']  = $myrow["item"]; // which may be blank

Also, if the third parameter of the function text_row() is null, then the value of the field is automatically taken from the $_POST array as seen in the function text_input's second parameter which it becomes in includes/ui/ui_input.inc file.

2,220

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

Your import file does not have the data in the correct format - the third ($memo) and last but one ($person_id) fields are missing in your data file's records.

The function get_standard_cost() was available in FA 2.3, being defined in it's includes/db/inventory_db.inc and can be inserted somewhere in the module's file: modules/import_transactions/includes/import_sales_order_entry.inc as:

function get_standard_cost($stock_id)
{
    $sql = "SELECT (material_cost + labour_cost + overhead_cost) AS std_cost
        FROM ".TB_PREF."stock_master s WHERE stock_id=".db_escape($stock_id);
    $result = db_query($sql, "The standard cost cannot be retrieved");

    $myrow = db_fetch_row($result);

    return $myrow[0];
}

where you can replace the function name with it in the module's file.

If you wish to use the current code base, the above function has now been superseeded (on 2016-02-23 in FA 2.4 RC1) in the same file by:

function get_unit_cost($stock_id)
{
    $sql = "SELECT material_cost
        FROM ".TB_PREF."stock_master
        WHERE stock_id=".db_escape($stock_id);
    $result = db_query($sql, "The standard cost cannot be retrieved");

    $myrow = db_fetch_row($result);

    return $myrow[0];
}

The unit labour cost and unit overhead cost are also used now and hence the unit cost is sought to denote the unit material cost only.

Try the attached one that follows the latter code that leverages the currently available function.

@joe: which method is recommended?

Compare your php.ini and my.cnf / my.ini files between the ubuntu 16 and debian 9 installs. Timeouts may be an issue with php.ini settings. MySQL sql mode strict settings too can be an issue.

2,222

(21 replies, posted in Reporting)

The updated extension is attached with whitespace synch with rep101.php and all CRLF converted to LF line endings.

Added to the FA24extensions repo.

You may have to create / use a $_SESSION variable for it and / or enable autofill in the browser settings.

Which dropdown are you referring to and where?

Share Capital is what you are looking for. Profit/Loss distribution to the respective partners is like passing a shareholders dividend journal entry. Yes, FA fully supports partnership firms / partners accounting.