本文整理汇总了PHP中get_company_pref函数的典型用法代码示例。如果您正苦于以下问题:PHP get_company_pref函数的具体用法?PHP get_company_pref怎么用?PHP get_company_pref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_company_pref函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: can_process
function can_process()
{
if (!check_num('po_over_receive', 0, 100)) {
display_error(_("The delivery over-receive allowance must be between 0 and 100."));
set_focus('po_over_receive');
return false;
}
if (!check_num('po_over_charge', 0, 100)) {
display_error(_("The invoice over-charge allowance must be between 0 and 100."));
set_focus('po_over_charge');
return false;
}
if (!check_num('past_due_days', 0, 100)) {
display_error(_("The past due days interval allowance must be between 0 and 100."));
set_focus('past_due_days');
return false;
}
$grn_act = get_company_pref('grn_clearing_act');
if (get_post('grn_clearing_act') != $grn_act && db_num_rows(get_grn_items(0, '', true))) {
display_error(_("Before GRN Clearing Account can be changed all GRNs have to be invoiced"));
$_POST['grn_clearing_act'] = $grn_act;
set_focus('grn_clearing_account');
return false;
}
if (!is_account_balancesheet(get_post('retained_earnings_act')) || is_account_balancesheet(get_post('profit_loss_year_act'))) {
display_error(_("The Retained Earnings Account should be a Balance Account or the Profit and Loss Year Account should be an Expense Account (preferred the last one in the Expense Class)"));
return false;
}
return true;
}
示例2: display_customer_summary
function display_customer_summary($customer_record)
{
global $table_style;
$past1 = get_company_pref('past_due_days');
$past2 = 2 * $past1;
if ($customer_record["dissallow_invoices"] != 0) {
echo "<center><font color=red size=4><b>" . tr("CUSTOMER ACCOUNT IS ON HOLD") . "</font></b></center>";
}
$nowdue = "1-" . $past1 . " " . tr('Days');
$pastdue1 = $past1 + 1 . "-" . $past2 . " " . tr('Days');
$pastdue2 = tr('Over') . " " . $past2 . " " . tr('Days');
start_table("width=80% {$table_style}");
$th = array(tr("Currency"), tr("Terms"), tr("Current"), $nowdue, $pastdue1, $pastdue2, tr("Total Balance"));
table_header($th);
start_row();
label_cell($customer_record["curr_code"]);
label_cell($customer_record["terms"]);
amount_cell($customer_record["Balance"] - $customer_record["Due"]);
amount_cell($customer_record["Due"] - $customer_record["Overdue1"]);
amount_cell($customer_record["Overdue1"] - $customer_record["Overdue2"]);
amount_cell($customer_record["Overdue2"]);
amount_cell($customer_record["Balance"]);
end_row();
end_table();
}
示例3: gl_inquiry_controls
function gl_inquiry_controls()
{
$dim = get_company_pref('use_dimension');
start_form();
start_table(TABLESTYLE_NOBORDER);
$date = today();
if (!isset($_POST['TransFromDate'])) {
$_POST['TransFromDate'] = begin_month($date);
}
if (!isset($_POST['TransToDate'])) {
$_POST['TransToDate'] = end_month($date);
}
date_cells(_("From:"), 'TransFromDate');
date_cells(_("To:"), 'TransToDate');
if ($dim >= 1) {
dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
}
if ($dim > 1) {
dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
}
check_cells(_("No zero values"), 'NoZero', null);
check_cells(_("Only balances"), 'Balance', null);
submit_cells('Show', _("Show"), '', '', 'default');
end_table();
end_form();
}
示例4: check_can_delete
function check_can_delete($curr)
{
if ($curr == "") {
return false;
}
// PREVENT DELETES IF DEPENDENT RECORDS IN debtors_master
if (key_in_foreign_table($curr, 'debtors_master', 'curr_code')) {
display_error(_("Cannot delete this currency, because customer accounts have been created referring to this currency."));
return false;
}
if (key_in_foreign_table($curr, 'suppliers', 'curr_code')) {
display_error(_("Cannot delete this currency, because supplier accounts have been created referring to this currency."));
return false;
}
if ($curr == get_company_pref('curr_default')) {
display_error(_("Cannot delete this currency, because the company preferences uses this currency."));
return false;
}
// see if there are any bank accounts that use this currency
if (key_in_foreign_table($curr, 'bank_accounts', 'bank_curr_code')) {
display_error(_("Cannot delete this currency, because thre are bank accounts that use this currency."));
return false;
}
return true;
}
示例5: write_customer
function write_customer($email, $name, $company, $address, $phone, $fax, $currency)
{
global $paypal_sales_type_id, $paypal_tax_group_id, $paypal_salesman, $paypal_area, $paypal_location, $paypal_credit_status, $paypal_shipper;
global $SysPrefs;
log_message("Memory, write_customer start:" . memory_get_usage());
$customer_id = find_customer_by_email($email);
if (empty($customer_id)) {
$customer_id = find_customer_by_name($company);
}
if (empty($customer_id)) {
//it is a new customer
begin_transaction();
add_customer($company, substr($company, 0, 30), $address, '', $currency, 0, 0, $paypal_credit_status, -1, 0, 0, $SysPrefs->default_credit_limit(), $paypal_sales_type_id, 'PayPal');
$customer_id = db_insert_id();
add_branch($customer_id, $company, substr($company, 0, 30), $address, $paypal_salesman, $paypal_area, $paypal_tax_group_id, '', get_company_pref('default_sales_discount_act'), get_company_pref('debtors_act'), get_company_pref('default_prompt_payment_act'), $paypal_location, $address, 0, 0, $paypal_shipper, 'PayPal');
$selected_branch = db_insert_id();
$nameparts = explode(" ", $name);
$firstname = "";
for ($i = 0; $i < count($nameparts) - 1; $i++) {
if (!empty($firstname)) {
$firstname .= " ";
}
$firstname .= $nameparts[$i];
}
$lastname = $nameparts[count($nameparts) - 1];
add_crm_person('paypal', $firstname, $lastname, $address, $phone, '', $fax, $email, '', '');
add_crm_contact('customer', 'general', $selected_branch, db_insert_id());
commit_transaction();
} else {
$selected_branch = 0;
}
log_message("Memory, write_customer end:" . memory_get_usage());
return array($customer_id, $selected_branch);
}
示例6: inquiry_controls
function inquiry_controls()
{
$dim = get_company_pref('use_dimension');
start_table(TABLESTYLE_NOBORDER);
date_cells(_("As at:"), 'TransToDate');
if ($dim >= 1) {
dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
}
if ($dim > 1) {
dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
}
submit_cells('Show', _("Show"), '', '', 'default');
end_table();
hidden('TransFromDate');
hidden('AccGrp');
}
示例7: dimensions_app
function dimensions_app()
{
$dim = get_company_pref('use_dimension');
$this->application("proj", _($this->help_context = "&Dimensions"), $dim);
if ($dim > 0) {
$this->add_module(_("Transactions"));
$this->add_lapp_function(0, _("Dimension &Entry"), "dimensions/dimension_entry.php?", 'SA_DIMENSION', MENU_ENTRY);
$this->add_lapp_function(0, _("&Outstanding Dimensions"), "dimensions/inquiry/search_dimensions.php?outstanding_only=1", 'SA_DIMTRANSVIEW', MENU_TRANSACTION);
$this->add_module(_("Inquiries and Reports"));
$this->add_lapp_function(1, _("Dimension &Inquiry"), "dimensions/inquiry/search_dimensions.php?", 'SA_DIMTRANSVIEW', MENU_INQUIRY);
$this->add_rapp_function(1, _("Dimension &Reports"), "reporting/reports_main.php?Class=4", 'SA_DIMENSIONREP', MENU_REPORT);
$this->add_module(_("Maintenance"));
$this->add_lapp_function(2, _("Dimension &Tags"), "admin/tags.php?type=dimension", 'SA_DIMTAGS', MENU_MAINTENANCE);
$this->add_extensions();
}
}
示例8: display_supplier_summary
function display_supplier_summary($supplier_record)
{
$past1 = get_company_pref('past_due_days');
$past2 = 2 * $past1;
$nowdue = "1-" . $past1 . " " . _('Days');
$pastdue1 = $past1 + 1 . "-" . $past2 . " " . _('Days');
$pastdue2 = _('Over') . " " . $past2 . " " . _('Days');
start_table(TABLESTYLE, "width='80%'");
$th = array(_("Currency"), _("Terms"), _("Current"), $nowdue, $pastdue1, $pastdue2, _("Total Balance"));
table_header($th);
start_row();
label_cell($supplier_record["curr_code"]);
label_cell($supplier_record["terms"]);
amount_cell($supplier_record["Balance"] - $supplier_record["Due"]);
amount_cell($supplier_record["Due"] - $supplier_record["Overdue1"]);
amount_cell($supplier_record["Overdue1"] - $supplier_record["Overdue2"]);
amount_cell($supplier_record["Overdue2"]);
amount_cell($supplier_record["Balance"]);
end_row();
end_table(1);
}
示例9: inquiry_controls
function inquiry_controls()
{
global $Ajax;
$dim = get_company_pref('use_dimension');
start_table(TABLESTYLE_NOBORDER);
$date = today();
if (!isset($_POST['TransFromDate'])) {
$_POST['TransFromDate'] = begin_month($date);
}
if (!isset($_POST['TransToDate'])) {
$_POST['TransToDate'] = end_month($date);
}
date_cells(_("From:"), 'TransFromDate');
date_cells(_("To:"), 'TransToDate');
type_list_cells(_("Category: "), 'typeId', null, true);
$r = set();
account_list_cells(_(""), 'accountId', $r);
submit_cells('submit_submit', _("Generate Report"), true, '', 'default');
//submit_cells('RefreshInquiry', _("Search"),'',_('Refresh Inquiry'), 'default');
end_table();
}
示例10: check_inputs
function check_inputs()
{
global $Refs;
if (!get_post('supplier_id')) {
display_error(_("There is no supplier selected."));
set_focus('supplier_id');
return false;
}
if (@$_POST['amount'] == "") {
$_POST['amount'] = price_format(0);
}
if (!check_num('amount', 0)) {
display_error(_("The entered amount is invalid or less than zero."));
set_focus('amount');
return false;
}
if (isset($_POST['charge']) && !check_num('charge', 0)) {
display_error(_("The entered amount is invalid or less than zero."));
set_focus('charge');
return false;
}
if (isset($_POST['charge']) && input_num('charge') > 0) {
$charge_acct = get_company_pref('bank_charge_act');
if (get_gl_account($charge_acct) == false) {
display_error(_("The Bank Charge Account has not been set in System and General GL Setup."));
set_focus('charge');
return false;
}
}
if (@$_POST['discount'] == "") {
$_POST['discount'] = 0;
}
if (!check_num('discount', 0)) {
display_error(_("The entered discount is invalid or less than zero."));
set_focus('amount');
return false;
}
//if (input_num('amount') - input_num('discount') <= 0)
if (input_num('amount') <= 0) {
display_error(_("The total of the amount and the discount is zero or negative. Please enter positive values."));
set_focus('amount');
return false;
}
if (isset($_POST['bank_amount']) && input_num('bank_amount') <= 0) {
display_error(_("The entered bank amount is zero or negative."));
set_focus('bank_amount');
return false;
}
if (!is_date($_POST['DatePaid'])) {
display_error(_("The entered date is invalid."));
set_focus('DatePaid');
return false;
} elseif (!is_date_in_fiscalyear($_POST['DatePaid'])) {
display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
set_focus('DatePaid');
return false;
}
$limit = get_bank_account_limit($_POST['bank_account'], $_POST['DatePaid']);
if ($limit !== null && floatcmp($limit, input_num('amount')) < 0) {
display_error(sprintf(_("The total bank amount exceeds allowed limit (%s)."), price_format($limit)));
set_focus('amount');
return false;
}
if (!$Refs->is_valid($_POST['ref'])) {
display_error(_("You must enter a reference."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], ST_SUPPAYMENT)) {
display_error(_("The entered reference is already in use."));
set_focus('ref');
return false;
}
if (!db_has_currency_rates(get_supplier_currency($_POST['supplier_id']), $_POST['DatePaid'], true)) {
return false;
}
$_SESSION['alloc']->amount = -input_num('amount');
if (isset($_POST["TotalNumberOfAllocs"])) {
return check_allocations();
} else {
return true;
}
}
示例11: display_notification_centered
} else {
display_notification_centered(_("Purchase Order has been updated") . " #{$order_no}");
}
display_note(get_trans_view_str($trans_type, $order_no, _("&View this order")), 0, 1);
display_note(print_document_link($order_no, _("&Print This Order"), true, $trans_type), 0, 1);
display_note(print_document_link($order_no, _("&Email This Order"), true, $trans_type, false, "printlink", "", 1));
hyperlink_params($path_to_root . "/purchasing/po_receive_items.php", _("&Receive Items on this Purchase Order"), "PONumber={$order_no}");
hyperlink_params($_SERVER['PHP_SELF'], _("Enter &Another Purchase Order"), "NewOrder=yes");
hyperlink_no_params($path_to_root . "/purchasing/inquiry/po_search.php", _("Select An &Outstanding Purchase Order"));
display_footer_exit();
} elseif (isset($_GET['AddedGRN'])) {
$trans_no = $_GET['AddedGRN'];
$trans_type = ST_SUPPRECEIVE;
display_notification_centered(_("Direct GRN has been entered"));
display_note(get_trans_view_str($trans_type, $trans_no, _("&View this GRN")), 0);
$clearing_act = get_company_pref('grn_clearing_act');
if ($clearing_act) {
display_note(get_gl_view_str($trans_type, $trans_no, _("View the GL Journal Entries for this Delivery")), 1);
}
// not yet
// display_note(print_document_link($trans_no, _("&Print This GRN"), true, $trans_type), 0, 1);
hyperlink_params("{$path_to_root}/purchasing/supplier_invoice.php", _("Entry purchase &invoice for this receival"), "New=1");
hyperlink_params("{$path_to_root}/admin/attachments.php", _("Add an Attachment"), "filterType={$trans_type}&trans_no={$trans_no}");
hyperlink_params($_SERVER['PHP_SELF'], _("Enter &Another GRN"), "NewGRN=Yes");
display_footer_exit();
} elseif (isset($_GET['AddedPI'])) {
$trans_no = $_GET['AddedPI'];
$trans_type = ST_SUPPINVOICE;
display_notification_centered(_("Direct Purchase Invoice has been entered"));
display_note(get_trans_view_str($trans_type, $trans_no, _("&View this Invoice")), 0);
// not yet
示例12: print_statements
function print_statements()
{
global $path_to_root, $systypes_array;
include_once $path_to_root . "/reporting/includes/pdf_report2.inc";
$from = date2sql($_POST['PARAM_0']);
$to = date2sql($_POST['PARAM_1']);
$customer = $_POST['PARAM_2'];
$currency = $_POST['PARAM_3'];
$email = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$orientation = $_POST['PARAM_6'];
$orientation = $orientation ? 'L' : 'P';
$dec = 2;
$cols = array(4, 64, 180, 250, 300, 350, 400, 480);
//$headers in doctext.inc
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right', 'right');
$params = array('comments' => $comments);
$cur = get_company_pref('curr_default');
$PastDueDays1 = get_company_pref('past_due_days');
$PastDueDays2 = 2 * $PastDueDays1;
if ($email == 0) {
$rep = new FrontReport(_('CUSTOMER ACCOUNT STATEMENT'), "StatementBulk", user_pagesize(), 9, $orientation);
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
$sql = "SELECT b.debtor_no, b.name AS DebtorName, b.address, b.tax_id, b.curr_code, cust.salesman, \n\tcurdate() AS tran_date, CONCAT (d.name, d.name2) AS contactPerson, d.phone, d.phone2 \n\tFROM " . TB_PREF . "debtors_master b INNER JOIN\n" . TB_PREF . "crm_contacts c on b.debtor_no=c.entity_id INNER JOIN " . TB_PREF . "crm_persons d on c.person_id=d.id\nINNER JOIN " . TB_PREF . "cust_branch cust on b.debtor_no=cust.debtor_no";
if ($customer != ALL_TEXT) {
$sql .= " WHERE c.type='customer' and cust.salesman = " . db_escape($customer);
} else {
$sql .= " where c.type='customer' and cust.salesman = " . db_escape($customer) . " ORDER by b.name";
}
$result = db_query($sql, "The customers could not be retrieved");
while ($debtor_row = db_fetch($result)) {
$date = date('Y-m-d');
if ($from != $to) {
// find the latest point where the balance was null
$start = findLatestNullDate($debtor_row['debtor_no'], $from);
// but not earlier than the $to date.
if (date1_greater_date2(sql2date($start), sql2date($to))) {
$start = $to;
}
if (date1_greater_date2(sql2date($from), sql2date($start))) {
$start = $from;
}
} else {
$start = $from;
}
$debtor_row['order_'] = "";
$TransResult = getTransactions($debtor_row['debtor_no'], $start, $date);
$baccount = get_default_bank_account($debtor_row['curr_code']);
$params['bankaccount'] = $baccount['id'];
if (db_num_rows($TransResult) == 0) {
continue;
}
if ($email == 1) {
$rep = new FrontReport("CUSTOMER ACCOUNT STATEMENT", "", user_pagesize(), 9, $orientation);
$rep->title = _('STATEMENT OF ACCOUNT');
$rep->filename = "Statement" . $debtor_row['debtor_no'] . ".pdf";
$rep->Info($params, $cols, null, $aligns);
}
$rep->filename = "ST-" . strtr($debtor_row['DebtorName'], " '", "__") . "--" . strtr(Today(), "/", "-") . ".pdf";
$contacts = get_customer_contacts($debtor_row['debtor_no'], 'invoice');
$rep->SetHeaderType('customheader');
$rep->currency = $cur;
$rep->Font();
$rep->Info(null, $cols, null, $aligns);
$rep->SetCommonData($debtor_row, null, null, $baccount, ST_STATEMENT, $contacts);
$rep->NewPage();
$doctype = ST_STATEMENT;
//$rep->TextCol(0,4,"yeah");
$current = false;
$balance = getInitialBalance($debtor_row['debtor_no'], $start);
if (true || Abs($balance) > 1.0E-6) {
if (Abs($balance) < 1.0E-6) {
$rep->SetTextColor(190, 190, 190);
} else {
if ($balance > 0) {
$rep->SetTextColor(190, 0, 0);
}
}
$rep->SetTextColor(0, 0, 0);
}
$overdue = 0;
$prev = '';
$gross_amount = 0;
$gross_amount2 = 0;
$payment_tot = 0;
$tots = 0;
$discount_amount = 0;
$percent = 0;
while ($transaction_row = db_fetch($TransResult)) {
if ($myrow['IsVoid'] == '') {
$company_data = get_company_prefs();
$branch = get_branch($transaction_row["branch_code"]);
$branch_data = get_branch_accounts($transaction_row['branch_code']);
$dt = get_discount($branch_data['sales_discount_account'], $transaction_row['type'], $transaction_row['trans_no']);
$DisplayTotal = number_format2(Abs($transaction_row["TotalAmount"] + $dt), $dec);
$DisplayAlloc = number_format2($transaction_row["Allocated"], $dec);
$DisplayNet = number_format2($transaction_row["TotalAmount"] - $transaction_row["Allocated"], $dec);
//.........这里部分代码省略.........
示例13: print_subsidiary_ledger
function print_subsidiary_ledger()
{
global $path_to_root, $systypes_array;
$dim = get_company_pref('use_dimension');
$dimension = $dimension2 = 0;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$cat = $_POST['PARAM_2'];
$account = $_POST['PARAM_3'];
$account2 = $_POST['PARAM_4'];
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report2.inc";
}
$orientation = $orientation ? 'L' : 'P';
$rep = new FrontReport(_('Subsidiary Ledger Report'), "SubsidiaryLedger", user_pagesize(), 9, L);
$dec = user_price_dec();
//$headers = array(_('Type'), _('Ref'), _('#'), _('Date'), _('Dimension')." 1", _('Dimension')." 2",
// _('Person/Item'), _('Debit'), _('Credit'), _('Balance'));
//$cols = array(0, 80, 100, 150, 210, 280, 340, 400, 450, 510, 570);
$cols = array(0, 50, 140, 200, 210, 400, 450, 550, 600, 650);
//------------0--1---2-----3----4----5----6----7----8----9----10-------
//-----------------------dim1-dim2-----------------------------------
//-----------------------dim1----------------------------------------
//-------------------------------------------------------------------
$aligns = array('left', 'left', 'left', 'left', 'left', 'right', 'right', 'right', 'right', 'right');
//$headers = array(_('ID'), '', '', '', '', '', '', _('Debit'), _('Credit'), _('Balance'));
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Accounts'), 'from' => $fromacc, 'to' => $fromacc));
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->SetHeaderType('header3');
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
if ($cat == 3) {
$person = get_salesman_name($account);
}
if ($cat == 1) {
$person = get_supplier_name($account);
}
/*$rep->TextCol(0,2, $cat);
$rep->NewLine();*/
$rep->Font('bold');
$rep->TextCol(0, 2, "Name:" . $person);
$rep->NewLine();
$rep->TextCol(0, 1, "ID:");
$rep->TextCol(1, 2, "Src:");
$rep->TextCol(2, 3, "Date:");
$rep->TextCol(4, 5, "Memo:");
$rep->TextCol(5, 6, "Account:");
$rep->TextCol(6, 7, "Debit:");
$rep->TextCol(8, 9, "Credit:");
$rep->Font();
$rep->NewLine(2);
$result = getTransaction($from, $to, $cat, $account, $account2);
$type = '';
while ($myrow = db_fetch($result)) {
if ($myrow['Voided'] == '' && $myrow['amount'] > 0) {
$comments = get_comments_string($myrow['type'], $myrow['type_no']);
$custom = get_custom_no($myrow['type_no'], $myrow['type']);
if ($myrow['type'] == ST_DISBURSEMENT) {
$type = "CD";
}
if ($myrow['type'] == ST_PURCHASEORDER) {
$type = "P.O.";
}
if ($myrow['type'] == ST_SUPPAYMENT) {
$type = "CD";
}
//else
// $type = $systypes_array[$myrow["type"]];
$rep->TextCol(0, 1, "#" . $custom);
$rep->TextCol(1, 2, $type);
$rep->TextCol(2, 3, $myrow['tranDate']);
$rep->TextCol(4, 5, $comments);
$rep->TextCol(5, 6, $myrow['account']);
$dr += $myrow['amount'];
$rep->AmountCol(6, 7, $myrow['amount'], 2);
$rep->NewLine();
} else {
if ($myrow['Voided'] == '' && $myrow['amount'] < 0) {
$cr += $myrow['amount'];
//$rep->AmountCol(8,9, $myrow['amount'], 2);
}
}
}
$rep->NewLine(2);
$rep->Font('bold');
$rep->AmountCol(6, 7, $dr, 2);
$rep->NewLine(2);
$rep->TextCol(1, 2, "Net Activity: ");
$rep->AmountCol(2, 4, $cr, 2);
$rep->End();
}
示例14: print_trial_balance
function print_trial_balance()
{
global $path_to_root;
global $pdeb, $pcre, $cdeb, $ccre, $tdeb, $tcre, $pbal, $cbal, $tbal;
$dim = get_company_pref('use_dimension');
$dimension = $dimension2 = 0;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$zero = $_POST['PARAM_2'];
$balances = $_POST['PARAM_3'];
if ($dim == 2) {
$dimension = $_POST['PARAM_4'];
$dimension2 = $_POST['PARAM_5'];
$comments = $_POST['PARAM_6'];
$orientation = $_POST['PARAM_7'];
$destination = $_POST['PARAM_8'];
} else {
if ($dim == 1) {
$dimension = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$orientation = $_POST['PARAM_6'];
$destination = $_POST['PARAM_7'];
} else {
$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';
$dec = user_price_dec();
$cols2 = array(0, 50, 190, 310, 430, 530);
//-------------0--1---2----3----4----5--
$headers2 = array('', '', _('Brought Forward'), _('This Period'), _('Balance'));
$aligns2 = array('left', 'left', 'left', 'left', 'left');
$cols = array(0, 50, 150, 210, 270, 330, 390, 450, 510, 570);
//------------0--1---2----3----4----5----6----7----8--
$headers = array(_('Account'), _('Account Name'), _('Debit'), _('Credit'), _('Debit'), _('Credit'), _('Debit'), _('Credit'));
$aligns = array('left', 'left', 'right', 'right', 'right', 'right', 'right', 'right');
if ($dim == 2) {
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Dimension') . " 1", 'from' => get_dimension_string($dimension), 'to' => ''), 3 => array('text' => _('Dimension') . " 2", 'from' => get_dimension_string($dimension2), 'to' => ''));
} else {
if ($dim == 1) {
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Dimension'), 'from' => get_dimension_string($dimension), 'to' => ''));
} else {
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to));
}
}
$rep = new FrontReport(_('Trial Balance'), "TrialBalance", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
recalculate_cols($cols2);
}
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2);
$rep->NewPage();
$classresult = get_account_classes(false);
while ($class = db_fetch($classresult)) {
$rep->Font('bold');
$rep->TextCol(0, 1, $class['cid']);
$rep->TextCol(1, 4, $class['class_name']);
$rep->Font();
$rep->NewLine();
//Get Account groups/types under this group/type with no parents
$typeresult = get_account_types(false, $class['cid'], -1);
while ($accounttype = db_fetch($typeresult)) {
display_type($accounttype["id"], $accounttype["name"], $dec, $rep, $from, $to, $zero, $balances, $dimension, $dimension2);
}
$rep->NewLine();
}
$rep->Line($rep->row);
$rep->NewLine();
$rep->Font('bold');
if ($balances == 0) {
$rep->TextCol(0, 2, _("Total"));
$rep->AmountCol(2, 3, $pdeb, $dec);
$rep->AmountCol(3, 4, $pcre, $dec);
$rep->AmountCol(4, 5, $cdeb, $dec);
$rep->AmountCol(5, 6, $ccre, $dec);
$rep->AmountCol(6, 7, $tdeb, $dec);
$rep->AmountCol(7, 8, $tcre, $dec);
$rep->NewLine();
}
$rep->TextCol(0, 2, _("Ending Balance"));
if ($pbal >= 0.0) {
$rep->AmountCol(2, 3, $pbal, $dec);
} else {
$rep->AmountCol(3, 4, abs($pbal), $dec);
}
if ($cbal >= 0.0) {
$rep->AmountCol(4, 5, $cbal, $dec);
} else {
$rep->AmountCol(5, 6, abs($cbal), $dec);
}
if ($tbal >= 0.0) {
$rep->AmountCol(6, 7, $tbal, $dec);
//.........这里部分代码省略.........
示例15: print_GL_transactions
function print_GL_transactions()
{
global $path_to_root, $systypes_array;
$dim = get_company_pref('use_dimension');
$dimension = $dimension2 = 0;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$fromacc = $_POST['PARAM_2'];
$toacc = $_POST['PARAM_3'];
if ($dim == 2) {
$dimension = $_POST['PARAM_4'];
$dimension2 = $_POST['PARAM_5'];
$comments = $_POST['PARAM_6'];
$orientation = $_POST['PARAM_7'];
$destination = $_POST['PARAM_8'];
} else {
if ($dim == 1) {
$dimension = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
$orientation = $_POST['PARAM_6'];
$destination = $_POST['PARAM_7'];
} else {
$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';
$rep = new FrontReport(_('GL Account Transactions'), "GLAccountTransactions", user_pagesize(), 9, $orientation);
$dec = 2;
//$cols = array(0, 80, 100, 150, 210, 280, 340, 400, 450, 510, 570);
$cols = array(0, 65, 105, 125, 175, 230, 290, 345, 405, 465, 525);
//------------0--1---2---3----4----5----6----7----8----9----10-------
//-----------------------dim1-dim2-----------------------------------
//-----------------------dim1----------------------------------------
//-------------------------------------------------------------------
$aligns = array('left', 'left', 'left', 'left', 'left', 'left', 'left', 'right', 'right', 'right');
if ($dim == 2) {
$headers = array(_('Type'), _('Ref'), _('#'), _('Date'), _('Dimension') . " 1", _('Dimension') . " 2", _('Person/Item'), _('Debit'), _('Credit'), _('Balance'));
} elseif ($dim == 1) {
$headers = array(_('Type'), _('Ref'), _('#'), _('Date'), _('Dimension'), "", _('Person/Item'), _('Debit'), _('Credit'), _('Balance'));
} else {
$headers = array(_('Type'), _('Ref'), _('#'), _('Date'), "", "", _('Person/Item'), _('Debit'), _('Credit'), _('Balance'));
}
if ($dim == 2) {
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Accounts'), 'from' => $fromacc, 'to' => $toacc), 3 => array('text' => _('Dimension') . " 1", 'from' => get_dimension_string($dimension), 'to' => ''), 4 => array('text' => _('Dimension') . " 2", 'from' => get_dimension_string($dimension2), 'to' => ''));
} else {
if ($dim == 1) {
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Accounts'), 'from' => $fromacc, 'to' => $toacc), 3 => array('text' => _('Dimension'), 'from' => get_dimension_string($dimension), 'to' => ''));
} else {
$params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Accounts'), 'from' => $fromacc, 'to' => $toacc));
}
}
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
$accounts = get_gl_accounts($fromacc, $toacc);
while ($account = db_fetch($accounts)) {
if (is_account_balancesheet($account["account_code"])) {
$begin = "";
} else {
$begin = get_fiscalyear_begin_for_date($from);
if (date1_greater_date2($begin, $from)) {
$begin = $from;
}
$begin = add_days($begin, -1);
}
$prev_balance = get_gl_balance_from_to($begin, $from, $account["account_code"], $dimension, $dimension2);
$trans = get_gl_transactions($from, $to, -1, $account['account_code'], $dimension, $dimension2);
$rows = db_num_rows($trans);
if ($prev_balance == 0.0 && $rows == 0) {
continue;
}
$rep->Font('bold');
$rep->TextCol(0, 4, $account['account_code'] . " " . $account['account_name'], -2);
$rep->TextCol(4, 6, _('Opening Balance'));
if ($prev_balance > 0.0) {
$rep->AmountCol(7, 8, abs($prev_balance), $dec);
} else {
$rep->AmountCol(8, 9, abs($prev_balance), $dec);
}
$rep->Font();
$total = $prev_balance;
$rep->NewLine(2);
if ($rows > 0) {
while ($myrow = db_fetch($trans)) {
$total += $myrow['amount'];
$type_name = $systypes_array[$myrow["type"]];
if ($type_name == "Customer Payment") {
$rep->TextCol(0, 1, "CRB", -2);
}
if ($type_name == "Cash Disbursement/Check Voucher") {
//.........这里部分代码省略.........