1

(38 replies, posted in Reporting)

Thanks this patch is working for me.

But I am no longer getting a BCC as set in Setup -> Company Setup -> BCC Address for all outgoing mails

PHP 8.1 FA 2.4.17

With earlier versions I used to get BCC when emailing purchase orders.

As I mentioned above, I am not a programmer. But these changes are solving my problems:

purchasing/includes/purchasing_db.inc

line 113

if ($description = "")

line 109

$price = round($price * $data['conversion_factor'], 6);

Trouble is I have to remember to make these changes every time I upgrade.

FrontAccounting is great! These little hitches cause me grief, but at least I can mess with the code.

But if my messing is going to break something, please let me know!

ckrosco wrote:
apmuthu wrote:

@ckrosco: If you still want t, then your code should be checked:


Thanks - that's good to know. (non-programmer here)

So I just tried it with == but then the suppliers description becomes blank. If I just use one = the suppliers description remains intact.

apmuthu wrote:

@ckrosco: If you still want t, then your code should be checked:

if ($description = "")

is an assignment but it should be

if ($description == "")

which is a comparison.

Thanks - that's good to know. (non-programmer here)

And another really irritating change that happens during this order process is that the purchase price is truncated to the default number of decimal points.

I put the price in at 2.569879 but after processing the order it becomes 2.57 - which is wrong.

These names and prices were put in randomly. In my actual business I have several products that I buy in lots of 42. The per item price is e.g. 13.6904761905 X 42 = 575

When the price is truncated I get a decimal amount, and the supplier's currency does not use decimals.

I don't see a way to add two photos, so here is the second screen shot after processing the order.

The only person(s) that need to know the suppliers code is the suppler himself. Right?

Right. But the supplier code is changed to $description everytime the supply order is processed (purchase order entry -> receive purchase order items -> enter supplier invoice)

Please see the attached screen shots. I created a product called "General Settings name"  with the suppliers description = "supplier's code"

After processing the order, the suppliers description becomes "General Settings name".

Items and Inventory -> Items -> Purchase Pricing

On every "Purchase Order Delivery" action the "Supplier's Code or Description" is overwritten with the product name in the "General Settings" tab.

Here is the fix:

purchasing/includes/purchasing_db.inc

Line 113

    if ($description != "")
        $sql .= ",supplier_description=".db_escape($description);
    $sql .= " WHERE stock_id=".db_escape($stock_id)." AND supplier_id=".db_escape($supplier_id);

should be:

    if ($description = "")
        $sql .= ",supplier_description=".db_escape($description);
    $sql .= " WHERE stock_id=".db_escape($stock_id)." AND supplier_id=".db_escape($supplier_id);

Having misunderstood standard cost, I now have a year's worth of transactions with the incorrect values, as shown in my Inventory GL.

Sales are recorded in one currency and purchases are recorded in the home currency.

Is there any way to re-calculate standard cost for transactions which are already recorded?

I just noticed that standard cost is based on home currency, rather than purchase currency.

When is standard cost calculated? At purchase order? Or invoice payment... or some other transaction?

And is standard cost affected by the most recent currency rate as seen in the Exchange Rates page?

Any clarification on this is appreciated.

purchasing/includes/purchasing_db.inc

Line 113

    if ($description != "")
        $sql .= ",supplier_description=".db_escape($description);
    $sql .= " WHERE stock_id=".db_escape($stock_id)." AND supplier_id=".db_escape($supplier_id);

Why???

This means if the description is not empty e.g. already has data, change the supplier description.

If there is a reason for this, it does not work for me, as every time I receive an order my supplier description changes.

If I change the first line to 

if ($description = "")

then the supplier data remains intact.

I think it would make more sense to scrap this section of code and simply check that the description is not empty when creating a product, which I'm pretty sure FA does already.

FA 2.4.11 default theme

When I enter a new purchase order, then click the Purchase Order Delivery link the data in the purch_data table changes.

Specifically the supplier_description data changes from e.g.

梨山武陵頂級烏龍茶 - 75 g - Wu Ling

to:

Wu Ling 75 grams

This shorter English description matches the description column of the item_codes table.

I would appreciate some ideas on why this is happening and how to prevent it.

13

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

kvvaradha thanks for your help. Here are the first two lines of my csv file:

"Date","Time","TimeZone","Name","Type","Status","Currency","Gross","Fee","Net","From Email Address","To Email Address","Transaction ID","Shipping Address","Address Status","Item Title","Item ID","Shipping and Handling Amount","Insurance Amount","Sales Tax","Option 1 Name","Option 1 Value","Option 2 Name","Option 2 Value","Reference Txn ID","Invoice Number","Custom Number","Quantity","Receipt ID","Balance","Address Line 1","Address Line 2/District/Neighborhood","Town/City","State/Province/Region/County/Territory/Prefecture/Republic","Zip/Postal Code","Country","Contact Phone Number","Subject","Note","Country Code","Balance Impact"

"01/01/2021","02:32:38","EST","Rxxxxx Txxxxxxx","Express Checkout Payment","Completed","USD","120.20","-4.99","115.21","xxxxxxxx@gmail.com","xxxxxxxx@teafromtaiwan.com","5C638500WR1159345","Rxxxxx, Txxxxxxx, PO Box xxx, xxxxxxx, New South Wales, xxxx, Australia","Confirmed","Rui Feng Jin Xuan Milk Oolong Tea [101] Weight:: 75 grams, Dong Ding Ming Xiang Oolong Tea [2] Weight:: 75 grams, Four Season Oolong Tea [12] Weight:: 150 grams, Tsuei Luan Oolong Tea [14] Weight:: 150 grams, Shi Zuo Oolong Tea [13] Weight:: 75 grams","瑞峰金萱茶, 凍頂蜜香烏龍茶, 阿里山四季烏龍茶, 翠巒高級烏龍茶, 阿里山石棹烏龍茶","0.00","","0.00","","","","","","6120-1609486367-[TeaFromTaiwan]","EC-6120-1609486367","5","","221.56","PO Box xxx","","xxxxxxx","New South Wales","xxxx","Australia","xxxxxxxxx","Rui Feng Jin Xuan Milk Oolong Tea [101] Weight:: 75 grams","","AU","Credit"

14

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

With debugging I see this error:

Undefined index: Date in file: /srv/www/htdocs/frontaccounting/modules/import_paypal/import_paypal_update.php at line 264

Line 264 is this:

$date = $data["Date"];

Anything I read about "Undefined index" talks about using $_POST or $_GET in the line, but this seems to be a different usage.

I'm not all that familiar with coding. If anyone can suggest a solution I would appreciate it very much.

15

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

Using frontaccounting 2.4.10 and import paypal module 2.4.0-2

When importing a paypal csv file I get this page:

Select payments' account

Nothing is on this page except an OK button and a back link.

Click on OK and get returned to the Banking and General Ledger page.

Nothing is imported.

The top of the paypal.log files shows:

[21-Nov-2021 17:42:37] file:paypal.CSV
[21-Nov-2021 17:42:37] Phase 2 start:454144
[21-Nov-2021 17:42:37] Memory, phase 2 process start:5667296
[21-Nov-2021 17:42:37] Second pass file: ../../tmp/tft_fa_adminpaypal.csv
[21-Nov-2021 17:42:37] Paypal act:3, withdrawal:4, sales:4000, tax:2150

then a long list of transactions contained in my csv file.

Even if I edit my csv file to eliminate payments, the same thing happens.

There is nothing in the errors.log file.

TIA for any help you can give me to get this working.

There's a small error in reporting/rep302.php in the first sql statement that causes the QOH column to show weird results.

I copied the similar statement from rep303.php with a change from QtyOnHand to qty_on_hand and that seems to correct the issue.

Here is the new code:

function getTransactions($category, $location)
{
    $sql = "SELECT item.category_id,
            category.description AS cat_description,
            item.stock_id, item.units,
            item.description, item.inactive,
            IF(move.stock_id IS NULL, '', move.loc_code) AS loc_code,
            SUM(IF(move.stock_id IS NULL,0,move.qty)) AS qty_on_hand
        FROM ("
            .TB_PREF."stock_master item,"
            .TB_PREF."stock_category category)
            LEFT JOIN ".TB_PREF."stock_moves move ON item.stock_id=move.stock_id
        WHERE item.category_id=category.category_id
        AND (item.mb_flag='B' OR item.mb_flag='M')";
    if ($category != 0)
        $sql .= " AND item.category_id = ".db_escape($category);
    if ($location != 'all')
        $sql .= " AND IF(move.stock_id IS NULL, '1=1',move.loc_code = ".db_escape($location).")";

    $sql .= " GROUP BY item.category_id,
        category.description,
        item.stock_id,
        item.description
        ORDER BY item.category_id,
        item.stock_id";

    return db_query($sql,"No transactions were returned");

}

OK - I see. I just made a payment in CAD and it updated the exchange rate.

Thanks for all your help. I misunderstood this function - I thought it would update the rate everyday without any action on my part.

apmuthu wrote:

Does this mean that you entered the exchange rate manually or got it from the FA exchg rate provider by manually clicking the get rate button?

I get the exchange rate by clicking the button. it works fine with both Google and Yahoo.

apmuthu wrote:

"autoupdate means use remote service & store exrate on first transaction."

So my question is - What kind of transaction that will trigger this?

I did what you suggested about unticking the autoupdate box, saving and then reticking. This makes no difference.

I enter a few sales orders in USD, all the way through to customer payment, and the rate does not update.

I also did a transfer from a USD bank account to a CAD account, which did not update the rates.

So perhaps I have to do Payment or Deposit on the Banking and General Ledger tab, which seems to be the only places where exchange rates are included in the transactions. Is that correct?

apmuthu wrote:

Banking and General ledger => Currencies => Edit Currency => tick AutoUpdate => Update

Auto update is already ticked.

What is the trigger? Is it some kind of cron job? I'm thinking there is a permission problem somewhere.

Thanks.

I have 3 currencies set up - my home currency and USD and CAD.

USD & CAD have been set to auto update, but this doesn't work - I have to manually update the currencies every day.

I've tried using Yahoo and Google for rates - both work with manual update on the Banking and General Ledger tab.

Is there some kind of permission setting I have to use to make this auto update?

It would be nice to have the option of using a title (Dear Mr. Jones).

The default was "Dear Jones", which is kind of abrupt for Western use.

I would like to suggest that the email sent to customers should address them by first name and last name, rather than just the last name.

reporting/includes/pdf.report.inc

line 1005

change

$msg = _("Dear") . " " . $contact['name2'] . ",\n\n" 

to

$msg = _("Dear") . " " . $contact['name'] .' '. $contact['name2'] . ",\n\n" 

24

(14 replies, posted in Translations)

I made a few changes to the zh_TW translation dealing with correspondance (Dear ...; Yours Sincerely...)

I sent the files to the submission email. Just wondering if it was received, and was it in the right format?

Thanks. This can be a useful report for tracking inventory.