コード例 #1
0
<?php

$page_security = 'SA_BANKTRANSVIEW';
$path_to_root = "../..";
include $path_to_root . "/includes/session.inc";
page(_($help_context = "View Bank Deposit"), 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"];
}
// 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 {
コード例 #2
0
function create_cart($type, $trans_no)
{
    global $Refs;
    if (isset($_SESSION['pay_items'])) {
        unset($_SESSION['pay_items']);
    }
    $cart = new items_cart($type);
    $cart->order_id = $trans_no;
    if ($trans_no) {
        $bank_trans = db_fetch(get_bank_trans($type, $trans_no));
        $_POST['bank_account'] = $bank_trans["bank_act"];
        $_POST['PayType'] = $bank_trans["person_type_id"];
        if ($bank_trans["person_type_id"] == PT_CUSTOMER) {
            $trans = get_customer_trans($trans_no, $type);
            $_POST['person_id'] = $trans["debtor_no"];
            $_POST['PersonDetailID'] = $trans["branch_code"];
        } elseif ($bank_trans["person_type_id"] == PT_SUPPLIER) {
            $trans = get_supp_trans($trans_no, $type);
            $_POST['person_id'] = $trans["supplier_id"];
        } elseif ($bank_trans["person_type_id"] == PT_MISC) {
            $_POST['person_id'] = $bank_trans["person_id"];
        } elseif ($bank_trans["person_type_id"] == PT_QUICKENTRY) {
            $_POST['person_id'] = $bank_trans["person_id"];
        } else {
            $_POST['person_id'] = $bank_trans["person_id"];
        }
        $cart->memo_ = get_comments_string($type, $trans_no);
        $cart->tran_date = sql2date($bank_trans['trans_date']);
        $cart->reference = $Refs->get($type, $trans_no);
        $cart->original_amount = $bank_trans['amount'];
        $result = get_gl_trans($type, $trans_no);
        if ($result) {
            while ($row = db_fetch($result)) {
                if (is_bank_account($row['account'])) {
                    // date exchange rate is currenly not stored in bank transaction,
                    // so we have to restore it from original gl amounts
                    $ex_rate = $bank_trans['amount'] / $row['amount'];
                } else {
                    $date = $row['tran_date'];
                    $cart->add_gl_item($row['account'], $row['dimension_id'], $row['dimension2_id'], $row['amount'], $row['memo_']);
                }
            }
        }
        // apply exchange rate
        foreach ($cart->gl_items as $line_no => $line) {
            $cart->gl_items[$line_no]->amount *= $ex_rate;
        }
    } else {
        $cart->reference = $Refs->get_next($cart->trans_type);
        $cart->tran_date = new_doc_date();
        if (!is_date_in_fiscalyear($cart->tran_date)) {
            $cart->tran_date = end_fiscalyear();
        }
    }
    $_POST['memo_'] = $cart->memo_;
    $_POST['ref'] = $cart->reference;
    $_POST['date_'] = $cart->tran_date;
    $_SESSION['pay_items'] =& $cart;
}
コード例 #3
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_BANKTRANSVIEW';
$path_to_root = "../..";
include $path_to_root . "/includes/session.inc";
page(_($help_context = "View Bank 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"];
}
$result = get_bank_trans(ST_BANKTRANSFER, $trans_no);
if (db_num_rows($result) != 2) {
    display_db_error("Bank transfer does not contain two records");
}
$trans1 = db_fetch($result);
$trans2 = db_fetch($result);
if ($trans1["amount"] < 0) {
    $from_trans = $trans1;
    // from trans is the negative one
    $to_trans = $trans2;
} else {
    $from_trans = $trans2;
    $to_trans = $trans1;
}
$company_currency = get_company_currency();
$show_currencies = false;
コード例 #4
0
ファイル: rep210.php プロジェクト: knjy24/FrontAccounting
function print_remittances()
{
    global $path_to_root, $systypes_array;
    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();
    $fno = explode("-", $from);
    $tno = explode("-", $to);
    $from = min($fno[0], $tno[0]);
    $to = max($fno[0], $tno[0]);
    $cols = array(4, 85, 150, 225, 275, 360, 450, 515);
    // $headers in doctext.inc
    $aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right');
    $params = array('comments' => $comments);
    $cur = get_company_Pref('curr_default');
    if ($email == 0) {
        $rep = new FrontReport(_('REMITTANCE'), "RemittanceBulk", user_pagesize(), 9, $orientation);
    }
    if ($orientation == 'L') {
        recalculate_cols($cols);
    }
    for ($i = $from; $i <= $to; $i++) {
        if ($fno[0] == $tno[0]) {
            $types = array($fno[1]);
        } else {
            $types = array(ST_BANKPAYMENT, ST_SUPPAYMENT, ST_SUPPCREDIT);
        }
        foreach ($types as $j) {
            $myrow = get_remittance($j, $i);
            if (!$myrow) {
                continue;
            }
            $res = get_bank_trans($j, $i);
            $baccount = db_fetch($res);
            $params['bankaccount'] = $baccount['bank_act'];
            if ($email == 1) {
                $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
                $rep->title = _('REMITTANCE');
                $rep->filename = "Remittance" . $i . ".pdf";
            }
            $rep->SetHeaderType('Header2');
            $rep->currency = $cur;
            $rep->Font();
            $rep->Info($params, $cols, null, $aligns);
            $contacts = get_supplier_contacts($myrow['supplier_id'], 'invoice');
            $rep->SetCommonData($myrow, null, $myrow, $baccount, ST_SUPPAYMENT, $contacts);
            $rep->NewPage();
            $result = get_allocations_for_remittance($myrow['supplier_id'], $myrow['type'], $myrow['trans_no']);
            $doctype = ST_SUPPAYMENT;
            $total_allocated = 0;
            $rep->TextCol(0, 4, _("As advance / full / part / payment towards:"), -2);
            $rep->NewLine(2);
            while ($myrow2 = db_fetch($result)) {
                $rep->TextCol(0, 1, $systypes_array[$myrow2['type']], -2);
                $rep->TextCol(1, 2, $myrow2['supp_reference'], -2);
                $rep->TextCol(2, 3, sql2date($myrow2['tran_date']), -2);
                $rep->TextCol(3, 4, sql2date($myrow2['due_date']), -2);
                $rep->AmountCol(4, 5, $myrow2['Total'], $dec, -2);
                $rep->AmountCol(5, 6, $myrow2['Total'] - $myrow2['alloc'], $dec, -2);
                $rep->AmountCol(6, 7, $myrow2['amt'], $dec, -2);
                $total_allocated += $myrow2['amt'];
                $rep->NewLine(1);
                if ($rep->row < $rep->bottomMargin + 15 * $rep->lineHeight) {
                    $rep->NewPage();
                }
            }
            $memo = get_comments_string($j, $i);
            if ($memo != "") {
                $rep->NewLine();
                $rep->TextColLines(1, 5, $memo, -2);
            }
            $rep->row = $rep->bottomMargin + 16 * $rep->lineHeight;
            $rep->TextCol(3, 6, _("Total Allocated"), -2);
            $rep->AmountCol(6, 7, $total_allocated, $dec, -2);
            $rep->NewLine();
            $rep->TextCol(3, 6, _("Left to Allocate"), -2);
            $myrow['Total'] *= -1;
            $myrow['ov_discount'] *= -1;
            $rep->AmountCol(6, 7, $myrow['Total'] + $myrow['ov_discount'] - $total_allocated, $dec, -2);
            if (floatcmp($myrow['ov_discount'], 0)) {
                $rep->NewLine();
                $rep->TextCol(3, 6, _("Discount"), -2);
                $rep->AmountCol(6, 7, -$myrow['ov_discount'], $dec, -2);
            }
            $rep->NewLine();
            $rep->Font('bold');
            $rep->TextCol(3, 6, _("TOTAL REMITTANCE"), -2);
            $rep->AmountCol(6, 7, $myrow['Total'], $dec, -2);
            $words = price_in_words($myrow['Total'], ST_SUPPAYMENT);
            if ($words != "") {
                $rep->NewLine(2);
                $rep->TextCol(1, 7, $myrow['curr_code'] . ": " . $words, -2);
            }
            $rep->Font();
            if ($email == 1) {
                $myrow['DebtorName'] = $myrow['supp_name'];
                $rep->End($email);
            }
        }
    }
    if ($email == 0) {
        $rep->End();
    }
}
コード例 #5
0
    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_BANKTRANSVIEW';
$path_to_root = "../..";
include $path_to_root . "/includes/session.inc";
page(_($help_context = "View Bank Payment"), 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"];
}
// 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;
コード例 #6
0
ファイル: gl_payment_view.php プロジェクト: ravenii/guardocs
<?php

$page_security = 1;
$path_to_root = "../..";
include $path_to_root . "/includes/session.inc";
page(tr("View Bank Payment"), 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"];
}
// get the pay-from bank payment info
$result = get_bank_trans(systypes::bank_payment(), $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(tr("GL Payment") . " #{$trans_no}");
echo "<br>";
start_table("{$table_style} width=80%");
if ($show_currencies) {
    $colspan1 = 5;
    $colspan2 = 8;
} else {
    $colspan1 = 3;
コード例 #7
0
ファイル: rep112.php プロジェクト: pthdnq/ivalley-svn
function print_receipts()
{
    global $path_to_root, $systypes_array;
    include_once $path_to_root . "/reporting/includes/pdf_report.inc";
    $from = $_POST['PARAM_0'];
    $to = $_POST['PARAM_1'];
    $currency = $_POST['PARAM_2'];
    $comments = $_POST['PARAM_3'];
    $orientation = $_POST['PARAM_4'];
    if (!$from || !$to) {
        return;
    }
    $orientation = $orientation ? 'L' : 'P';
    $dec = user_price_dec();
    $fno = explode("-", $from);
    $tno = explode("-", $to);
    $from = min($fno[0], $tno[0]);
    $to = max($fno[0], $tno[0]);
    $cols = array(4, 85, 150, 225, 275, 360, 450, 515);
    // $headers in doctext.inc
    $aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right');
    $params = array('comments' => $comments);
    $cur = get_company_Pref('curr_default');
    $rep = new FrontReport(_('RECEIPT'), "ReceiptBulk", user_pagesize(), 9, $orientation);
    if ($orientation == 'L') {
        recalculate_cols($cols);
    }
    $rep->SetHeaderType('Header2');
    $rep->currency = $cur;
    $rep->Font();
    $rep->Info($params, $cols, null, $aligns);
    for ($i = $from; $i <= $to; $i++) {
        if ($fno[0] == $tno[0]) {
            $types = array($fno[1]);
        } else {
            $types = array(ST_BANKDEPOSIT, ST_CUSTPAYMENT);
        }
        foreach ($types as $j) {
            $myrow = get_receipt($j, $i);
            if (!$myrow) {
                continue;
            }
            $res = get_bank_trans($j, $i);
            $baccount = db_fetch($res);
            $params['bankaccount'] = $baccount['bank_act'];
            $contacts = get_branch_contacts($myrow['branch_code'], 'invoice', $myrow['debtor_no']);
            $rep->SetCommonData($myrow, null, $myrow, $baccount, ST_CUSTPAYMENT, $contacts);
            $rep->NewPage();
            $result = get_allocations_for_receipt($myrow['debtor_no'], $myrow['type'], $myrow['trans_no']);
            $doctype = ST_CUSTPAYMENT;
            $total_allocated = 0;
            $rep->TextCol(0, 4, _("As advance / full / part / payment towards:"), -2);
            $rep->NewLine(2);
            while ($myrow2 = db_fetch($result)) {
                $rep->TextCol(0, 1, $systypes_array[$myrow2['type']], -2);
                $rep->TextCol(1, 2, $myrow2['reference'], -2);
                $rep->TextCol(2, 3, sql2date($myrow2['tran_date']), -2);
                $rep->TextCol(3, 4, sql2date($myrow2['due_date']), -2);
                $rep->AmountCol(4, 5, $myrow2['Total'], $dec, -2);
                $rep->AmountCol(5, 6, $myrow2['Total'] - $myrow2['alloc'], $dec, -2);
                $rep->AmountCol(6, 7, $myrow2['amt'], $dec, -2);
                $total_allocated += $myrow2['amt'];
                $rep->NewLine(1);
                if ($rep->row < $rep->bottomMargin + 15 * $rep->lineHeight) {
                    $rep->NewPage();
                }
            }
            $memo = get_comments_string($j, $i);
            if ($memo != "") {
                $rep->NewLine();
                $rep->TextColLines(1, 5, $memo, -2);
            }
            $rep->row = $rep->bottomMargin + 15 * $rep->lineHeight;
            $rep->TextCol(3, 6, _("Total Allocated"), -2);
            $rep->AmountCol(6, 7, $total_allocated, $dec, -2);
            $rep->NewLine();
            $rep->TextCol(3, 6, _("Left to Allocate"), -2);
            $rep->AmountCol(6, 7, $myrow['Total'] - $total_allocated, $dec, -2);
            $rep->NewLine();
            $rep->Font('bold');
            $rep->TextCol(3, 6, _("TOTAL RECEIPT"), -2);
            $rep->AmountCol(6, 7, $myrow['Total'], $dec, -2);
            $words = price_in_words($myrow['Total'], ST_CUSTPAYMENT);
            if ($words != "") {
                $rep->NewLine(1);
                $rep->TextCol(0, 7, $myrow['curr_code'] . ": " . $words, -2);
            }
            $rep->Font();
            $rep->NewLine();
            $rep->TextCol(6, 7, _("Received / Sign"), -2);
            $rep->NewLine();
            $rep->TextCol(0, 2, _("By Cash / Cheque* / Draft No."), -2);
            $rep->TextCol(2, 4, "______________________________", -2);
            $rep->TextCol(4, 5, _("Dated"), -2);
            $rep->TextCol(5, 6, "__________________", -2);
            $rep->NewLine(1);
            $rep->TextCol(0, 2, _("Drawn on Bank"), -2);
            $rep->TextCol(2, 4, "______________________________", -2);
            $rep->TextCol(4, 5, _("Branch"), -2);
            $rep->TextCol(5, 6, "__________________", -2);
            $rep->TextCol(6, 7, "__________________");
        }
    }
    $rep->End();
}
コード例 #8
0
<?php

$page_security = 1;
$path_to_root = "../..";
include $path_to_root . "/includes/session.inc";
page(tr("View Bank 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"];
}
$result = get_bank_trans(systypes::bank_transfer(), $trans_no);
if (db_num_rows($result) != 2) {
    display_db_error("Bank transfer does not contain two records", $sql);
}
$trans1 = db_fetch($result);
$trans2 = db_fetch($result);
if ($trans1["amount"] < 0) {
    $from_trans = $trans1;
    // from trans is the negative one
    $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;
コード例 #9
0
ファイル: gl_deposit_view.php プロジェクト: ravenii/guardocs
<?php

$page_security = 1;
$path_to_root = "../..";
include $path_to_root . "/includes/session.inc";
page(tr("View Bank Deposit"), 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"];
}
// get the pay-to bank payment info
$result = get_bank_trans(systypes::bank_deposit(), $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'] != $company_currency) {
    $show_currencies = true;
}
echo "<center>";
display_heading(tr("GL Deposit") . " #{$trans_no}");
echo "<br>";
start_table("{$table_style} width=80%");
if ($show_currencies) {
    $colspan1 = 5;
    $colspan2 = 8;
} else {
コード例 #10
0
function create_cart($type = 0, $trans_no = 0)
{
    global $Refs;
    if (isset($_SESSION['disbursement_items'])) {
        unset($_SESSION['disbursement_items']);
    }
    $cart = new items_cart($type);
    $cart->order_id = $trans_no;
    if ($trans_no) {
        $bank_trans = db_fetch(get_bank_trans($type, $trans_no));
        //$cart->address = $bank_trans['person_id'];
        $cart->person_id = $bank_trans["person_type_id"];
        $_POST['PayType'] = $cart->person_id;
        if ($bank_trans["person_type_id"] == PT_CUSTOMER) {
            //$trans = get_customer_trans($trans_no, $type);
            //$_POST['person_id'] = $trans["debtor_no"];
            $cart->person_detail_id = $bank_trans["person_id"];
        } elseif ($bank_trans["person_type_id"] == PT_SUPPLIER) {
            $trans = get_supp_trans($trans_no, $type);
            $cart->person_detail_id = $trans["supplier_id"];
        } elseif ($bank_trans["person_type_id"] == PT_MISC) {
            $cart->person_detail_id = $bank_trans["person_id"];
            $cart->address = get_address($type, $trans_no);
        } elseif ($bank_trans["person_type_id"] == PT_IMC) {
            $cart->person_detail_id = $bank_trans["person_id"];
        } elseif ($bank_trans["person_type_id"] == PT_AUTHOR) {
            $cart->person_detail_id = $bank_trans["person_id"];
        } elseif ($bank_trans["person_type_id"] == PT_EMPLOYEE) {
            $cart->person_detail_id = $bank_trans["person_id"];
        } elseif ($bank_trans["person_type_id"] == PT_QUICKENTRY) {
            $cart->person_detail_id = $bank_trans["person_id"];
        } else {
            $cart->person_detail_id = $bank_trans["person_id"];
        }
        $result = get_gl_trans($type, $trans_no);
        if ($result) {
            while ($row = db_fetch($result)) {
                if ($row['amount'] == 0) {
                    continue;
                }
                $date = $row['tran_date'];
                $cart->add_gl_item($row['account'], $row['dimension_id'], $row['dimension2_id'], $row['amount'], $row['memo_']);
            }
        }
        $cart->memo_ = get_comments_string($type, $trans_no);
        $cart->tran_date = sql2date($date);
        $cart->custom_no = get_jv_no($type, $trans_no);
        $cart->check_num = get_check_num($type, $trans_no);
        if ($type == ST_DISBURSEMENT) {
            $voucher_type = 'Check Voucher';
            $cart->reference = $Refs->get(ST_DISBURSEMENT, $trans_no);
        }
        //$_POST['ref_original'] = $cart->reference; // Store for comparison when updating
    } else {
        $cart->reference = $Refs->get_next(ST_DISBURSEMENT);
        $cart->tran_date = new_doc_date();
        if (!is_date_in_fiscalyear($cart->tran_date)) {
            $cart->tran_date = end_fiscalyear();
        }
        //$_POST['ref_original'] = -1;
    }
    $_POST['memo_'] = $cart->memo_;
    $_POST['ref'] = $cart->reference;
    $_POST['date_'] = $cart->tran_date;
    $_POST['cv_no'] = $cart->custom_no;
    /**========MOODLEARNING=======*/
    $_POST['address'] = $cart->address;
    $_POST['check_num'] = $cart->check_num;
    $_POST['PayType'] = $cart->person_id;
    $_POST['person_id'] = $cart->person_detail_id;
    $_POST['settled_amount'] = $cart->settled_amount;
    $_SESSION['disbursement_items'] =& $cart;
}