226

(35 replies, posted in Banking and General Ledger)

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.

227

(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

(35 replies, posted in Banking and General Ledger)

@rafat what do you expect to show other than a Customer or Supplier?

229

(7 replies, posted in Reporting)

Given a test today with basic reports and find Margins issue as mentioned here
http://prnt.sc/okysmi

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

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.

Hello friends, need support on this

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>
$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?

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.

@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.

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.

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

`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.

@itronics,  yes database consistency requires some update queries to run.

I agree with you. I will check in detail later

Hello, is it possible in FA to get first few columns freezed in db_pager_view?

242

(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.

I think I didn't sleep well last night. All is working now smile

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?

Yes waiting for all good news

Attendance with time in and time out.
Csv import for time in and time out

@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

(7 replies, posted in Reporting)

@barbarian, great work. I will test it. I really needed a good reporting from HTML to PDF.

@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.

@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.