@joe, we can add this function to purchasing/includes/db/grn_db.inc. to create a log file in the company's folder for each item whenever the average cost is updated in the system for any reason.

This function (in my instance) also sends an Email Alert to BCC Email of the company.

function update_cost_log($new_material_cost, $curr_material_cost, $qty, $price, $stock_id, $qoh )
{
  global $path_to_root, $db_connections;
    $company = $db_connections[$_SESSION["wa_current_user"]->company]["name"]; //added by faisal
    $date = Today()." ".Now();// date("Y-m-d h:i:sa", $d);

  $tran_type = $qty > 0 ? "Stock IN" : "Stock Out";

  $log = "date=$date,  company=$company,  stock_id=".get_item($stock_id)['description'].",";
  $log .="Quntity On Hand=$qoh,";
  $log .= "Current Material Cost=$curr_material_cost,";
  $log .= "$tran_type=$qty,";
  $log .= "Price to Receive Stock=$price,";
  $log .= "Calculated Material Cost = $new_material_cost";

  file_put_contents(company_path()."/".$stock_id.'.log',$log.PHP_EOL,FILE_APPEND);

if (!get_company_pref('avg_cost_alert')) return;

      require_once($path_to_root . "/reporting/includes/class.mail.inc");

      $mail = new email("ABC", "smtp@abc.net");

          $mail->phpmailer->addAddress(get_company_pref('bcc_email'));

          $mail->subject("Average Cost Alert");
          $mail->text($log);
          $mail->send();
    }

This function can be called at Line # 74 in the above file as below

if ($curr_material_cost <> $material_cost)
        update_cost_log($material_cost, $curr_material_cost, $qty, $price_in_home_currency, $stock_id, $qoh); //by faisal

The same process can be repeated for manufacturing/includes/db/work_order_costing_db.inc

@zia, first of all you are using very older version. At FA on daily basis bugs are identified and rectified. It may be very cumbersome for any senior member here to support you on an older version. I would recommend that to avoid any future problems you keep your FA instance updated to the latest repo.

Secondly you can send me your ERPs credentials via Forum Email. I will try to locate the problem.

May be we can maintain a log file in the company's folder for each item. That Log file can be called in Item Setup to view history with Date and Time, User and Transaction affecting the Average Cost. The user shall be able to refresh that log file.

@joe, this area of FA that average cost of the item get changes but there is no LOG maintained for such change shall be addressed in 2.5.

This has placed me at very critical situation sometimes when a client asks why this Average Cost arrives?

How can I reproduce this error?

281

(6 replies, posted in Accounts Receivable)

Prepayment can be selected at the time of Sales Order only.

282

(6 replies, posted in Accounts Receivable)

Hello,

You need to create a payment terms as PrePayment. While recording an Order or Invoice select this Payment Term.

How can I apply formatting to a cell nowrap using db_pager

Hi @zia, have you you enabled Negative Inventory in Setup?

285

(11 replies, posted in Reporting)

in rep115.php Line # 234 shall be modified as below

         if (db_num_rows($res) == 0 && !$no_zeros)

286

(11 replies, posted in Reporting)

In rep206.php Line # 168 shall be modified as below

 if (db_num_rows($res) == 0 && !$no_zeros) 

and Line # 181 shall be commented, Because ignoring the loop here is not adding up the values of $curr_cr, $curr_db and $item variables.

Great @rafat that worked for me thanks.

When logged in as a User with Language as English, Writing Arabic in Fields like Customer Name shows ?????????
While being logged in as a User with language as Arabic accepts it.

Even any customer name added in Arabic as an Arabic User shows as ??????? when logged in as English User.

How can we use Arabic to input some fields while Logged in as Arabic User?

Hmmm. I was trying from Customer Transaction Inquiry. So there shall be an option to Fix the Water Mark in Company Preferences so that even from Customer Transaction Inquiry the WaterMark appears.

Can't find any watermark in this report

@joe, can you provide the download link of flatcolor2 theme

292

(12 replies, posted in Translations)

Hello @emiangel839 I just finished updating my arabic language using following steps. You also try them

1. Download POEdit
2. Add your Msg Strings like one below in PO file

msgid "Cost Centers"
msgstr "مراكز التكلفة"

3. Open PO file using this application
4. Validate your PO file
5. Compile PO file in MO file
6. Upload both files to the cloud server
7. Restart your Web Server (Apache).
8. Logout and then Login FA.

Note: If you are using a shared hosting then you won't be able to restart apache.

Facing this error on my live site

fopen(../tmp/ar_EG-2.4.1-3.pkg): failed to open stream: No such file or directory in file: /home/pakerp/web/pakerp.net/public_html/includes/remote_url.inc at line 81
/home/pakerp/web/pakerp.net/public_html/includes/remote_url.inc:81:    fopen('../tmp/ar_EG-2.4.1-3.pkg','wb')
/home/pakerp/web/pakerp.net/public_html/includes/packages.inc:381:    url_copy('http://anonymous:password@repo.frontaccounting.eu/2.4/languages/ar_EG-2.4.1-3.pkg','../tmp/ar_EG-2.4.1-3.pkg')
/home/pakerp/web/pakerp.net/public_html/includes/packages.inc:613:    get_pkg_or_list('language','ar_EG')
/home/pakerp/web/pakerp.net/public_html/admin/inst_lang.php:273:    install_language('ar_EG')
Cannot download 'http://anonymous:password@repo.frontaccounting.eu/2.4/languages/ar_EG-2.4.1-3.pkg' file.
/home/pakerp/web/pakerp.net/public_html/includes/ui/ui_msgs.inc:14:    trigger_error('Cannot download 'http://anonymous:password@repo.frontaccounting.eu/2.4/languages/ar_EG-2.4.1-3.pkg' file.','256')
/home/pakerp/web/pakerp.net/public_html/includes/packages.inc:382:    display_error('Cannot download 'http://anonymous:password@repo.frontaccounting.eu/2.4/languages/ar_EG-2.4.1-3.pkg' file.')
/home/pakerp/web/pakerp.net/public_html/includes/packages.inc:613:    get_pkg_or_list('language','ar_EG')
/home/pakerp/web/pakerp.net/public_html/admin/inst_lang.php:273:    install_language('ar_EG')
Package 'ar_EG' not found.
/home/pakerp/web/pakerp.net/public_html/includes/ui/ui_msgs.inc:14:    trigger_error('Package 'ar_EG' not found.','256')
/home/pakerp/web/pakerp.net/public_html/includes/packages.inc:646:    display_error('Package 'ar_EG' not found.')
/home/pakerp/web/pakerp.net/public_html/admin/inst_lang.php:273:    install_language('ar_EG')

While on the latest repo I can download it. Unable to find the reason

Yes, I am also at Fix. Will think over it and try then revert

Yes, this can be done manually. He was insisting that system shall be smart enough to handle this automatically smile

I have been put in a situation by one of my client (a chartered accountant).

Taking transactions of Item A.

Month 1: By Recording Sales and Purchases the Weight Avg Cost of Item A comes at 85.

Month 2: By Recording Sales and Purchases the Weight Avg Cost of Item A comes at 80.

Month 3: By Recording Sales and Purchases the Weight Avg Cost of Item A comes at 73.


Now client says that after reconciliation he found that he missed on Sales Entry of Month1. When he recorded that on backdate the system recorded the cost of inventory @ 73.

He says that by this the profit of Month1 is Over Valued. The system shall record the Back Dated Transactions on the cost of inventory prevailing in that date.

Can anyone help me how to combat this argument? Is it possible to record the back dated transactions the way he is suggesting and then adjusting the latest Average Cost accordingly.

Regards

297

(9 replies, posted in Reporting)

@apmuthu, thanks for this report. Very useful for me.

298

(7 replies, posted in Announcements)

@Joe, I hope 2.5 Alpha will also incorporate the Dashboard widgets developed by @notrinos?

299

(7 replies, posted in Announcements)

2.5 Alpha is anxiously awaited.

config.php would be useful if one FA instance is used for one Company only. Since FA has the power to operate multiple companies with one instance, putting in config.php will contradict with each other may be.