Example #1
0
            $_POST['loc_code'] = $myrow["loc_code"];
            $_POST['component'] = $myrow["component"];
            // by Tom Moulton
            $_POST['workcentre_added'] = $myrow["workcentre_added"];
            $_POST['quantity'] = number_format2($myrow["quantity"], get_qty_dec($myrow["component"]));
            label_row(_("Component:"), $myrow["component"] . " - " . $myrow["description"]);
        }
        hidden('selected_id', $selected_id);
    } else {
        start_row();
        label_cell(_("Component:"), "class='label'");
        echo "<td>";
        echo stock_component_items_list('component', $selected_parent, null, false, true);
        if (get_post('_component_update')) {
            $Ajax->activate('quantity');
        }
        echo "</td>";
        end_row();
    }
    hidden('stock_id', $selected_parent);
    locations_list_row(_("Location to Draw From:"), 'loc_code', null);
    workcenter_list_row(_("Work Centre Added:"), 'workcentre_added', null);
    $dec = get_qty_dec(get_post('component'));
    $_POST['quantity'] = number_format2(input_num('quantity', 1), $dec);
    qty_row(_("Quantity:"), 'quantity', null, null, null, $dec);
    end_table(1);
    submit_add_or_update_center($selected_id == -1, '', 'both');
    end_form();
}
// ----------------------------------------------------------------------------------
end_page();
    edit_button_cell("Edit" . $myrow['requisition_detail_id'], _("Edit"));
    delete_button_cell("Delete" . $myrow['requisition_detail_id'], _("Delete"));
    end_row();
}
end_table(1);
//-----------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing status code
        $myrow = get_requisition_detail($selected_id);
        $_POST['item_code'] = $myrow["item_code"];
        $_POST['purpose'] = $myrow["purpose"];
        $_POST['order_quantity'] = $myrow["order_quantity"];
        $_POST['estimate_price'] = $myrow["estimate_price"];
    }
    hidden('selected_id', $selected_id);
}
sales_local_items_list_row(_("Item :"), 'item_code', null, false, false);
text_row(_("Purpose :"), 'purpose', null, 50, 50);
$res = get_item_edit_info(get_post('item_code'));
$dec = $res["decimals"] == '' ? 0 : $res["decimals"];
$units = $res["units"] == '' ? _('kits') : $res["units"];
qty_row(_("Requisition Quantity:"), 'order_quantity', number_format2(1, $dec), '', $units, $dec);
amount_row(_("Estimate Price :"), 'estimate_price', null, null, null, 2);
hidden('requisitionid');
end_table(1);
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
//------------------------------------------------------------------------------------
end_page();
Example #3
0
    //end of page full new headings
}
//end of while loop
end_table();
div_end();
//-----------------------------------------------------------------------------------------------
if ($selected_id != '') {
    if ($Mode == 'Edit') {
        $myrow = get_item_code($selected_id);
        $_POST['item_code'] = $myrow["item_code"];
        $_POST['quantity'] = $myrow["quantity"];
        $_POST['description'] = $myrow["description"];
        $_POST['category_id'] = $myrow["category_id"];
    }
    hidden('selected_id', $selected_id);
} else {
    $_POST['quantity'] = 1;
    $_POST['description'] = $dflt_desc;
    $_POST['category_id'] = $dflt_cat;
}
echo "<br>";
start_table(TABLESTYLE2);
hidden('code_id', $selected_id);
text_row(_("UPC/EAN code:"), 'item_code', null, 20, 21);
qty_row(_("Quantity:"), 'quantity', null, '', $units, $dec);
text_row(_("Description:"), 'description', null, 50, 200);
stock_categories_list_row(_("Category:"), 'category_id', null);
end_table(1);
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
end_page();
Example #4
0
        $sql = "SELECT bom.*,stock_master.description FROM bom,stock_master\n\t\t\tWHERE id='{$selected_component}'\n\t\t\tAND stock_master.stock_id=bom.component";
        $result = db_query($sql, "could not get bom");
        $myrow = db_fetch($result);
        $_POST['loc_code'] = $myrow["loc_code"];
        $_POST['workcentre_added'] = $myrow["workcentre_added"];
        $_POST['quantity'] = qty_format($myrow["quantity"]);
        hidden('selected_parent', $selected_parent);
        hidden('selected_component', $selected_component);
        label_row(tr("Component:"), $myrow["component"] . " - " . $myrow["description"]);
    } else {
        //end of if $selected_component
        hidden('selected_parent', $selected_parent);
        start_row();
        label_cell(tr("Component:"));
        echo "<td>";
        stock_component_items_list('component', $selected_parent, $_POST['component'], false, true);
        echo "</td>";
        end_row();
    }
    locations_list_row(tr("Location to Draw From:"), 'loc_code', null);
    workcenter_list_row(tr("Work Centre Added:"), 'workcentre_added', null);
    if (!isset($_POST['quantity'])) {
        $_POST['quantity'] = qty_format(1);
    }
    qty_row(tr("Quantity:"), 'quantity', $_POST['quantity']);
    end_table(1);
    submit_center('Submit', tr("Add/Update"));
    end_form();
}
// ----------------------------------------------------------------------------------
end_page();
Example #5
0
    $myrow = get_item_code($selected_id);
    $_POST['component'] = $myrow["stock_id"];
    $_POST['quantity'] = number_format2($myrow["quantity"], get_qty_dec($myrow["stock_id"]));
}
hidden("selected_id", $selected_id);
sales_local_items_list_row(_("Component:"), 'component', null, false, true);
//	if (get_post('description') == '')
//		$_POST['description'] = get_kit_name($_POST['component']);
if (get_post('item_code') == '') {
    // new kit/alias
    if ($Mode != 'ADD_ITEM' && $Mode != 'UPDATE_ITEM') {
        $_POST['description'] = $props['description'];
        $_POST['category'] = $props['category_id'];
    }
    text_row(_("Description:"), 'description', null, 50, 200);
    stock_categories_list_row(_("Category:"), 'category', null);
}
$res = get_item_edit_info(get_post('component'));
$dec = $res["decimals"] == '' ? 0 : $res["decimals"];
$units = $res["units"] == '' ? _('kits') : $res["units"];
if (list_updated('component')) {
    $_POST['quantity'] = number_format2(1, $dec);
    $Ajax->activate('quantity');
    $Ajax->activate('category');
}
qty_row(_("Quantity:"), 'quantity', number_format2(1, $dec), '', $units, $dec);
end_table(1);
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
//----------------------------------------------------------------------------------
end_page();
Example #6
0
} else {
    stock_manufactured_items_list_row(tr("Item:"), 'stock_id', null);
    locations_list_row(tr("Destination Location:"), 'StockLocation', null);
}
if (!isset($_POST['quantity'])) {
    $_POST['quantity'] = qty_format(1);
}
if ($_POST['type'] == wo_types::advanced()) {
    qty_row(tr("Quantity Required:"), 'quantity', 12);
    if ($_POST['released']) {
        label_row(tr("Quantity Manufactured:"), qty_format($_POST['units_issued']));
    }
    date_row(tr("Date") . ":", 'date_');
    date_row(tr("Date Required By") . ":", 'RequDate', null, sys_prefs::default_wo_required_by());
} else {
    qty_row(tr("Quantity:"), 'quantity', 12);
    date_row(tr("Date") . ":", 'date_');
    hidden('RequDate', '');
    if (!isset($_POST['Costs'])) {
        $_POST['Costs'] = price_format(0);
    }
    amount_row(tr("Total Additional Costs:"), 'Costs');
}
if ($_POST['released']) {
    label_row(tr("Released On:"), $_POST['released_date']);
}
textarea_row(tr("Memo:"), 'memo_', null, 40, 5);
end_table(1);
submit_add_or_update_center(!isset($selected_id));
if (isset($selected_id)) {
    echo "<br><br><table align=center><tr>";