Beispiel #1
0
function edit_allocations_for_transaction($type, $trans_no)
{
    global $systypes_array;
    $cart = $_SESSION['alloc'];
    display_heading(sprintf(_("Allocation of %s # %d"), $systypes_array[$cart->type], $cart->trans_no));
    display_heading($cart->person_name);
    display_heading2(_("Date:") . " <b>" . $cart->date_ . "</b>");
    display_heading2(_("Total:") . " <b>" . price_format($cart->bank_amount) . ' ' . $cart->currency . "</b>");
    if ($cart->currency != $cart->person_curr) {
        $total = _("Total in clearing currency:") . " <b>" . price_format($cart->amount) . "</b>" . sprintf(" %s (%s %s/%s)", $cart->person_curr, exrate_format($cart->bank_amount / $cart->amount), $cart->currency, $cart->person_curr);
        display_heading2($total);
    }
    echo "<br>";
    start_form();
    div_start('alloc_tbl');
    if (count($cart->allocs) > 0) {
        show_allocatable(true);
        submit_center_first('UpdateDisplay', _("Refresh"), _('Start again allocation of selected amount'), true);
        submit('Process', _("Process"), true, _('Process allocations'), 'default');
        submit_center_last('Cancel', _("Back to Allocations"), _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    } else {
        display_note(_("There are no unsettled transactions to allocate."), 0, 1);
        submit_center('Cancel', _("Back to Allocations"), true, _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    }
    div_end();
    end_form();
}
Beispiel #2
0
function subpage_title($txt)
{
    global $path_to_root;
    echo '<center><img src="' . $path_to_root . '/themes/default/images/logo_frontaccounting.png" width="250" height="50" alt="Logo" />
		</center>';
    $page = @$_POST['Page'] ? $_POST['Page'] : 1;
    display_heading($page == 6 ? $txt : _("FrontAccouting ERP Installation Wizard") . '<br>' . sprintf(_('Step %d: %s'), $page, $txt));
    br();
}
Beispiel #3
0
function subpage_title($txt)
{
    global $path_to_root;
    echo '<center><img src="' . $path_to_root . '/themes/erp/images/logo.png" width="413" height="97" alt="Logo" />
		</center>';
    $page = @$_POST['Page'] ? $_POST['Page'] : 1;
    display_heading($page == 6 ? $txt : _("SerbizHub Suite ERP Installation Wizard") . '<br>' . sprintf(_('Step %d: %s'), $page, $txt));
    br();
}
Beispiel #4
0
 function render($id, $title)
 {
     global $path_to_root;
     if (!isset($this->top)) {
         $this->top = 10;
     }
     global $path_to_root;
     $pg = new graph();
     $begin = begin_fiscalyear();
     $today = Today();
     $begin1 = date2sql($begin);
     $today1 = date2sql($today);
     $sql = "SELECT SUM(-t.amount) AS total, d.reference, d.name FROM\n            " . TB_PREF . "gl_trans AS t," . TB_PREF . "dimensions AS d WHERE\n            (t.dimension_id = d.id OR t.dimension2_id = d.id) AND\n            t.tran_date >= '{$begin1}' AND t.tran_date <= '{$today1}' ";
     if ($this->data_filter != '') {
         $sql .= ' AND ' . $this->data_filter;
     }
     $sql .= "GROUP BY d.id ORDER BY total DESC LIMIT " . $this->top;
     $result = db_query($sql, "Transactions could not be calculated");
     if ($this->graph_type == 'Table') {
         $title = _("Top 10 Dimensions in fiscal year");
         br(2);
         display_heading($title);
         br();
         $th = array(_("Dimension"), _("Amount"));
         start_table(TABLESTYLE, "width=98%");
         table_header($th);
         $k = 0;
         //row colour counter
         while ($myrow = db_fetch($result)) {
             alt_table_row_color($k);
             label_cell($myrow['reference'] . " " . $myrow["name"]);
             amount_cell($myrow['total']);
             end_row();
         }
         end_table(2);
     } else {
         $pg = new graph();
         $i = 0;
         while ($myrow = db_fetch($result)) {
             $pg->x[$i] = $myrow['reference'] . " " . $myrow["name"];
             $pg->y[$i] = abs($myrow['total']);
             $i++;
         }
         $pg->title = $title;
         $pg->axis_x = _("Dimension");
         $pg->axis_y = _("Amount");
         $pg->graphic_1 = $today;
         $pg->type = 5;
         $pg->skin = 1;
         $pg->built_in = false;
         $filename = company_path() . "/pdf_files/" . uniqid("") . ".png";
         $pg->display($filename, true);
         echo "<img src='{$filename}' border='0' alt='{$title}' style='max-width:100%'>";
     }
 }
function edit_allocations_for_transaction($type, $trans_no)
{
    global $systypes_array;
    start_form();
    display_heading(_("Allocation of") . " " . $systypes_array[$_SESSION['alloc']->type] . " # " . $_SESSION['alloc']->trans_no);
    display_heading($_SESSION['alloc']->person_name);
    display_heading2(_("Date:") . " <b>" . $_SESSION['alloc']->date_ . "</b>");
    display_heading2(_("Total:") . " <b>" . price_format(-$_SESSION['alloc']->amount) . "</b>");
    echo "<br>";
    div_start('alloc_tbl');
    if (count($_SESSION['alloc']->allocs) > 0) {
        show_allocatable(true);
        submit_center_first('UpdateDisplay', _("Refresh"), _('Start again allocation of selected amount'), true);
        submit('Process', _("Process"), true, _('Process allocations'), 'default');
        submit_center_last('Cancel', _("Back to Allocations"), _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    } else {
        display_note(_("There are no unsettled transactions to allocate."), 0, 1);
        submit_center('Cancel', _("Back to Allocations"), true, _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    }
    div_end();
    end_form();
}
Beispiel #6
0
 function render($id, $title)
 {
     global $path_to_root;
     include_once $path_to_root . "/includes/ui.inc";
     if (!defined('FLOAT_COMP_DELTA')) {
         define('FLOAT_COMP_DELTA', 0.004);
     }
     $today = date2sql(Today());
     $sql = "SELECT trans.trans_no, trans.reference, trans.tran_date, trans.due_date, debtor.debtor_no,\n            debtor.name, branch.br_name, debtor.curr_code,\n            (trans.ov_amount + trans.ov_gst + trans.ov_freight\n                + trans.ov_freight_tax + trans.ov_discount) AS total,\n            (trans.ov_amount + trans.ov_gst + trans.ov_freight\n                + trans.ov_freight_tax + trans.ov_discount - trans.alloc) AS remainder,\n            DATEDIFF('{$today}', trans.due_date) AS days\n            FROM " . TB_PREF . "debtor_trans as trans, " . TB_PREF . "debtors_master as debtor,\n                " . TB_PREF . "cust_branch as branch\n            WHERE debtor.debtor_no = trans.debtor_no AND trans.branch_code = branch.branch_code\n                AND trans.type = " . ST_SALESINVOICE . " AND (trans.ov_amount + trans.ov_gst + trans.ov_freight\n                + trans.ov_freight_tax + trans.ov_discount - trans.alloc) > " . FLOAT_COMP_DELTA . "\n                AND DATEDIFF('{$today}', trans.due_date) > 0 ORDER BY days DESC";
     if ($this->data_filter != '') {
         $sql .= ' AND ' . $this->data_filter;
     }
     $result = db_query($sql);
     $title = db_num_rows($result) . _(" Overdue Sales Invoices");
     br(1);
     display_heading($title);
     br();
     $th = array("#", _("Date"), _("Due Date"), _("Customer"), _("Currency"), _("Total"), _("Remainder"), _("Days"));
     start_table(TABLESTYLE, "width=98%");
     table_header($th);
     $k = 0;
     //row colour counter
     while ($myrow = db_fetch($result)) {
         alt_table_row_color($k);
         label_cell(get_trans_view_str(ST_SALESINVOICE, $myrow["trans_no"]));
         label_cell(sql2date($myrow['tran_date']));
         label_cell(sql2date($myrow['due_date']));
         $name = $myrow["debtor_no"] . " " . $myrow["name"];
         label_cell($name);
         label_cell($myrow['curr_code']);
         amount_cell($myrow['total']);
         amount_cell($myrow['remainder']);
         label_cell($myrow['days'], "align='right'");
         end_row();
     }
     end_table(1);
 }
Beispiel #7
0
<?php

$page_security = 2;
$path_to_root = "../..";
include $path_to_root . "/purchasing/includes/po_class.inc";
include $path_to_root . "/includes/session.inc";
page(tr("View Purchase Order Delivery"), true);
include $path_to_root . "/purchasing/includes/purchasing_ui.inc";
if (!isset($_GET['trans_no'])) {
    die("<BR>" . tr("This page must be called with a Purchase Order Delivery number to review."));
}
$purchase_order = new purch_order();
read_grn($_GET["trans_no"], $purchase_order);
display_heading(tr("Purchase Order Delivery") . " #" . $_GET['trans_no']);
echo "<BR>";
display_grn_summary($purchase_order);
display_heading2(tr("Line Details"));
start_table("colspan=9 {$table_style} width=90%");
$th = array(tr("Item Code"), tr("Item Description"), tr("Delivery Date"), tr("Quantity"), tr("Unit"), tr("Price"), tr("Line Total"), tr("Quantity Invoiced"));
table_header($th);
$total = 0;
$k = 0;
//row colour counter
foreach ($purchase_order->line_items as $stock_item) {
    $line_total = $stock_item->qty_received * $stock_item->price;
    alt_table_row_color($k);
    label_cell($stock_item->stock_id);
    label_cell($stock_item->item_description);
    label_cell($stock_item->req_del_date, "nowrap align=right");
    qty_cell($stock_item->qty_received);
    label_cell($stock_item->units);
Beispiel #8
0
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_SUPPTRANSVIEW';
$path_to_root = "../..";
include $path_to_root . "/purchasing/includes/po_class.inc";
include $path_to_root . "/includes/session.inc";
include $path_to_root . "/purchasing/includes/purchasing_ui.inc";
$js = "";
if ($use_popup_windows) {
    $js .= get_js_open_window(900, 500);
}
page(_($help_context = "View Purchase Order"), true, false, "", $js);
if (!isset($_GET['trans_no'])) {
    die("<br>" . _("This page must be called with a purchase order number to review."));
}
display_heading(_("Purchase Order") . " #" . $_GET['trans_no']);
$purchase_order = new purch_order();
read_po($_GET['trans_no'], $purchase_order);
echo "<br>";
display_po_summary($purchase_order, true);
start_table(TABLESTYLE, "width='90%'", 6);
echo "<tr><td valign=top>";
// outer table
display_heading2(_("Line Details"));
start_table(TABLESTYLE, "width='100%'");
$th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), _("Price"), _("Requested By"), _("Line Total"), _("Quantity Received"), _("Quantity Invoiced"));
table_header($th);
$total = $k = 0;
$overdue_items = false;
foreach ($purchase_order->line_items as $stock_item) {
    $line_total = $stock_item->quantity * $stock_item->price;
$th = array(_("Reconcile Date"), _("Beginning<br>Balance"), _("Ending<br>Balance"), _("Account<br>Total"), _("Reconciled<br>Amount"), _("Difference"));
table_header($th);
start_row();
date_cells("", "reconcile_date", _('Date of bank statement to reconcile'), get_post('bank_date') == '', 0, 0, 0, null, true);
amount_cells_ex("", "beg_balance", 15);
amount_cells_ex("", "end_balance", 15);
$reconciled = input_num('reconciled');
$difference = input_num("end_balance") - input_num("beg_balance") - $reconciled;
amount_cell($total);
amount_cell($reconciled, false, '', "reconciled");
amount_cell($difference, false, '', "difference");
end_row();
end_table();
div_end();
echo "<hr>";
//------------------------------------------------------------------------------------------------
if (!isset($_POST['bank_account'])) {
    $_POST['bank_account'] = "";
}
$sql = get_sql_for_bank_account_reconcile($_POST['bank_account'], get_post('reconcile_date'));
$act = get_bank_account($_POST["bank_account"]);
display_heading($act['bank_account_name'] . " - " . $act['bank_curr_code']);
$cols = array(_("Type") => array('fun' => 'systype_name', 'ord' => ''), _("#") => array('fun' => 'trans_view', 'ord' => ''), _("Reference"), _("Date") => 'date', _("Debit") => array('align' => 'right', 'fun' => 'fmt_debit'), _("Credit") => array('align' => 'right', 'insert' => true, 'fun' => 'fmt_credit'), _("Person/Item") => array('fun' => 'fmt_person'), array('insert' => true, 'fun' => 'gl_view'), "X" => array('insert' => true, 'fun' => 'rec_checkbox'));
$table =& new_db_pager('trans_tbl', $sql, $cols);
$table->width = "80%";
display_db_pager($table);
br(1);
submit_center('Reconcile', _("Reconcile"), true, '', null);
end_form();
//------------------------------------------------------------------------------------------------
end_page();
Beispiel #10
0
            $_POST[$line->line_no] = qty_format(0);
        }
        if (!isset($_POST['DefaultReceivedDate']) || $_POST['DefaultReceivedDate'] == "") {
            $_POST['DefaultReceivedDate'] = Today();
        }
        $_SESSION['PO']->line_items[$line->line_no]->receive_qty = input_num($line->line_no);
        if (isset($_POST[$line->stock_id . "Desc"]) && strlen($_POST[$line->stock_id . "Desc"]) > 0) {
            $_SESSION['PO']->line_items[$line->line_no]->item_description = $_POST[$line->stock_id . "Desc"];
        }
    }
}
//--------------------------------------------------------------------------------------------------
if (isset($_POST['ProcessGoodsReceived'])) {
    process_receive_po();
}
//--------------------------------------------------------------------------------------------------
start_form(false, true);
display_grn_summary($_SESSION['PO'], true);
display_heading(tr("Items to Receive"));
display_po_receive_items();
echo "<br><center>";
submit('Update', tr("Update"));
echo "&nbsp";
submit('ProcessGoodsReceived', tr("Process Receive Items"));
echo "</center>";
end_form();
//--------------------------------------------------------------------------------------------------
end_page();
?>

Beispiel #11
0
include_once $path_to_root . "/purchasing/includes/purchasing_db.inc";
include_once $path_to_root . "/includes/session.inc";
include_once $path_to_root . "/purchasing/includes/purchasing_ui.inc";
$js = "";
if ($use_popup_windows) {
    $js .= get_js_open_window(900, 500);
}
page(_($help_context = "View Supplier Credit Note"), true, false, "", $js);
if (isset($_GET["trans_no"])) {
    $trans_no = $_GET["trans_no"];
} elseif (isset($_POST["trans_no"])) {
    $trans_no = $_POST["trans_no"];
}
$supp_trans = new supp_trans(ST_SUPPCREDIT);
read_supp_invoice($trans_no, ST_SUPPCREDIT, $supp_trans);
display_heading("<font color=red>" . _("SUPPLIER CREDIT NOTE") . " # " . $trans_no . "</font>");
echo "<br>";
start_table(TABLESTYLE, "width=95%");
start_row();
label_cells(_("Supplier"), $supp_trans->supplier_name, "class='tableheader2'");
label_cells(_("Reference"), $supp_trans->reference, "class='tableheader2'");
label_cells(_("Supplier's Reference"), $supp_trans->supp_reference, "class='tableheader2'");
end_row();
start_row();
label_cells(_("Invoice Date"), $supp_trans->tran_date, "class='tableheader2'");
label_cells(_("Due Date"), $supp_trans->due_date, "class='tableheader2'");
label_cells(_("Currency"), get_supplier_currency($supp_trans->supplier_id), "class='tableheader2'");
end_row();
comments_display_row(ST_SUPPCREDIT, $trans_no);
end_table(1);
$total_gl = display_gl_items($supp_trans, 3);
//---------
start_row();
date_cells(_("Invoice Dead-line"), 'due_date', '', null, 0, 0, 0, "class='tableheader2'");
end_row();
end_table();
echo "</td></tr>";
end_table(1);
// outer table
$row = get_customer_to_order($_SESSION['Items']->customer_id);
if ($row['dissallow_invoices'] == 1) {
    display_error(_("The selected customer account is currently on hold. Please contact the credit control personnel to discuss."));
    end_form();
    end_page();
    exit;
}
display_heading(_("Delivery Items"));
div_start('Items');
start_table(TABLESTYLE, "width=80%");
$new = $_SESSION['Items']->trans_no == 0;
$th = array(_("Item Code"), _("Item Description"), $new ? _("Ordered") : _("Max. delivery"), _("Units"), $new ? _("Delivered") : _("Invoiced"), _("This Delivery"), _("Price"), _("Tax Type"), _("Discount"), _("Total"));
table_header($th);
$k = 0;
$has_marked = false;
foreach ($_SESSION['Items']->line_items as $line => $ln_itm) {
    if ($ln_itm->quantity == $ln_itm->qty_done) {
        continue;
        //this line is fully delivered
    }
    if (isset($_POST['_Location_update']) || isset($_POST['clear_quantity']) || isset($_POST['reset_quantity'])) {
        // reset quantity
        $ln_itm->qty_dispatched = $ln_itm->quantity - $ln_itm->qty_done;
    $to_trans = $trans2;
} else {
    $from_trans = $trans2;
    $to_trans = $trans1;
}
$company_currency = get_company_currency();
$show_currencies = false;
$show_both_amounts = false;
if ($from_trans['bank_curr_code'] != $company_currency || $to_trans['bank_curr_code'] != $company_currency) {
    $show_currencies = true;
}
if ($from_trans['bank_curr_code'] != $to_trans['bank_curr_code']) {
    $show_currencies = true;
    $show_both_amounts = true;
}
display_heading($systypes_array[ST_BANKTRANSFER] . " #{$trans_no}");
echo "<br>";
start_table(TABLESTYLE, "width=80%");
start_row();
label_cells(_("From Bank Account"), $from_trans['bank_account_name'], "class='tableheader2'");
if ($show_currencies) {
    label_cells(_("Currency"), $from_trans['bank_curr_code'], "class='tableheader2'");
}
label_cells(_("Amount"), number_format2(-$from_trans['amount'], user_price_dec()), "class='tableheader2'", "align=right");
if ($show_currencies) {
    end_row();
    start_row();
}
label_cells(_("To Bank Account"), $to_trans['bank_account_name'], "class='tableheader2'");
if ($show_currencies) {
    label_cells(_("Currency"), $to_trans['bank_curr_code'], "class='tableheader2'");
if (isset($_GET["trans_no"])) {
    $trans_no = $_GET["trans_no"];
}
$receipt = get_supp_trans($trans_no, ST_SUPPAYMENT);
$company_currency = get_company_currency();
$show_currencies = false;
$show_both_amounts = false;
if ($receipt['bank_curr_code'] != $company_currency || $receipt['curr_code'] != $company_currency) {
    $show_currencies = true;
}
if ($receipt['bank_curr_code'] != $receipt['curr_code']) {
    $show_currencies = true;
    $show_both_amounts = true;
}
echo "<center>";
display_heading(_("Payment to Supplier") . " #{$trans_no}");
echo "<br>";
start_table(TABLESTYLE2, "width=80%");
start_row();
label_cells(_("To Supplier"), $receipt['supplier_name'], "class='tableheader2'");
label_cells(_("From Bank Account"), $receipt['bank_account_name'], "class='tableheader2'");
label_cells(_("Date Paid"), sql2date($receipt['tran_date']), "class='tableheader2'");
end_row();
start_row();
if ($show_currencies) {
    label_cells(_("Payment Currency"), $receipt['bank_curr_code'], "class='tableheader2'");
}
label_cells(_("Amount"), number_format2(-$receipt['bank_amount'], user_price_dec()), "class='tableheader2'");
if ($receipt['ov_discount'] != 0) {
    label_cells(_("Discount"), number_format2(-$receipt['ov_discount'] * $receipt['rate'], user_price_dec()), "class='tableheader2'");
} else {
$path_to_root = "../..";
include_once $path_to_root . "/sales/includes/cart_class.inc";
include_once $path_to_root . "/includes/session.inc";
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/sales/includes/sales_ui.inc";
include_once $path_to_root . "/sales/includes/sales_db.inc";
$js = "";
if ($use_popup_windows) {
    $js .= get_js_open_window(900, 600);
}
if ($_GET['trans_type'] == ST_SALESQUOTE) {
    page(_($help_context = "View Sales Quotation"), true, false, "", $js);
    display_heading(sprintf(_("Sales Quotation #%d"), $_GET['trans_no']));
} else {
    page(_($help_context = "View Sales Order"), true, false, "", $js);
    display_heading(sprintf(_("Sales Order #%d"), $_GET['trans_no']));
}
if (isset($_SESSION['View'])) {
    unset($_SESSION['View']);
}
$_SESSION['View'] = new Cart($_GET['trans_type'], $_GET['trans_no']);
start_table(TABLESTYLE2, "width=95%", 5);
if ($_GET['trans_type'] != ST_SALESQUOTE) {
    echo "<tr valign=top><td>";
    display_heading2(_("Order Information"));
    echo "</td><td>";
    display_heading2(_("Deliveries"));
    echo "</td><td>";
    display_heading2(_("Invoices/Credits"));
    echo "</td></tr>";
}
Beispiel #16
0
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_ITEMSTRANSVIEW';
$path_to_root = "../..";
include $path_to_root . "/includes/session.inc";
page(_($help_context = "View Inventory Adjustment"), true);
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/includes/ui.inc";
include_once $path_to_root . "/inventory/includes/inventory_db.inc";
if (isset($_GET["trans_no"])) {
    $trans_no = $_GET["trans_no"];
}
display_heading($systypes_array[ST_INVADJUST] . " #{$trans_no}");
br(1);
$adjustment_items = get_stock_adjustment_items($trans_no);
$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);
Beispiel #17
0
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_OPEN';
$path_to_root = "../..";
include_once $path_to_root . "/includes/session.inc";
include_once $path_to_root . "/includes/packages.inc";
page(_($help_context = "Package Details"), true);
include_once $path_to_root . "/includes/ui.inc";
if (!isset($_GET['id'])) {
    /*Script was not passed the correct parameters */
    display_note(_("The script must be called with a valid package id to review the info for."));
    end_page();
}
$filter = array('Version' => _('Available version'), 'Type' => _('Package type'), 'Name' => _('Package content'), 'Description' => _('Description'), 'Author' => _('Author'), 'Homepage' => _('Home page'), 'Maintenance' => _('Package maintainer'), 'InstallPath' => _('Installation path'), 'Depends' => _('Minimal software versions'), 'RTLDir' => _('Right to left'), 'Encoding' => _('Charset encoding'));
$pkg = get_package_info($_GET['id'], null, $filter);
display_heading(sprintf(_("Content information for package '%s'"), $_GET['id']));
br();
start_table(TABLESTYLE2, "width='80%'");
$th = array(_("Property"), _("Value"));
table_header($th);
foreach ($pkg as $field => $value) {
    if ($value == '') {
        continue;
    }
    start_row();
    label_cells($field, nl2br(htmlentities(is_array($value) ? implode("\n", $value) : $value)), "class='tableheader2'");
    end_row();
}
end_table(1);
end_page(true);
    label_cell(_("Dimension") . " 2:", "class='tableheader2'");
    $_POST['dimension2_id'] = $_SESSION['Items']->dimension2_id;
    dimensions_list_cells(null, 'dimension2_id', null, true, ' ', false, 2, false);
} else {
    hidden('dimension2_id', 0);
}
end_row();
end_table();
$row = get_customer_to_order($_SESSION['Items']->customer_id);
if ($row['dissallow_invoices'] == 1) {
    display_error(_("The selected customer account is currently on hold. Please contact the credit control personnel to discuss."));
    end_form();
    end_page();
    exit;
}
display_heading(_("Invoice Items"));
div_start('Items');
start_table(TABLESTYLE, "width='80%'");
$th = array(_("Item Code"), _("Item Description"), _("Delivered"), _("Units"), _("Invoiced"), _("This Invoice"), _("Price"), _("Tax Type"), _("Discount"), _("Total"));
if ($is_batch_invoice) {
    $th[] = _("DN");
    $th[] = "";
}
if ($is_edition) {
    $th[4] = _("Credited");
}
table_header($th);
$k = 0;
$has_marked = false;
$show_qoh = true;
$dn_line_cnt = 0;
Beispiel #19
0
<?php

$page_security = 1;
$path_to_root = "../..";
include $path_to_root . "/includes/session.inc";
page(tr("View Inventory Transfer"), true);
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/includes/ui.inc";
include_once $path_to_root . "/gl/includes/gl_db.inc";
if (isset($_GET["trans_no"])) {
    $trans_no = $_GET["trans_no"];
}
$transfer_items = get_stock_transfer($trans_no);
$from_trans = $transfer_items[0];
$to_trans = $transfer_items[1];
display_heading(systypes::name(systypes::location_transfer()) . " #{$trans_no}");
echo "<br>";
start_table("{$table_style2} width=90%");
start_row();
label_cells(tr("Item"), $from_trans['stock_id'] . " - " . $from_trans['description'], "class='tableheader2'");
label_cells(tr("From Location"), $from_trans['location_name'], "class='tableheader2'");
label_cells(tr("To Location"), $to_trans['location_name'], "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Reference"), $from_trans['reference'], "class='tableheader2'");
$adjustment_type = get_movement_type($from_trans['person_id']);
label_cells(tr("Adjustment Type"), $adjustment_type['name'], "class='tableheader2'");
label_cells(tr("Date"), sql2date($from_trans['tran_date']), "class='tableheader2'");
end_row();
comments_display_row(systypes::location_transfer(), $trans_no);
end_table(1);
Beispiel #20
0
 function display_applications(&$waapp)
 {
     global $path_to_root, $use_popup_windows;
     include_once "{$path_to_root}/includes/ui.inc";
     include_once $path_to_root . "/reporting/includes/class.graphic.inc";
     include $path_to_root . "/includes/system_tests.inc";
     if ($use_popup_windows) {
         echo "<script language='javascript'>\n";
         echo get_js_open_window(900, 500);
         echo "</script>\n";
     }
     $selected_app = $waapp->get_selected_application();
     // first have a look through the directory,
     // and remove old temporary pdfs and pngs
     $dir = company_path() . '/pdf_files';
     if ($d = @opendir($dir)) {
         while (($file = readdir($d)) !== false) {
             if (!is_file($dir . '/' . $file) || $file == 'index.php') {
                 continue;
             }
             // then check to see if this one is too old
             $ftime = filemtime($dir . '/' . $file);
             // seems 3 min is enough for any report download, isn't it?
             if (time() - $ftime > 180) {
                 unlink($dir . '/' . $file);
             }
         }
         closedir($d);
     }
     if ($selected_app->id == "orders") {
         display_customer_topten();
     } elseif ($selected_app->id == "AP") {
         display_supplier_topten();
     } elseif ($selected_app->id == "stock") {
         display_stock_topten();
     } elseif ($selected_app->id == "manuf") {
         display_stock_topten(true);
     } elseif ($selected_app->id == "proj") {
         display_dimension_topten();
     } elseif ($selected_app->id == "GL") {
         display_gl_info();
     } else {
         $title = "Display System Diagnostics";
         br(2);
         display_heading($title);
         br();
         display_system_tests();
     }
 }
Beispiel #21
0
function edit_allocations_for_transaction($type, $trans_no)
{
    global $table_style;
    start_form(false, true);
    display_heading(sprintf(tr("Allocation of %s # %d"), systypes::name($_SESSION['alloc']->type), $_SESSION['alloc']->trans_no));
    display_heading($_SESSION['alloc']->person_name);
    display_heading2(tr("Date:") . " <b>" . $_SESSION['alloc']->date_ . "</b>");
    display_heading2(tr("Total:") . " <b>" . price_format($_SESSION['alloc']->amount) . "</b>");
    echo "<br>";
    if (count($_SESSION['alloc']->allocs) > 0) {
        start_table($table_style);
        $th = array(tr("Transaction Type"), tr("#"), tr("Date"), tr("Due Date"), tr("Amount"), tr("Other Allocations"), tr("This Allocation"), tr("Left to Allocate"), "", "");
        table_header($th);
        $k = $counter = $total_allocated = 0;
        foreach ($_SESSION['alloc']->allocs as $allocn_item) {
            alt_table_row_color($k);
            label_cell(systypes::name($allocn_item->type));
            label_cell(get_trans_view_str($allocn_item->type, $allocn_item->type_no));
            label_cell($allocn_item->date_, "align=right");
            label_cell($allocn_item->due_date, "align=right");
            amount_cell($allocn_item->amount);
            amount_cell($allocn_item->amount_allocated);
            if (!check_num('amount' . $counter)) {
                $_POST['amount' . $counter] = price_format($allocn_item->current_allocated);
            }
            amount_cells(null, 'amount' . $counter, $_POST['amount' . $counter]);
            $un_allocated = round($allocn_item->amount - $allocn_item->amount_allocated, 6);
            hidden("un_allocated" . $counter, $un_allocated);
            amount_cell($un_allocated);
            label_cell("<a href='#' name=Alloc{$counter} onclick='allocate_all(this.name.substr(5));return true;'>" . tr("All") . "</a>");
            label_cell("<a href='#' name=DeAll{$counter} onclick='allocate_none(this.name.substr(5));return true;'>" . tr("None") . "</a>");
            end_row();
            $total_allocated += input_num('amount' . $counter);
            $counter++;
        }
        label_row(tr("Total Allocated"), price_format($total_allocated), "colspan=6 align=right", "nowrap align=right id='total_allocated'");
        if ($_SESSION['alloc']->amount - $total_allocated < 0) {
            $font1 = "<font color=red>";
            $font2 = "</font>";
        } else {
            $font1 = $font2 = "";
        }
        $left_to_allocate = $_SESSION['alloc']->amount - $total_allocated;
        $left_to_allocate = price_format($left_to_allocate);
        label_row(tr("Left to Allocate"), $font1 . $left_to_allocate . $font2, "colspan=6 align=right ", "nowrap align=right id='left_to_allocate'");
        end_table(1);
        hidden('TotalNumberOfAllocs', $counter);
        //		hidden('left_to_allocate', $left_to_allocate);
        submit_center_first('UpdateDisplay', tr("Update"));
        submit('Process', tr("Process"));
    } else {
        display_note(tr("There are no unsettled transactions to allocate."), 0, 1);
    }
    submit_center_last('Cancel', tr("Back to Allocations"));
    end_form();
}
Beispiel #22
0
<?php

$page_security = 1;
$path_to_root = "../..";
include_once $path_to_root . "/includes/session.inc";
page(tr("View Customer Payment"), true);
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/includes/ui.inc";
include_once $path_to_root . "/sales/includes/sales_db.inc";
if (isset($_GET["trans_no"])) {
    $trans_id = $_GET["trans_no"];
}
$receipt = get_customer_trans($trans_id, systypes::cust_payment());
display_heading(sprintf(tr("Customer Payment #%d"), $trans_id));
echo "<br>";
start_table("{$table_style} width=80%");
start_row();
label_cells(tr("From Customer"), $receipt['DebtorName'], "class='tableheader2'");
label_cells(tr("Into Bank Account"), $receipt['bank_account_name'], "class='tableheader2'");
label_cells(tr("Date of Deposit"), sql2date($receipt['tran_date']), "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Payment Currency"), $receipt['curr_code'], "class='tableheader2'");
label_cells(tr("Amount"), price_format($receipt['ov_amount']), "class='tableheader2'");
label_cells(tr("Discount"), price_format($receipt['ov_discount']), "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Payment Type"), $receipt['BankTransType'], "class='tableheader2'");
label_cells(tr("Reference"), $receipt['reference'], "class='tableheader2'", "colspan=4");
end_row();
comments_display_row(systypes::cust_payment(), $trans_id);
Beispiel #23
0
include_once $path_to_root . "/gl/includes/gl_db.inc";
if (isset($_GET["trans_no"])) {
    $trans_no = $_GET["trans_no"];
}
// get the pay-from bank payment info
$result = get_bank_trans(ST_BANKPAYMENT, $trans_no);
if (db_num_rows($result) != 1) {
    display_db_error("duplicate payment bank transaction found", "");
}
$from_trans = db_fetch($result);
$company_currency = get_company_currency();
$show_currencies = false;
if ($from_trans['bank_curr_code'] != $company_currency) {
    $show_currencies = true;
}
display_heading(_("GL Payment") . " #{$trans_no}");
echo "<br>";
start_table(TABLESTYLE, "width=80%");
if ($show_currencies) {
    $colspan1 = 5;
    $colspan2 = 8;
} else {
    $colspan1 = 3;
    $colspan2 = 6;
}
start_row();
label_cells(_("From Bank Account"), $from_trans['bank_account_name'], "class='tableheader2'");
if ($show_currencies) {
    label_cells(_("Currency"), $from_trans['bank_curr_code'], "class='tableheader2'");
}
label_cells(_("Amount"), number_format2(-$from_trans['amount'], user_price_dec()), "class='tableheader2'", "align=right");
Beispiel #24
0
function show_results()
{
    global $path_to_root, $systypes_array;
    if (!isset($_POST["account"])) {
        $_POST["account"] = null;
    }
    $act_name = $_POST["account"] ? get_gl_account_name($_POST["account"]) : "";
    $dim = get_company_pref('use_dimension');
    /*Now get the transactions  */
    if (!isset($_POST['Dimension'])) {
        $_POST['Dimension'] = 0;
    }
    if (!isset($_POST['Dimension2'])) {
        $_POST['Dimension2'] = 0;
    }
    $result = get_gl_transactions($_POST['TransFromDate'], $_POST['TransToDate'], -1, $_POST["account"], $_POST['Dimension'], $_POST['Dimension2'], null, input_num('amount_min'), input_num('amount_max'));
    $colspan = $dim == 2 ? "6" : ($dim == 1 ? "5" : "4");
    if ($_POST["account"] != null) {
        display_heading($_POST["account"] . "&nbsp;&nbsp;&nbsp;" . $act_name);
    }
    // Only show balances if an account is specified AND we're not filtering by amounts
    $show_balances = $_POST["account"] != null && input_num("amount_min") == 0 && input_num("amount_max") == 0;
    start_table(TABLESTYLE);
    $first_cols = array(_("Type"), _("#"), _("Date"));
    if ($_POST["account"] == null) {
        $account_col = array(_("Account"));
    } else {
        $account_col = array();
    }
    if ($dim == 2) {
        $dim_cols = array(_("Dimension") . " 1", _("Dimension") . " 2");
    } else {
        if ($dim == 1) {
            $dim_cols = array(_("Dimension"));
        } else {
            $dim_cols = array();
        }
    }
    if ($show_balances) {
        $remaining_cols = array(_("Person/Item"), _("Debit"), _("Credit"), _("Balance"), _("Memo"));
    } else {
        $remaining_cols = array(_("Person/Item"), _("Debit"), _("Credit"), _("Memo"));
    }
    $th = array_merge($first_cols, $account_col, $dim_cols, $remaining_cols);
    table_header($th);
    if ($_POST["account"] != null && is_account_balancesheet($_POST["account"])) {
        $begin = "";
    } else {
        $begin = get_fiscalyear_begin_for_date($_POST['TransFromDate']);
        if (date1_greater_date2($begin, $_POST['TransFromDate'])) {
            $begin = $_POST['TransFromDate'];
        }
        $begin = add_days($begin, -1);
    }
    $bfw = 0;
    if ($show_balances) {
        $bfw = get_gl_balance_from_to($begin, $_POST['TransFromDate'], $_POST["account"], $_POST['Dimension'], $_POST['Dimension2']);
        start_row("class='inquirybg'");
        label_cell("<b>" . _("Opening Balance") . " - " . $_POST['TransFromDate'] . "</b>", "colspan={$colspan}");
        display_debit_or_credit_cells($bfw, true);
        label_cell("");
        label_cell("");
        end_row();
    }
    $running_total = $bfw;
    $j = 1;
    $k = 0;
    //row colour counter
    while ($myrow = db_fetch($result)) {
        alt_table_row_color($k);
        $running_total += $myrow["amount"];
        $trandate = sql2date($myrow["tran_date"]);
        label_cell($systypes_array[$myrow["type"]]);
        label_cell(get_gl_view_str($myrow["type"], $myrow["type_no"], $myrow["type_no"], true));
        label_cell($trandate);
        if ($_POST["account"] == null) {
            label_cell($myrow["account"] . ' ' . get_gl_account_name($myrow["account"]));
        }
        if ($dim >= 1) {
            label_cell(get_dimension_string($myrow['dimension_id'], true));
        }
        if ($dim > 1) {
            label_cell(get_dimension_string($myrow['dimension2_id'], true));
        }
        label_cell(payment_person_name($myrow["person_type_id"], $myrow["person_id"]));
        display_debit_or_credit_cells($myrow["amount"]);
        if ($show_balances) {
            amount_cell($running_total);
        }
        if ($myrow['memo_'] == "") {
            $myrow['memo_'] = get_comments_string($myrow['type'], $myrow['type_no']);
        }
        label_cell($myrow['memo_']);
        end_row();
        $j++;
        if ($j == 12) {
            $j = 1;
            table_header($th);
        }
    }
    //end of while loop
    if ($show_balances) {
        start_row("class='inquirybg'");
        label_cell("<b>" . _("Ending Balance") . " - " . $_POST['TransToDate'] . "</b>", "colspan={$colspan}");
        display_debit_or_credit_cells($running_total, true);
        label_cell("");
        label_cell("");
        end_row();
    }
    end_table(2);
    if (db_num_rows($result) == 0) {
        display_note(_("No general ledger transactions have been created for the specified criteria."), 0, 1);
    }
}
Beispiel #25
0
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/includes/manufacturing.inc";
include_once $path_to_root . "/includes/data_checks.inc";
include_once $path_to_root . "/manufacturing/includes/manufacturing_db.inc";
include_once $path_to_root . "/manufacturing/includes/manufacturing_ui.inc";
$js = "";
if ($use_popup_windows) {
    $js .= get_js_open_window(800, 500);
}
page(_($help_context = "View Work Order"), true, false, "", $js);
//-------------------------------------------------------------------------------------------------
$woid = 0;
if ($_GET['trans_no'] != "") {
    $woid = $_GET['trans_no'];
}
display_heading($systypes_array[ST_WORKORDER] . " # " . $woid);
br(1);
$myrow = get_work_order($woid);
if ($myrow["type"] == WO_ADVANCED) {
    display_wo_details($woid, true);
} else {
    display_wo_details_quick($woid, true);
}
echo "<center>";
// display the WO requirements
br(1);
if ($myrow["released"] == false) {
    display_heading2(_("BOM for item:") . " " . $myrow["StockItemName"]);
    display_bom($myrow["stock_id"]);
} else {
    display_heading2(_("Work Order Requirements"));
Beispiel #26
0
<?php

$page_security = 10;
$path_to_root = "../..";
include_once $path_to_root . "/includes/session.inc";
page(tr("View Dimension"), true);
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/includes/data_checks.inc";
include_once $path_to_root . "/dimensions/includes/dimensions_db.inc";
include_once $path_to_root . "/dimensions/includes/dimensions_ui.inc";
//-------------------------------------------------------------------------------------------------
if ($_GET['trans_no'] != "") {
    $id = $_GET['trans_no'];
}
display_heading(systypes::name(systypes::dimension()) . " # " . $id);
$myrow = get_dimension($id);
if (strlen($myrow[0]) == 0) {
    echo tr("The work order number sent is not valid.");
    exit;
}
start_table($table_style);
$th = array(tr("#"), tr("Reference"), tr("Name"), tr("Type"), tr("Date"), tr("Due Date"));
table_header($th);
start_row();
label_cell($myrow["id"]);
label_cell($myrow["reference"]);
label_cell($myrow["name"]);
label_cell($myrow["type_"]);
label_cell(sql2date($myrow["date_"]));
label_cell(sql2date($myrow["due_date"]));
end_row();
$path_to_root = "..";
include_once $path_to_root . "/purchasing/includes/supp_trans_class.inc";
include_once $path_to_root . "/includes/session.inc";
include_once $path_to_root . "/purchasing/includes/purchasing_ui.inc";
include_once $path_to_root . "/purchasing/includes/purchasing_db.inc";
$js = "";
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
page(tr("Select Received Items to Add"), false, false, "", $js);
if (!isset($_SESSION['supp_trans'])) {
    display_note("To enter supplier transactions the supplier must first be selected from the supplier selection screen, then the link to enter a supplier credit note must be clicked on.", 1, 0);
    exit;
}
//-----------------------------------------------------------------------------------------
display_heading($_SESSION['supp_trans']->supplier_name);
echo "<br>";
//-----------------------------------------------------------------------------------------
function check_data()
{
    global $check_price_charged_vs_order_price, $check_qty_charged_vs_del_qty;
    if (!check_num('this_quantity_inv', 0) || input_num('this_quantity_inv') == 0) {
        display_error(tr("The quantity to invoice must be numeric and greater than zero."));
        set_focus('this_quantity_inv');
        return false;
    }
    if (!check_num('ChgPrice')) {
        display_error(tr("The price is not numeric."));
        set_focus('ChgPrice');
        return false;
    }
Beispiel #28
0
    exit;
}
if (isset($delete)) {
    // deletes all records with id from table reports
    $query = "DELETE FROM xx_reports WHERE id = '" . $id . "'";
    db_query($query);
    $url = REPGENDIR . "/repgen_select.php?id=" . $id;
    $url = "http://{$HTTP_HOST}" . $url;
    header("Location: " . $url);
    // switches to repgen_select.php
    exit;
}
page("Report Generator REPGEN");
### Output key administration forms, including all updated
### information, if we come here after a submission...
display_heading(DESCRIPT);
switch (substr($id, 0, 1)) {
    case 'B':
        $note = DEL_BLOCK;
        break;
    case 'F':
        $note = DEL_FUNC;
        break;
    default:
        $note = DEL_REPORT;
        break;
}
$h = explode("|", $attr);
$note = sprintf($note, "  " . $h[3] . "  ");
/* longname of report*/
display_notification($note);
if (isset($_GET["trans_no"])) {
    $trans_no = $_GET["trans_no"];
}
// get the pay-to bank payment info
$result = get_bank_trans(ST_BANKDEPOSIT, $trans_no);
if (db_num_rows($result) != 1) {
    display_db_error("duplicate payment bank transaction found", "");
}
$to_trans = db_fetch($result);
$company_currency = get_company_currency();
$show_currencies = false;
if ($to_trans['bank_curr_code'] != $to_trans['settle_curr']) {
    $show_currencies = true;
}
echo "<center>";
display_heading(_("GL Deposit") . " #{$trans_no}");
echo "<br>";
start_table(TABLESTYLE, "width=80%");
if ($show_currencies) {
    $colspan1 = 1;
    $colspan2 = 7;
} else {
    $colspan1 = 3;
    $colspan2 = 5;
}
start_row();
label_cells(_("To Bank Account"), $to_trans['bank_account_name'], "class='tableheader2'");
if ($show_currencies) {
    label_cells(_("Currency"), $to_trans['bank_curr_code'], "class='tableheader2'");
}
label_cells(_("Amount"), number_format2($to_trans['amount'], user_price_dec()), "class='tableheader2'", "align=right");
Beispiel #30
0
	of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_WORKORDERCOST';
$path_to_root = "../..";
include_once $path_to_root . "/includes/session.inc";
page(_($help_context = "Costed Bill Of Material Inquiry"));
include_once $path_to_root . "/manufacturing/includes/manufacturing_ui.inc";
include_once $path_to_root . "/includes/manufacturing.inc";
include_once $path_to_root . "/includes/ui.inc";
include_once $path_to_root . "/includes/banking.inc";
include_once $path_to_root . "/includes/data_checks.inc";
check_db_has_bom_stock_items(_("There are no manufactured or kit items defined in the system."));
if (isset($_GET['stock_id'])) {
    $_POST['stock_id'] = $_GET['stock_id'];
}
if (list_updated('stock_id')) {
    $Ajax->activate('_page_body');
}
start_form(false, true);
start_table(TABLESTYLE_NOBORDER);
stock_manufactured_items_list_row(_("Select a manufacturable item:"), 'stock_id', null, false, true);
end_table();
br();
display_heading(_("All Costs Are In:") . " " . get_company_currency());
display_bom($_POST['stock_id']);
end_form();
end_page();