Exemplo n.º 1
0
function display_po_receive_items()
{
    div_start('grn_items');
    start_table(TABLESTYLE, "colspan=7 width='90%'");
    $th = array(_("Item Code"), _("Description"), _("Ordered"), _("Units"), _("Received"), _("Outstanding"), _("This Delivery"), _("Price"), _("Total"));
    table_header($th);
    /*show the line items on the order with the quantity being received for modification */
    $total = 0;
    $k = 0;
    //row colour counter
    if (count($_SESSION['PO']->line_items) > 0) {
        foreach ($_SESSION['PO']->line_items as $ln_itm) {
            alt_table_row_color($k);
            $qty_outstanding = $ln_itm->quantity - $ln_itm->qty_received;
            if (!isset($_POST['Update']) && !isset($_POST['ProcessGoodsReceived']) && $ln_itm->receive_qty == 0) {
                //If no quantites yet input default the balance to be received
                $ln_itm->receive_qty = $qty_outstanding;
            }
            $line_total = $ln_itm->receive_qty * $ln_itm->price;
            $total += $line_total;
            label_cell($ln_itm->stock_id);
            if ($qty_outstanding > 0) {
                text_cells(null, $ln_itm->stock_id . "Desc", $ln_itm->item_description, 30, 50);
            } else {
                label_cell($ln_itm->item_description);
            }
            $dec = get_qty_dec($ln_itm->stock_id);
            qty_cell($ln_itm->quantity, false, $dec);
            label_cell($ln_itm->units);
            qty_cell($ln_itm->qty_received, false, $dec);
            qty_cell($qty_outstanding, false, $dec);
            if ($qty_outstanding > 0) {
                qty_cells(null, $ln_itm->line_no, number_format2($ln_itm->receive_qty, $dec), "align=right", null, $dec);
            } else {
                label_cell(number_format2($ln_itm->receive_qty, $dec), "align=right");
            }
            amount_decimal_cell($ln_itm->price);
            amount_cell($line_total);
            end_row();
        }
    }
    $colspan = count($th) - 1;
    $display_sub_total = price_format($total);
    label_row(_("Sub-total"), $display_sub_total, "colspan={$colspan} align=right", "align=right");
    $taxes = $_SESSION['PO']->get_taxes(input_num('freight_cost'), true);
    $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['PO']->tax_included);
    $display_total = price_format($total + input_num('freight_cost') + $tax_total);
    start_row();
    label_cells(_("Amount Total"), $display_total, "colspan={$colspan} align='right'", "align='right'");
    end_row();
    end_table();
    div_end();
}
Exemplo n.º 2
0
$overdue_items = false;
foreach ($purchase_order->line_items as $stock_item) {
    $line_total = $stock_item->quantity * $stock_item->price;
    // if overdue and outstanding quantities, then highlight as so
    if ($stock_item->quantity - $stock_item->qty_received > 0 && date1_greater_date2(Today(), $stock_item->req_del_date)) {
        start_row("class='overduebg'");
        $overdue_items = true;
    } else {
        alt_table_row_color($k);
    }
    label_cell($stock_item->stock_id);
    label_cell($stock_item->item_description);
    $dec = get_qty_dec($stock_item->stock_id);
    qty_cell($stock_item->quantity, false, $dec);
    label_cell($stock_item->units);
    amount_decimal_cell($stock_item->price);
    label_cell($stock_item->req_del_date);
    amount_cell($line_total);
    qty_cell($stock_item->qty_received, false, $dec);
    qty_cell($stock_item->qty_inv, false, $dec);
    end_row();
    $total += $line_total;
}
$display_sub_tot = number_format2($total, user_price_dec());
label_row(_("Sub Total"), $display_sub_tot, "align=right colspan=6", "nowrap align=right", 2);
$taxes = $purchase_order->get_taxes();
$tax_total = display_edit_tax_items($taxes, 6, $purchase_order->tax_included, 2);
$display_total = price_format($total + $tax_total);
start_row();
label_cells(_("Amount Total"), $display_total, "colspan=6 align='right'", "align='right'");
label_cell('', "colspan=2");
Exemplo n.º 3
0
    set_focus('stock_id');
} else {
    $result = get_items_purchasing_data($_POST['stock_id']);
    div_start('price_table');
    if (db_num_rows($result) == 0) {
        display_note(_("There is no purchasing data set up for the part selected"));
    } else {
        start_table(TABLESTYLE, "width=65%");
        $th = array(_("Supplier"), _("Price"), _("Currency"), _("Supplier's Unit"), _("Conversion Factor"), _("Supplier's Description"), "", "");
        table_header($th);
        $k = $j = 0;
        //row colour counter
        while ($myrow = db_fetch($result)) {
            alt_table_row_color($k);
            label_cell($myrow["supp_name"]);
            amount_decimal_cell($myrow["price"]);
            label_cell($myrow["curr_code"]);
            label_cell($myrow["suppliers_uom"]);
            qty_cell($myrow['conversion_factor'], false, 'max');
            label_cell($myrow["supplier_description"]);
            edit_button_cell("Edit" . $myrow['supplier_id'], _("Edit"));
            delete_button_cell("Delete" . $myrow['supplier_id'], _("Delete"));
            end_row();
            $j++;
            if ($j == 12) {
                $j = 1;
                table_header($th);
            }
            //end of page full new headings
        }
        //end of while loop
Exemplo n.º 4
0
$k = 0;
$header_shown = false;
while ($adjustment = db_fetch($adjustment_items)) {
    if (!$header_shown) {
        $adjustment_type = get_movement_type($adjustment['person_id']);
        start_table(TABLESTYLE2, "width='90%'");
        start_row();
        label_cells(_("At Location"), $adjustment['location_name'], "class='tableheader2'");
        label_cells(_("Reference"), $adjustment['reference'], "class='tableheader2'", "colspan=6");
        label_cells(_("Date"), sql2date($adjustment['tran_date']), "class='tableheader2'");
        label_cells(_("Adjustment Type"), $adjustment_type['name'], "class='tableheader2'");
        end_row();
        comments_display_row(ST_INVADJUST, $trans_no);
        end_table();
        $header_shown = true;
        echo "<br>";
        start_table(TABLESTYLE, "width='90%'");
        $th = array(_("Item"), _("Description"), _("Quantity"), _("Units"), _("Unit Cost"));
        table_header($th);
    }
    alt_table_row_color($k);
    label_cell($adjustment['stock_id']);
    label_cell($adjustment['description']);
    qty_cell($adjustment['qty'], false, get_qty_dec($adjustment['stock_id']));
    label_cell($adjustment['units']);
    amount_decimal_cell($adjustment['standard_cost']);
    end_row();
}
end_table(1);
is_voided_display(ST_INVADJUST, $trans_no, _("This adjustment has been voided."));
end_page(true, false, false, ST_INVADJUST, $trans_no);