1 (edited by kvvaradha 05/07/2022 04:46:42 pm)

Topic: Fixed Assets inquiry has not connected with right GRN

From fixed assets inquiry page, we have a purchased column with link, thats giving wrong trans_no.

get_fixed_asset_purchase  function get invoice now, how do we link the invoice trans no in place of  GRN  trans no.

function purchase_link($row)
{

      if ($row['purchase_date'] === NULL)
        return "";

      return get_supplier_trans_view_str(ST_SUPPRECEIVE, $row["purchase_no"], sql2date($row["purchase_date"]));
}

Here the $row['purchase_no'] has not exist. 

function purchase_link($row)
{

      if ($row['purchase_date'] === NULL)
        return "";
      //my suggestion would be something like this to get GRN now.
       $sql ="SELECT trans_no FROM ".TB_PREF."stock_moves WHERE 1=1 AND type =".ST_SUPPRECEIVE." AND stock_id =".db_escape($row['stock_id'])." AND qty > '0' ";
      $res = db_query($sql, "Can't get grn no");
       $row2=db_fetch($res);

     return get_supplier_trans_view_str(ST_SUPPRECEIVE, $rows["trans_no"], sql2date($row["purchase_date"]));
}

@Joe, check it.  otherwise we need to connect the invoice, instead of the GRN in purchase link.

and also i see, we can try the depreciation start with the date given from fixed assets input date. i dont know the reason why we are using every month start date.

Subscription service based on FA
HRM CRM POS batch Themes