本文整理汇总了PHP中get_qty_dec函数的典型用法代码示例。如果您正苦于以下问题:PHP get_qty_dec函数的具体用法?PHP get_qty_dec怎么用?PHP get_qty_dec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_qty_dec函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: display_wo_issue_details
function display_wo_issue_details($issue_no)
{
$result = get_work_order_issue_details($issue_no);
if (db_num_rows($result) == 0) {
display_note(_("There are no items for this issue."));
} else {
start_table(TABLESTYLE);
$th = array(_("Component"), _("Quantity"), _("Units"));
table_header($th);
$j = 1;
$k = 0;
//row colour counter
$total_cost = 0;
while ($myrow = db_fetch($result)) {
alt_table_row_color($k);
label_cell($myrow["stock_id"] . " - " . $myrow["description"]);
qty_cell($myrow["qty_issued"], false, get_qty_dec($myrow["stock_id"]));
label_cell($myrow["units"]);
end_row();
$j++;
if ($j == 12) {
$j = 1;
table_header($th);
}
//end of page full new headings if
}
//end of while
end_table();
}
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:30,代码来源:wo_issue_view.php
示例2: print_bill_of_material
function print_bill_of_material()
{
global $path_to_root;
$frompart = $_POST['PARAM_0'];
$topart = $_POST['PARAM_1'];
$comments = $_POST['PARAM_2'];
$orientation = $_POST['PARAM_3'];
$destination = $_POST['PARAM_4'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$orientation = $orientation ? 'L' : 'P';
$cols = array(0, 50, 305, 375, 445, 515);
$headers = array(_('Component'), _('Description'), _('Loc'), _('Wrk Ctr'), _('Quantity'));
$aligns = array('left', 'left', 'left', 'left', 'right');
$params = array(0 => $comments, 1 => array('text' => _('Component'), 'from' => $frompart, 'to' => $topart));
$rep = new FrontReport(_('Bill of Material Listing'), "BillOfMaterial", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$res = getTransactions($frompart, $topart);
$parent = '';
while ($trans = db_fetch($res)) {
if ($parent != $trans['parent']) {
if ($parent != '') {
$rep->Line($rep->row - 2);
$rep->NewLine(2, 3);
}
$rep->TextCol(0, 1, $trans['parent']);
$desc = get_item($trans['parent']);
$rep->TextCol(1, 2, $desc['description']);
$parent = $trans['parent'];
$rep->NewLine();
}
$rep->NewLine();
$dec = get_qty_dec($trans['component']);
$rep->TextCol(0, 1, $trans['component']);
$rep->TextCol(1, 2, $trans['CompDescription']);
//$rep->TextCol(2, 3, $trans['loc_code']);
//$rep->TextCol(3, 4, $trans['workcentre_added']);
$wc = get_work_centre($trans['workcentre_added']);
$rep->TextCol(2, 3, get_location_name($trans['loc_code']));
$rep->TextCol(3, 4, $wc['name']);
$rep->AmountCol(4, 5, $trans['quantity'], $dec);
}
$rep->Line($rep->row - 4);
$rep->NewLine();
$rep->End();
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:54,代码来源:rep401.php
示例3: display_po_receive_items
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();
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:53,代码来源:po_receive_items.php
示例4: print_assets_list
function print_assets_list()
{
global $path_to_root;
$frompart = $_POST['PARAM_0'];
$topart = $_POST['PARAM_1'];
$comments = $_POST['PARAM_2'];
$destination = $_POST['PARAM_3'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$cols = array(0, 50, 305, 375, 445, 515);
$headers = array(_('Asset Type'), _('Asset name'), _('Serial Number'), _('Purchase Date'), _('Purchase Value'));
$aligns = array('left', 'left', 'left', 'left', 'right');
$params = array(0 => $comments, 1 => array('text' => _('Component'), 'from' => $frompart, 'to' => $topart));
$rep = new FrontReport(_('Assets Listing'), "AssetList", user_pagesize());
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$res = getTransactions($frompart, $topart);
$parent = '';
while ($trans = db_fetch($res)) {
if ($parent != $trans['asset_type_name']) {
if ($parent != '') {
$rep->Line($rep->row - 2);
$rep->NewLine(2, 3);
}
$rep->TextCol(0, 2, $trans['asset_type_name']);
$desc = get_item($trans['asset_type_name']);
$parent = $trans['asset_type_name'];
$rep->NewLine();
}
$rep->NewLine();
$dec = get_qty_dec($trans['asset_id']);
$rep->TextCol(0, 1, $trans['asset_type_name']);
$rep->TextCol(1, 2, $trans['asset_name']);
$rep->TextCol(2, 3, $trans['asset_serial']);
$rep->TextCol(3, 4, $trans['purchase_date']);
$rep->AmountCol(4, 5, $trans['purchase_value'], $dec);
}
$rep->Line($rep->row - 4);
$rep->NewLine();
$rep->End();
}
开发者ID:blestab,项目名称:frontaccounting,代码行数:45,代码来源:rep_assets_list.php
示例5: display_wo_production
function display_wo_production($prod_id)
{
$myrow = get_work_order_produce($prod_id);
br(1);
start_table(TABLESTYLE);
$th = array(_("Production #"), _("Reference"), _("For Work Order #"), _("Item"), _("Quantity Manufactured"), _("Date"));
table_header($th);
start_row();
label_cell($myrow["id"]);
label_cell($myrow["reference"]);
label_cell(get_trans_view_str(ST_WORKORDER, $myrow["workorder_id"]));
label_cell($myrow["stock_id"] . " - " . $myrow["StockDescription"]);
qty_cell($myrow["quantity"], false, get_qty_dec($myrow["stock_id"]));
label_cell(sql2date($myrow["date_"]));
end_row();
comments_display_row(ST_MANURECEIVE, $prod_id);
end_table(1);
is_voided_display(ST_MANURECEIVE, $prod_id, _("This production has been voided."));
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:19,代码来源:wo_production_view.php
示例6: display_kit_items
function display_kit_items($selected_kit)
{
$result = get_item_kit($selected_kit);
div_start('bom');
start_table(TABLESTYLE, "width='60%'");
$th = array(_("Stock Item"), _("Description"), _("Quantity"), _("Units"), '', '');
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
alt_table_row_color($k);
label_cell($myrow["stock_id"]);
label_cell($myrow["comp_name"]);
qty_cell($myrow["quantity"], false, $myrow["units"] == '' ? 0 : get_qty_dec($myrow["comp_name"]));
label_cell($myrow["units"] == '' ? _('kit') : $myrow["units"]);
edit_button_cell("Edit" . $myrow['id'], _("Edit"));
delete_button_cell("Delete" . $myrow['id'], _("Delete"));
end_row();
}
//END WHILE LIST LOOP
end_table();
div_end();
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:22,代码来源:sales_kits.php
示例7: display_bom_items
function display_bom_items($selected_parent)
{
$result = get_bom($selected_parent);
div_start('bom');
start_table(TABLESTYLE, "width=60%");
$th = array(_("Code"), _("Description"), _("Location"), _("Work Centre"), _("Quantity"), _("Units"), '', '');
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
alt_table_row_color($k);
label_cell($myrow["component"]);
label_cell($myrow["description"]);
label_cell($myrow["location_name"]);
label_cell($myrow["WorkCentreDescription"]);
qty_cell($myrow["quantity"], false, get_qty_dec($myrow["component"]));
label_cell($myrow["units"]);
edit_button_cell("Edit" . $myrow['id'], _("Edit"));
delete_button_cell("Delete" . $myrow['id'], _("Delete"));
end_row();
}
//END WHILE LIST LOOP
end_table();
div_end();
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:24,代码来源:bom_edit.php
示例8: print_po
function print_po()
{
global $path_to_root, $show_po_item_codes;
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$currency = $_POST['PARAM_2'];
$email = $_POST['PARAM_3'];
$comments = $_POST['PARAM_4'];
$orientation = $_POST['PARAM_5'];
if (!$from || !$to) {
return;
}
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$cols = array(4, 60, 225, 300, 340, 385, 450, 515);
// $headers in doctext.inc
$aligns = array('left', 'left', 'left', 'right', 'left', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_Pref('curr_default');
if ($email == 0) {
$rep = new FrontReport(_('PURCHASE ORDER'), "PurchaseOrderBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
for ($i = $from; $i <= $to; $i++) {
$myrow = get_po($i);
$baccount = get_default_bank_account($myrow['curr_code']);
$params['bankaccount'] = $baccount['id'];
if ($email == 1) {
$rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
$rep->title = _('PURCHASE ORDER');
$rep->filename = "PurchaseOrder" . $i . ".pdf";
}
$rep->SetHeaderType('Header2');
$rep->currency = $cur;
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
$contacts = get_supplier_contacts($myrow['supplier_id'], 'order');
$rep->SetCommonData($myrow, null, $myrow, $baccount, ST_PURCHORDER, $contacts);
$rep->NewPage();
$result = get_po_details($i);
$SubTotal = 0;
$items = $prices = array();
while ($myrow2 = db_fetch($result)) {
$data = get_purchase_data($myrow['supplier_id'], $myrow2['item_code']);
if ($data !== false) {
if ($data['supplier_description'] != "") {
$myrow2['description'] = $data['supplier_description'];
}
if ($data['suppliers_uom'] != "") {
$myrow2['units'] = $data['suppliers_uom'];
}
if ($data['conversion_factor'] != 1) {
$myrow2['unit_price'] = round2($myrow2['unit_price'] * $data['conversion_factor'], user_price_dec());
$myrow2['quantity_ordered'] = round2($myrow2['quantity_ordered'] / $data['conversion_factor'], user_qty_dec());
}
}
$Net = round2($myrow2["unit_price"] * $myrow2["quantity_ordered"], user_price_dec());
$prices[] = $Net;
$items[] = $myrow2['item_code'];
$SubTotal += $Net;
$dec2 = 0;
$DisplayPrice = price_decimal_format($myrow2["unit_price"], $dec2);
$DisplayQty = number_format2($myrow2["quantity_ordered"], get_qty_dec($myrow2['item_code']));
$DisplayNet = number_format2($Net, $dec);
if ($show_po_item_codes) {
$rep->TextCol(0, 1, $myrow2['item_code'], -2);
$rep->TextCol(1, 2, $myrow2['description'], -2);
} else {
$rep->TextCol(0, 2, $myrow2['description'], -2);
}
$rep->TextCol(2, 3, sql2date($myrow2['delivery_date']), -2);
$rep->TextCol(3, 4, $DisplayQty, -2);
$rep->TextCol(4, 5, $myrow2['units'], -2);
$rep->TextCol(5, 6, $DisplayPrice, -2);
$rep->TextCol(6, 7, $DisplayNet, -2);
$rep->NewLine(1);
if ($rep->row < $rep->bottomMargin + 15 * $rep->lineHeight) {
$rep->NewPage();
}
}
if ($myrow['comments'] != "") {
$rep->NewLine();
$rep->TextColLines(1, 5, $myrow['comments'], -2);
}
$DisplaySubTot = number_format2($SubTotal, $dec);
$rep->row = $rep->bottomMargin + 15 * $rep->lineHeight;
$doctype = ST_PURCHORDER;
$rep->TextCol(3, 6, _("Sub-total"), -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->NewLine();
$tax_items = get_tax_for_items($items, $prices, 0, $myrow['tax_group_id'], $myrow['tax_included'], null);
$first = true;
foreach ($tax_items as $tax_item) {
if ($tax_item['Value'] == 0) {
continue;
}
$DisplayTax = number_format2($tax_item['Value'], $dec);
//.........这里部分代码省略.........
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:101,代码来源:rep209.php
示例9: print_inventory_planning
function print_inventory_planning()
{
global $path_to_root;
$category = $_POST['PARAM_0'];
$location = $_POST['PARAM_1'];
$comments = $_POST['PARAM_2'];
$orientation = $_POST['PARAM_3'];
$destination = $_POST['PARAM_4'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$orientation = $orientation ? 'L' : 'P';
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
if ($location == ALL_TEXT) {
$location = 'all';
}
if ($location == 'all') {
$loc = _('All');
} else {
$loc = get_location_name($location);
}
$cols = array(0, 50, 150, 180, 210, 240, 270, 300, 330, 390, 435, 480, 525);
$per0 = strftime('%b', mktime(0, 0, 0, date('m'), 1, date('Y')));
$per1 = strftime('%b', mktime(0, 0, 0, date('m') - 1, 1, date('Y')));
$per2 = strftime('%b', mktime(0, 0, 0, date('m') - 2, 1, date('Y')));
$per3 = strftime('%b', mktime(0, 0, 0, date('m') - 3, 1, date('Y')));
$per4 = strftime('%b', mktime(0, 0, 0, date('m') - 4, 1, date('Y')));
$headers = array(_('Category'), '', $per4, $per3, $per2, $per1, $per0, '3*M', _('QOH'), _('Cust Ord'), _('Supp Ord'), _('Sugg Ord'));
$aligns = array('left', 'left', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), 2 => array('text' => _('Location'), 'from' => $loc, 'to' => ''));
$rep = new FrontReport(_('Inventory Planning Report'), "InventoryPlanning", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$res = getTransactions($category, $location);
$catt = '';
while ($trans = db_fetch($res)) {
if ($catt != $trans['cat_description']) {
if ($catt != '') {
$rep->Line($rep->row - 2);
$rep->NewLine(2, 3);
}
$rep->TextCol(0, 1, $trans['category_id']);
$rep->TextCol(1, 2, $trans['cat_description']);
$catt = $trans['cat_description'];
$rep->NewLine();
}
if ($location == 'all') {
$loc_code = "";
} else {
$loc_code = $location;
}
$custqty = get_demand_qty($trans['stock_id'], $loc_code);
$custqty += get_demand_asm_qty($trans['stock_id'], $loc_code);
$suppqty = get_on_porder_qty($trans['stock_id'], $loc_code);
$suppqty += get_on_worder_qty($trans['stock_id'], $loc_code);
$period = getPeriods($trans['stock_id'], $trans['loc_code']);
$rep->NewLine();
$dec = get_qty_dec($trans['stock_id']);
$rep->TextCol(0, 1, $trans['stock_id']);
$rep->TextCol(1, 2, $trans['description'] . ($trans['inactive'] == 1 ? " (" . _("Inactive") . ")" : ""), -1);
$rep->AmountCol(2, 3, $period['prd0'], $dec);
$rep->AmountCol(3, 4, $period['prd1'], $dec);
$rep->AmountCol(4, 5, $period['prd2'], $dec);
$rep->AmountCol(5, 6, $period['prd3'], $dec);
$rep->AmountCol(6, 7, $period['prd4'], $dec);
$MaxMthSales = Max($period['prd0'], $period['prd1'], $period['prd2'], $period['prd3']);
$IdealStockHolding = $MaxMthSales * 3;
$rep->AmountCol(7, 8, $IdealStockHolding, $dec);
$rep->AmountCol(8, 9, $trans['qty_on_hand'], $dec);
$rep->AmountCol(9, 10, $custqty, $dec);
$rep->AmountCol(10, 11, $suppqty, $dec);
$SuggestedTopUpOrder = $IdealStockHolding - $trans['qty_on_hand'] + $custqty - $suppqty;
if ($SuggestedTopUpOrder < 0.0) {
$SuggestedTopUpOrder = 0.0;
}
$rep->AmountCol(11, 12, $SuggestedTopUpOrder, $dec);
}
$rep->Line($rep->row - 4);
$rep->NewLine();
$rep->End();
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:94,代码来源:rep302.php
示例10: start_row
start_row();
label_cells(_("Item"), $from_trans['stock_id'] . " - " . $from_trans['description'], "class='tableheader2'");
label_cells(_("From Location"), $from_trans['location_name'], "class='tableheader2'");
label_cells(_("To Location"), $to_trans['location_name'], "class='tableheader2'");
end_row();
start_row();
label_cells(_("Reference"), $from_trans['reference'], "class='tableheader2'");
$adjustment_type = get_movement_type($from_trans['person_id']);
label_cells(_("Adjustment Type"), $adjustment_type['name'], "class='tableheader2'");
label_cells(_("Date"), sql2date($from_trans['tran_date']), "class='tableheader2'");
end_row();
comments_display_row(ST_LOCTRANSFER, $trans_no);
end_table(2);
start_table(TABLESTYLE, "width=90%");
$th = array(_("Item"), _("Description"), _("Quantity"), _("Units"));
table_header($th);
$transfer_items = get_stock_moves(ST_LOCTRANSFER, $trans_no);
$k = 0;
while ($item = db_fetch($transfer_items)) {
if ($item['loc_code'] == $to_trans['loc_code']) {
alt_table_row_color($k);
label_cell($item['stock_id']);
label_cell($item['description']);
qty_cell($item['qty'], false, get_qty_dec($item['stock_id']));
label_cell($item['units']);
end_row();
}
}
end_table(1);
is_voided_display(ST_LOCTRANSFER, $trans_no, _("This transfer has been voided."));
end_page(true, false, false, ST_LOCTRANSFER, $trans_no);
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:31,代码来源:view_transfer.php
示例11: work_order_produce
$close_wo = 1;
}
// if unassembling, negate quantity
if ($_POST['ProductionType'] == 0) {
$_POST['quantity'] = -$_POST['quantity'];
}
$id = work_order_produce($_POST['selected_id'], $_POST['ref'], input_num('quantity'), $_POST['date_'], $_POST['memo_'], $close_wo);
meta_forward($_SERVER['PHP_SELF'], "AddedID=" . $_POST['selected_id'] . "&date=" . $_POST['date_']);
}
//-------------------------------------------------------------------------------------
display_wo_details($_POST['selected_id']);
//-------------------------------------------------------------------------------------
start_form();
hidden('selected_id', $_POST['selected_id']);
//hidden('WOReqQuantity', $_POST['WOReqQuantity']);
$dec = get_qty_dec($wo_details["stock_id"]);
if (!isset($_POST['quantity']) || $_POST['quantity'] == '') {
$_POST['quantity'] = qty_format(max($wo_details["units_reqd"] - $wo_details["units_issued"], 0), $wo_details["stock_id"], $dec);
}
start_table(TABLESTYLE2);
br();
ref_row(_("Reference:"), 'ref', '', $Refs->get_next(29));
if (!isset($_POST['ProductionType'])) {
$_POST['ProductionType'] = 1;
}
yesno_list_row(_("Type:"), 'ProductionType', $_POST['ProductionType'], _("Produce Finished Items"), _("Return Items to Work Order"));
small_qty_row(_("Quantity:"), 'quantity', null, null, null, $dec);
date_row(_("Date:"), 'date_');
textarea_row(_("Memo:"), 'memo_', null, 40, 3);
end_table(1);
submit_center_first('Process', _("Process"), '', 'default');
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:31,代码来源:work_order_add_finished.php
示例12: inventory_movements
function inventory_movements()
{
global $path_to_root;
$from_date = $_POST['PARAM_0'];
$to_date = $_POST['PARAM_1'];
$category = $_POST['PARAM_2'];
$location = $_POST['PARAM_3'];
$comments = $_POST['PARAM_4'];
$orientation = $_POST['PARAM_5'];
$destination = $_POST['PARAM_6'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$orientation = $orientation ? 'L' : 'P';
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
if ($location == '') {
$loc = _('All');
} else {
$loc = get_location_name($location);
}
$cols = array(0, 60, 130, 160, 185, 215, 250, 275, 305, 340, 365, 395, 430, 455, 485, 520);
$headers = array(_('Category'), _('Description'), _('UOM'), '', '', _('OpeningStock'), '', '', _('StockIn'), '', '', _('Delivery'), '', '', _('ClosingStock'));
$headers2 = array("", "", "", _("QTY"), _("Rate"), _("Value"), _("QTY"), _("Rate"), _("Value"), _("QTY"), _("Rate"), _("Value"), _("QTY"), _("Rate"), _("Value"));
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right', 'right');
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from_date, 'to' => $to_date), 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), 3 => array('text' => _('Location'), 'from' => $loc, 'to' => ''));
$rep = new FrontReport(_('Costed Inventory Movements'), "CostedInventoryMovements", user_pagesize(), 8, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers2, $aligns, $cols, $headers, $aligns);
$rep->NewPage();
$totval_open = $totval_in = $totval_out = $totval_close = 0;
$result = fetch_items($category);
$dec = user_price_dec();
$catgor = '';
while ($myrow = db_fetch($result)) {
if ($catgor != $myrow['description']) {
$rep->NewLine(2);
$rep->fontSize += 2;
$rep->TextCol(0, 3, $myrow['category_id'] . " - " . $myrow['description']);
$catgor = $myrow['description'];
$rep->fontSize -= 2;
$rep->NewLine();
}
$rep->NewLine();
$rep->TextCol(0, 1, $myrow['stock_id']);
$rep->TextCol(1, 2, $myrow['name']);
$rep->TextCol(2, 3, $myrow['units']);
$qoh_start = get_qoh_on_date($myrow['stock_id'], $location, add_days($from_date, -1));
$qoh_end = get_qoh_on_date($myrow['stock_id'], $location, $to_date);
$inward = trans_qty($myrow['stock_id'], $location, $from_date, $to_date);
$outward = trans_qty($myrow['stock_id'], $location, $from_date, $to_date, false);
$openCost = avg_unit_cost($myrow['stock_id'], $location, $from_date);
$unitCost = avg_unit_cost($myrow['stock_id'], $location, add_days($to_date, 1));
$rep->AmountCol(3, 4, $qoh_start, get_qty_dec($myrow['stock_id']));
$rep->AmountCol(4, 5, $openCost, $dec);
$openCost *= $qoh_start;
$totval_open += $openCost;
$rep->AmountCol(5, 6, $openCost);
if ($inward > 0) {
$rep->AmountCol(6, 7, $inward, get_qty_dec($myrow['stock_id']));
$unitCost_in = trans_qty_unit_cost($myrow['stock_id'], $location, $from_date, $to_date);
$rep->AmountCol(7, 8, $unitCost_in, $dec);
$unitCost_in *= $inward;
$totval_in += $unitCost_in;
$rep->AmountCol(8, 9, $unitCost_in);
}
if ($outward > 0) {
$rep->AmountCol(9, 10, $outward, get_qty_dec($myrow['stock_id']));
$unitCost_out = trans_qty_unit_cost($myrow['stock_id'], $location, $from_date, $to_date, false);
$rep->AmountCol(10, 11, $unitCost_out, $dec);
$unitCost_out *= $outward;
$totval_out += $unitCost_out;
$rep->AmountCol(11, 12, $unitCost_out);
}
$rep->AmountCol(12, 13, $qoh_end, get_qty_dec($myrow['stock_id']));
$rep->AmountCol(13, 14, $unitCost, $dec);
$unitCost *= $qoh_end;
$totval_close += $unitCost;
$rep->AmountCol(14, 15, $unitCost);
$rep->NewLine(0, 1);
}
$rep->Line($rep->row - 4);
$rep->NewLine(2);
$rep->TextCol(0, 1, _("Total"));
$rep->AmountCol(5, 6, $totval_open);
$rep->AmountCol(8, 9, $totval_in);
$rep->AmountCol(11, 12, $totval_out);
$rep->AmountCol(14, 15, $totval_close);
$rep->Line($rep->row - 4);
//.........这里部分代码省略.........
开发者ID:nativebandung,项目名称:frontaccounting,代码行数:101,代码来源:rep308.php
示例13: while
$sub_total = 0;
while ($myrow2 = db_fetch($result)) {
if ($myrow2["quantity"] == 0) {
continue;
}
alt_table_row_color($k);
$value = round2((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"], user_price_dec());
$sub_total += $value;
if ($myrow2["discount_percent"] == 0) {
$display_discount = "";
} else {
$display_discount = percent_format($myrow2["discount_percent"] * 100) . "%";
}
label_cell($myrow2["stock_id"]);
label_cell($myrow2["StockDescription"]);
qty_cell($myrow2["quantity"], false, get_qty_dec($myrow2["stock_id"]));
label_cell($myrow2["units"], "align=right");
amount_cell($myrow2["unit_price"]);
label_cell($display_discount, "nowrap align=right");
amount_cell($value);
end_row();
}
//end while there are line items to print out
$display_sub_tot = price_format($sub_total);
label_row(_("Sub-total"), $display_sub_tot, "colspan=6 align=right", "nowrap align=right width=15%");
} else {
display_note(_("There are no line items on this invoice."), 1, 2);
}
$display_freight = price_format($myrow["ov_freight"]);
/*Print out the invoice text entered */
label_row(_("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right");
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:31,代码来源:view_invoice.php
示例14: print_purchases_cost
function print_purchases_cost()
{
global $path_to_root;
$from = $_POST['PARAM_0'];
$destination = $_POST['PARAM_1'];
$orientation = $_POST['PARAM_2'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$dec = user_price_dec();
if ($category == ALL_NUMERIC) {
$category = 0;
}
if ($category == 0) {
$cat = _('All');
} else {
$cat = get_category_name($category);
}
$cols = array(0, 50, 100, 150, 200, 250, 300, 350);
$headers = array(_('Invoice'), _('Client Name'), _('IMC'), _('Charge'), _('Sales'), _('Date of'));
//$header2 = array(_('Date'), '', '', _('Invoice'), _('Amount'), _('Credit Memo'), _('Memo No.'), _(' Return'), _('%'), _('%'), _('Sales'), _('Provisional Receipt'), _('Receipt No.'), _('Payment'), _('Remittance'), _('Commission'), _('Percentage'), '', _('W/holding Tax'), _('Commission'));
$aligns = array('left', 'left', 'left', 'left');
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''));
$rep = new FrontReport(_('Summary of Purchases at Cost Report'), "SummaryPurchasesCostReport", user_pagesize(), 8, 'L');
$rep->Font();
$rep->Info($params, $cols, $header2, $aligns);
$rep->NewPage();
$res = getTransactions($category, $from, $to);
$total = $grandtotal = 0.0;
$total1 = $grandtotal1 = 0.0;
$total2 = $grandtotal2 = 0.0;
$catt = '';
while ($trans = db_fetch($res)) {
if ($catt != $trans['cat_description']) {
if ($catt != '') {
$rep->NewLine(2, 3);
$rep->TextCol(0, 4, _('Total'));
$rep->AmountCol(4, 5, $total, $dec);
$rep->Line($rep->row - 2);
$rep->NewLine();
$rep->NewLine();
$total = $total1 = $total2 = 0.0;
}
$rep->TextCol(0, 1, $trans['category_id']);
$rep->TextCol(1, 7, $trans['cat_description']);
$catt = $trans['cat_description'];
$rep->NewLine();
}
$rep->NewLine();
$rep->fontSize -= 2;
$rep->TextCol(0, 1, $trans['stock_id']);
$rep->TextCol(1, 2, $trans['description']);
$rep->AmountCol(2, 3, $trans['quantity'], get_qty_dec($trans['stock_id']));
$rep->AmountCol(3, 4, $trans['unit_price'], $dec);
$rep->AmountCol(4, 5, $trans['quantity'] * $trans['unit_price'], $dec);
if ($trans['unit_price'] == 0) {
$rep->TextCol(6, 7, _('Gift'));
}
$rep->fontSize += 2;
$total += $trans['quantity'] * $trans['unit_price'];
$grandtotal += $trans['quantity'] * $trans['unit_price'];
}
$rep->NewLine(2, 3);
$rep->TextCol(0, 4, _('Total'));
$rep->AmountCol(4, 5, $total, $dec);
$rep->Line($rep->row - 2);
$rep->NewLine();
$rep->NewLine(2, 1);
$rep->TextCol(0, 4, _('Grand Total'));
$rep->AmountCol(4, 5, $grandtotal, $dec);
$rep->Line($rep->row - 4);
$rep->NewLine();
$rep->End();
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:76,代码来源:rep_purchases_cost_summary.php
示例15: list
if ($q_class === 'skip') {
continue;
}
if (is_array($q_class)) {
list($ln_itm->qty_dispatched, $row_classes) = $q_class;
$has_marked = true;
}
}
alt_table_row_color($k, $row_classes);
view_stock_status_cell($ln_itm->stock_id);
if ($ln_itm->descr_editable) {
text_cells(null, 'Line' . $line . '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_done, false, $dec);
if (isset($_POST['clear_quantity'])) {
$ln_itm->qty_dispatched = 0;
}
$_POST['Line' . $line] = $ln_itm->qty_dispatched;
/// clear post so value displayed in the fiel is the 'new' quantity
small_qty_cells(null, 'Line' . $line, qty_format($ln_itm->qty_dispatched, $ln_itm->stock_id, $dec), null, null, $dec);
$display_discount_percent = percent_format($ln_itm->discount_percent * 100) . "%";
$line_total = $ln_itm->qty_dispatched * $ln_itm->price * (1 - $ln_itm->discount_percent);
amount_cell($ln_itm->price);
label_cell($ln_itm->tax_type_name);
label_cell($display_discount_percent, "nowrap align=right");
amount_cell($line_total);
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:31,代码来源:customer_delivery.php
示例16: while
$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);
开发者ID:M-Shahbaz,项目名称:FA,代码行数:31,代码来源:view_adjustment.php
示例17: display_credit_items
function display_credit_items()
{
start_form();
hidden('cart_id');
start_table(TABLESTYLE2, "width=80%", 5);
echo "<tr><td>";
// outer table
start_table(TABLESTYLE, "width=100%");
start_row();
label_cells(_("Customer"), $_SESSION['Items']->customer_name, "class='tableheader2'");
label_cells(_("Branch"), get_branch_name($_SESSION['Items']->Branch), "class='tableheader2'");
label_cells(_("Currency"), $_SESSION['Items']->customer_currency, "class='tableheader2'");
end_row();
start_row();
// if (!isset($_POST['ref']))
// $_POST['ref'] = $Refs->get_next(11);
if ($_SESSION['Items']->trans_no == 0) {
ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'");
} else {
label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
}
label_cells(_("Crediting Invoice"), get_customer_trans_view_str(ST_SALESINVOICE, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'");
if (!isset($_POST['ShipperID'])) {
$_POST['ShipperID'] = $_SESSION['Items']->ship_via;
}
label_cell(_("Shipping Company"), "class='tableheader2'");
shippers_list_cells(null, 'ShipperID', $_POST['ShipperID']);
// if (!isset($_POST['sales_type_id']))
// $_POST['sales_type_id'] = $_SESSION['Items']->sales_type;
// label_cell(_("Sales Type"), "class='tableheader2'");
// sales_types_list_cells(null, 'sales_type_id', $_POST['sales_type_id']);
end_row();
end_table();
echo "</td><td>";
// outer table
start_table(TABLESTYLE, "width=100%");
if ($_SESSION['Items']->custom_num != '') {
text_row(_("Credit Memo No."), 'custom_num', $_SESSION['Items']->custom_num, null, "class='tableheader2'");
} else {
text_row(_("Credit Memo No."), 'custom_num', '', null, "class='tableheader2'");
}
//moodlearning
label_row(_("Invoice Date"), $_SESSION['Items']->src_date, "class='tableheader2'");
date_row(_("Credit Note Date"), 'CreditDate', '', $_SESSION['Items']->trans_no == 0, 0, 0, 0, "class='tableheader2'");
end_table();
echo "</td></tr>";
end_table(1);
// outer table
div_start('credit_items');
start_table(TABLESTYLE, "width=80%");
$th = array(_("Item Code"), _("Item Description"), _("Invoiced Quantity"), _("Units"), _("Credited"), _("Credit Quantity"), _("Price"), _("Discount %"), _("Total"));
//Karen edited Credited
table_header($th);
$k = 0;
//row colour counter
foreach ($_SESSION['Items']->line_items as $line_no => $ln_itm) {
if ($ln_itm->quantity == $ln_itm->qty_done) {
continue;
// this line was fully credited/removed
}
alt_table_row_color($k);
// view_stock_status_cell($ln_itm->stock_id); alternative view
label_cell($ln_itm->stock_id);
text_cells(null, 'Line' . $line_no . 'Desc', $ln_itm->item_description, 30, 50);
$dec = get_qty_dec($ln_itm->stock_id);
qty_cell($ln_itm->quantity, false, $dec);
label_cell($ln_itm->units);
label_cell($ln_itm->qty_done);
//Karen edited
amount_cells(null, 'Line' . $line_no, number_format2($ln_itm->qty_dispatched, $dec), null, null, $dec);
$line_total = $ln_itm->qty_dispatched * $ln_itm->price * (1 - $ln_itm->discount_percent);
amount_cell($ln_itm->price);
percent_cell($ln_itm->discount_percent * 100);
amount_cell($line_total);
end_row();
}
if (!check_num('ChargeFreightCost')) {
$_POST['ChargeFreightCost'] = price_format($_SESSION['Items']->freight_cost);
}
$colspan = 8;
//Karen edited 7
star
|
请发表评论