Thanks @rafat for pointing this out. I didn't get your query earlier. Bundle of thanks to @BraathWate for this modification. Now I can see the Value entered in the Miscellaneous Box is now printed in the CounterParty column.
226 07/30/2019 01:40:02 am
Re: Journal Inquiry Dates (35 replies, posted in Banking and General Ledger)
227 07/28/2019 07:50:57 am
Re: Journal Inquiry Dates (35 replies, posted in Banking and General Ledger)
Actually Customers / Suppliers are basically Subsidiary accounts of Accounts Receivable / Accounts Payable . While Banks and Cash or any other accounts are main gl Accounts. So this particular column is for Sub Accounts
228 07/28/2019 02:53:37 am
Re: Journal Inquiry Dates (35 replies, posted in Banking and General Ledger)
@rafat what do you expect to show other than a Customer or Supplier?
229 07/28/2019 02:50:33 am
Re: Update in reporting code (7 replies, posted in Reporting)
Given a test today with basic reports and find Margins issue as mentioned here
http://prnt.sc/okysmi
230 07/17/2019 04:22:25 pm
Re: In db_pager can we freeze first few columns (7 replies, posted in FA Modifications)
Hi @anoopmb your suggestion worked like a charm. I prefer to customize the core aand load JS in the footer.
Thanks Alot you have saved a lot of hassle for me.
I would request @joe to add such features in the upcoming 2.5
231 07/16/2019 02:30:17 pm
Re: In db_pager can we freeze first few columns (7 replies, posted in FA Modifications)
Thanks @poncho1234 you have suggested a non javascript solution.
But still my question is that how to get the Jquery Function workable after Ajax Call. My problem is discussed here. I have tried them but could not find workable in FA.
232 07/16/2019 01:00:39 pm
Re: In db_pager can we freeze first few columns (7 replies, posted in FA Modifications)
Hello friends, need support on this
233 07/15/2019 10:04:51 am
Re: In db_pager can we freeze first few columns (7 replies, posted in FA Modifications)
I have successfully implemented this jquery solution for column and header freeze.
But I am stuck that once a page is reloaded due to Ajax Call then the following Jquery Function at the bottom of the page is not called.
<script>
$(document).ready(function() {
$(".table-scrollable").freezeTable({
'scrollable': true,
'columnNum' : 5,
});
});
</script>
234 07/10/2019 06:43:52 am
Topic: Transaction References with Customer Placeholder (5 replies, posted in Accounts Receivable)
$refline_placeholders = array(
'MM' => 'date',
'YY' => 'date',
'YYYY' => 'date',
'FF' => 'date', // fiscal year
'FFFF' => 'date',
'UU' => 'user',
'P' => 'pos',
// FIXME: for placeholders below all the code should work, but as the ref length is variable,
// length specification in placeholder format should be implemented.
'C' => 'customer',
'B' => 'branch',
'S' => 'supplier',
'L' => 'location'
);
I uncommented the last four placeholders. should {C} shall bring the Customer's ShortCode in Reference. It is bringing 0. Any idea?
235 07/03/2019 05:46:33 pm
Re: Planned changes in stock_moves table structure in FA 2.5 (6 replies, posted in Development)
If you agree with my post#5 then
This condition
$types = array(ST_SUPPCREDIT, ST_SUPPRECEIVE);
if (in_array($type, $types))
$unit_cost = $row["price"];
else
$unit_cost = $row["standard_cost"];
in function void_stock_move in includes/db/inventory_db.inc will be changed to
$unit_cost = $row["price"];
Because now this will work for all transaction types to fetch the unit_cost affecting avg_cost.
236 07/03/2019 05:40:26 pm
Re: Planned changes in stock_moves table structure in FA 2.5 (6 replies, posted in Development)
@itronics I have once again gone through your post#1. If I am not mistaken you are planning to use
1. avg_cost (old standard_cost) as storage for material cost before transaction and
2. unit_cost (old price) as storage for material_cost after transaction
??.
If yes, then this would not be OK. Although we can retrieve price from related tables for Sale and Purchase transactions but this is not true for Stock Adjustment Transactions.
So whether or not you change the name of price column, it shall contain the unit_cost that is affecting the avg_cost. So If an Item A is purchase @ $20 then supp_invoice_items.unit_price will contain $20 as well as unit_cost column in stock_moves will also contain $20.
I hope I have clarified my view point.
237 07/03/2019 11:31:02 am
Re: Planned changes in stock_moves table structure in FA 2.5 (6 replies, posted in Development)
on includes/db/inventory_db.inc at line # 475 we shall add this condition
if ($type!=ST_LOCTRANSFER)
before the following function call
update_average_material_cost($row["supplier_id"], $row["stock_id"],
$unit_cost, -$row["qty"], sql2date($row["tran_date"]), false, "Void Stock Move # $type_no and type = $type_no");
Rationale
There is no reason for updating average cost while Voiding Stock Move due to Location Transfer. The inventory is neither gaining not loosing here.
If we don't do this then Avg Unit Cost is adversely affected. Because the stock_moves table doesn't contain any price for Location Transfer hence $unit_cost parameter passed to update_average_material_cost is ZERO so the resulting weighted average is not correct at the end of transaction.
238 07/03/2019 10:54:29 am
Re: Planned changes in stock_moves table structure in FA 2.5 (6 replies, posted in Development)
function update_stock_move($type, $trans_no, $stock_id, $cost)
{
$sql = "UPDATE ".TB_PREF."stock_moves SET standard_cost=".db_escape($cost)
." WHERE type=".db_escape($type)
." AND trans_no=".db_escape($trans_no)
." AND stock_id=".db_escape($stock_id);
db_query($sql, "The stock movement standard_cost cannot be updated");
}
This function on includes/db/inventory_db.inc is not called from anywhere
239 06/23/2019 01:05:40 pm
Re: Planned changes in stock_moves table structure in FA 2.5 (6 replies, posted in Development)
`standard_cost` changed to `avg_cost` - store for item average cost (stock_master.material_cost) before transaction
I think is the store of average cost after transaction. the resulting average cost of the item due the unit_cost being used in the transaction.
240 06/23/2019 12:41:17 pm
Re: Anomaly created by Cost Update in Inventory Sales Report (rep304) (20 replies, posted in Items and Inventory)
@itronics, yes database consistency requires some update queries to run.
I agree with you. I will check in detail later
241 06/22/2019 06:19:28 am
Topic: In db_pager can we freeze first few columns (7 replies, posted in FA Modifications)
Hello, is it possible in FA to get first few columns freezed in db_pager_view?
242 06/18/2019 06:06:06 pm
Re: Release 2.5. (10 replies, posted in Development)
I want to suggest that in 2.5 we shall include this modification done by @anoopmb
https://frontaccounting.com/punbb/viewtopic.php?id=7525
This is very useful approval system. It requires some database changes that we can do in 2.5. Currently it is applied only to GL module but later on we can gradually shift its application to all other modules.
243 06/18/2019 04:59:53 pm
Re: Unable to Access Global Variables on Reports (2 replies, posted in Reporting)
I think I didn't sleep well last night. All is working now
244 06/18/2019 12:32:12 pm
Topic: Unable to Access Global Variables on Reports (2 replies, posted in Reporting)
Hello, I am unable to access system global variables on reports. While they are accessible on any other page. Any Idea?
For example I tried calling on rep501.php the global variable $bank_account_types even exclusively including includes/sysnames.inc like below code
$page_security = 'SA_DIMENSIONREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
// date_: 2005-05-19
// Title: Dimension Summary
// ----------------------------------------------------------------
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/gl/includes/gl_db.inc");
include_once($path_to_root . "/includes/sysnames.inc");
//----------------------------------------------------------------------------------------------------
write_sql_to_file("Dimension Inquiry control_cols".print_r($bank_account_types,true));
but it gives following error and the global variable is not read
Undefined variable: bank_account_types in file: /home/pakerp/web/pakerp.net/public_html/reporting/rep501.php at line 30
While these variables are accessible from all other UI pages. Why?
245 06/18/2019 12:21:35 pm
Re: Payroll & Human Resource Management. (216 replies, posted in Modules Add-on's)
Yes waiting for all good news
246 06/17/2019 05:29:12 pm
Re: Payroll & Human Resource Management. (216 replies, posted in Modules Add-on's)
Attendance with time in and time out.
Csv import for time in and time out
247 06/17/2019 08:07:13 am
Re: Anomaly created by Cost Update in Inventory Sales Report (rep304) (20 replies, posted in Items and Inventory)
@joe, not for this topic now. But I have few suggestions for 2.5. This post https://frontaccounting.com/punbb/viewtopic.php?id=8137 doesn't allow us to post. Where can we post for suggestions for 2.5.
248 06/17/2019 06:06:15 am
Re: Update in reporting code (7 replies, posted in Reporting)
@barbarian, great work. I will test it. I really needed a good reporting from HTML to PDF.
249 06/16/2019 09:49:25 pm
Re: Anomaly created by Cost Update in Inventory Sales Report (rep304) (20 replies, posted in Items and Inventory)
@joe,
Should we change back to the former functions, get_domestic_price, in rep301 and rep308, but wich these changed rows?
You can do either, or but I think better keep the one in post # 11. I have tested it. It has changed conditions as well as some removal of logical bugs and
And post #8 should be changed? and the wrongly calculated domestic price?
Post #8 should be committed otherwise domestic_price will not calculate correctly.
With my finally suggested codes in post#8 and post#11 domestic_price is calculating correctly the average cost.
Regards.
250 06/16/2019 08:37:36 pm
Re: Anomaly created by Cost Update in Inventory Sales Report (rep304) (20 replies, posted in Items and Inventory)
@joe,
function get_domestic_price needs some more adjustments. But it requires changes in post#8 to be committed first.
function get_domestic_price($myrow, $stock_id)
{
if ($myrow['type'] == ST_SUPPRECEIVE || $myrow['type'] == ST_SUPPCREDIT || $myrow['type'] == ST_INVADJUST)
{
$price = $myrow['price'];
if ($myrow['person_id'] > 0)
{
// Do we have foreign currency?
$supp = get_supplier($myrow['person_id']);
$currency = $supp['curr_code'];
$ex_rate = $myrow['ex_rate'];
$price *= $ex_rate;
}
}
else
$price = $myrow['standard_cost']; //pick standard_cost for sales deliveries
return $price;
}
Explanation:
1. We need price Value only for ST_SUPPRECEIVE, ST_SUPPCREDIT AND ST_INVADUST. For Sales Deliveries we need the standard_cost for Average cost calculation in rep301, rep308.
2. $price *= $ex_rate is currently $price /= $ex_rate which is a logical mistake.
3. We can pick Exchange Rate directly from Supplier Transaction for GRN and Supplier Credit Note. For this we need some more changes in rep301 and rep308
Following partial code in the SQL Query shall be replaced with
IF(ISNULL(supplier.supplier_id), debtor.debtor_no, supplier.supplier_id) person_id
This code
supplier.supplier_id person_id, IF(ISNULL(grn.rate), credit.rate, grn.rate) ex_rate
Explanation
1. We need person_id only for suppliers to get exchange rate of the transaction in get_domestic_price function
2. ex_rate is directly picked from either GRN or Supplier Credit
I have tested all this after creating a fresh item and executing all type of transactions on it as in this image
There is one understanding that ST_CUSTCREDIT transactions will always pick the prevailing unit_cost.
Regards.