function budget_amount_cells1($id, $parms='')
{
    global $path_to_root;
   
    label_cell(
        "<a target='_blank' " . ($bank_acc<0 ? 'class="redfg"' : '')
        ."href=''$path_to_root/purchasing/inquiry/"budget_detail_entry.php?id=".$id."'"
        ." onclick=\"javascript:openWindow(this.href,this.target); return false;\" >"
        . price_format($id)
        ."</a>", $parms);
}

how do i make this function point into budget id instead of amount id ? keep pointing into amount id

How do I make table cell amount into clickable link already click it but it won't point id in the database?

function budget_amount_cells1($id, $parms='')
{
    global $path_to_root;
   
    label_cell(
        "<a target='_blank' " . ($bank_acc<0 ? 'class="redfg"' : '')
        ."href=''$path_to_root/purchasing/inquiry/"budget_detail_entry.php?id=".$id."'"
        ." onclick=\"javascript:openWindow(this.href,this.target); return false;\" >"
        . price_format($id)
        ."</a>", $parms);
}

already created function so it would direct link to my database but my problem now keep redirecting to supplier_inquiry page how do i change to my budget_detail_entry.php

what do i do with this function to enabled or add hyperlink

function label_cell($label, $params="", $id=null)
{
    global $Ajax;

    if(isset($id))
    {
        $params .= " id='$id'";
        $Ajax->addUpdate($id, $id, $label);
    }
    echo "<td $params>$label</td>\n";


    return $label;
}

if ($showdims)
        $th = array(_("Period"), _("Amount") => array('fun'=>'trans_view', 'ord'=>'', 'align'=>'right'), _("Dim. incl."), _("Last Year"));
    else
        $th = array(_("Period"), _("Amount") => array('fun'=>'trans_view', 'ord'=>'', 'align'=>'right'),  _("Last Year"));

already add the link to direct  to the database now  what did i do wrong ?

Array to string conversion in file: C:\xampp\htdocs\erp\includes\ui\ui_input.inc at line 421 when i tried to add this lines   => array('fun'=>'trans_view', 'ord'=>'', 'align'=>'right'),

im trying to add gl_budget.php from table column Amount into a clickable link how do it ?


gl.budget.php
label_cell(number_format2($d, 0), "nowrap align=right",get_budget_view_str($myrow["id"]));

ui.view code

function get_budget_view_str($type, $trans_no, $label="", $force=false, $class='', $id='')
{
    if (!$force && !user_show_gl_info())
        return "";

    $icon = false;
    if ($label == "")
    {
        $label = _("GL");
        $icon = ICON_GL;
    }
    $url = ($type == ST_WORKORDER) ? "manufacturing/view/wo_costs_view.php?trans_no=$trans_no"
        : "gl/view/gl_budget_view.php?type_id=$type&trans_no=$trans_no";

    return viewer_link($label, $url, $class, $id, $icon);
}



<a href="https://ibb.co/pKq6ST1"><img src="https://i.ibb.co/pKq6ST1/67.png" alt="67" border="0"></a>

created a new page called purchase request but my problems is i copied original file from purchase order now my problems is the purchase request insert its data into purch_order instead of my new database purch_request how do i make my new page purchase request go into databse purch_request?

 //-----> this for my purch_request database how or where do i find the function name for add_po so i could change it?.
function add_po_request(&$po_obj)
{
    global $Refs;

    begin_transaction();
    hook_db_prewrite($po_obj, ST_PURCHORDER);

     /*Insert to purchase order header record */
     $sql = "INSERT INTO ".TB_PREF."purch_request (supplier_id, request_name, Comments, ord_date, reference,
         requisition_no, into_stock_location, delivery_address, total, tax_included, prep_amount) VALUES (";
     $sql .= db_escape($po_obj->supplier_id) . "," .
          db_escape($po_obj->request_name) . "," .
         db_escape($po_obj->Comments) . ",'" .
         date2sql($po_obj->orig_order_date) . "', " .
         db_escape($po_obj->reference) . ", " .
         db_escape($po_obj->supp_ref) . ", " .
         db_escape($po_obj->Location) . ", " .
         db_escape($po_obj->delivery_address) . ", " .
         db_escape($po_obj->get_trans_total()). ", " .
         db_escape($po_obj->tax_included). ", " .
         db_escape($po_obj->prep_amount). ")";

    db_query($sql, "The purchase order header record could not be inserted");

     /*Get the auto increment value of the order number created from the sql above */
     $po_obj->order_no = db_insert_id();

     /*Insert the purchase order detail records */
     foreach ($po_obj->line_items as $line_no => $po_line)
     {
        $sql = "INSERT INTO ".TB_PREF."purch_order_request (order_no, item_code, description, delivery_date,    unit_price,    quantity_ordered) VALUES (";
        $sql .= $po_obj->order_no . ", " . db_escape($po_line->stock_id). "," .
        db_escape($po_line->item_description). ",'" .
        date2sql($po_line->req_del_date) . "'," .
        db_escape($po_line->price) . ", " .
        db_escape($po_line->quantity). ")";
        db_query($sql, "One of the purchase order detail records could not be inserted");
        $po_obj->line_items[$line_no]->po_detail_rec = db_insert_id();
     }

    $Refs->save(ST_PURCHORDER, $po_obj->order_no, $po_obj->reference);

    add_audit_trail(ST_PURCHORDER, $po_obj->order_no, $po_obj->orig_order_date);
    hook_db_postwrite($po_obj, ST_PURCHORDER);
    commit_transaction();

    return $po_obj->order_no;
}

where can i find this value to display none  for the css? i can't find it anywhere  wanted to know where to find this html link in all pages for link back wanted to edit.

function hyperlink_back($center=true, $no_menu=true, $type_no=0, $trans_no=0, $final=false) ------> where to find this link for back.?
{
    global $path_to_root;

    if ($center)
        echo "<center>";
    $id = 0;    
    if ($no_menu && $trans_no != 0)
    {
        include_once($path_to_root."/admin/db/attachments_db.inc");
        $id = has_attachment($type_no, $trans_no);
        $attach = get_attachment_string($type_no, $trans_no);
        echo $attach;
    }
    $width = ($id != 0 ? "30%" : "20%");    
    start_table(false, "width='$width'");
    start_row();
    if ($no_menu)
    {
        echo "<td align=center><a href='javascript:window.print();'>"._("Print")."</a></td>\n";
    }    
    echo "<td align=center><a href='javascript:goBack(".($final ? '-3' : '').");'>".($no_menu ? _("Close") : _("Back"))."</a></td>\n";
    end_row();
    end_table();
    if ($center)
        echo "</center>";
    echo "<br>";
}

hello im trying to not display table_section 2 or 3 on po_entry_items.php since it not needed in my program but everytime i try to modify something  how to disabled the supplier_id with causing alot of errors like duplicate or make supplier input default  or any column from table_section 2 or 3 to have insert as default.

ERROR The default stock location set up for this user is not a currently defined stock location. Your system administrator needs to amend your user record. what is this im trying to hide this but i get error.

if (get_company_pref('use_dimension') == 2)
        dimensions_list_row(_('Dimension 2').':', 'dimension2', null, true, _('Default'), false, 2);
    /* locations_list_row(_("Receive Into:"), 'StkLocation', null, false, true, $order->fixed_asset); 
        hidden('fixed_asset', $order->fixed_asset); */

im trying to pass data from one page into the next but im having problems i don't know where to modify this code po_db.inc

trying to add another add_po from my po_inquiry_items and save them on to another page like pr_entry_items
where can i find button for this function to change from add_po into add_po_inquiry ---> po_inquiry_items ?, how do i pass the value from po_inquiry_items into my -----> pr_entry_items?.

function add_po(&$po_obj)
{
    global $Refs;

    begin_transaction();
    hook_db_prewrite($po_obj, ST_PURCHORDER);

     /*Insert to purchase order header record */
     $sql = "INSERT INTO ".TB_PREF."purch_orders (supplier_id, Comments, ord_date, reference,
         requisition_no, into_stock_location, delivery_address, total, tax_included, prep_amount) VALUES(";
     $sql .= db_escape($po_obj->supplier_id) . "," .
         db_escape($po_obj->Comments) . ",'" .
         date2sql($po_obj->orig_order_date) . "', " .
         db_escape($po_obj->reference) . ", " .
         db_escape($po_obj->supp_ref) . ", " .
         db_escape($po_obj->Location) . ", " .
         db_escape($po_obj->delivery_address) . ", " .
         db_escape($po_obj->get_trans_total()). ", " .
         db_escape($po_obj->tax_included). ", " .
         db_escape($po_obj->prep_amount). ")";

    db_query($sql, "The purchase order header record could not be inserted");

     /*Get the auto increment value of the order number created from the sql above */
     $po_obj->order_no = db_insert_id();

     /*Insert the purchase order detail records */
     foreach ($po_obj->line_items as $line_no => $po_line)
     {
        $sql = "INSERT INTO ".TB_PREF."purch_order_details (order_no, item_code, description, delivery_date,    unit_price,    quantity_ordered) VALUES (";
        $sql .= $po_obj->order_no . ", " . db_escape($po_line->stock_id). "," .
        db_escape($po_line->item_description). ",'" .
        date2sql($po_line->req_del_date) . "'," .
        db_escape($po_line->price) . ", " .
        db_escape($po_line->quantity). ")";
        db_query($sql, "One of the purchase order detail records could not be inserted");
        $po_obj->line_items[$line_no]->po_detail_rec = db_insert_id();
     }

    $Refs->save(ST_PURCHORDER, $po_obj->order_no, $po_obj->reference);

    add_audit_trail(ST_PURCHORDER, $po_obj->order_no, $po_obj->orig_order_date);
    hook_db_postwrite($po_obj, ST_PURCHORDER);
    commit_transaction();

    return $po_obj->order_no;
}