Esempio n. 1
0
            $th = array(_("Account Code"), _("Account Description"), _("Dimension"), _("Amount"), _("Memo"));
        } else {
            $th = array(_("Account Code"), _("Account Description"), _("Amount"), _("Memo"));
        }
    }
    table_header($th);
    $k = 0;
    //row colour counter
    $total_amount = 0;
    while ($item = db_fetch($items)) {
        if ($item["account"] != $to_trans["account_code"]) {
            alt_table_row_color($k);
            label_cell($item["account"]);
            label_cell($item["account_name"]);
            if ($dim >= 1) {
                label_cell(get_dimension_string($item['dimension_id'], true));
            }
            if ($dim > 1) {
                label_cell(get_dimension_string($item['dimension2_id'], true));
            }
            amount_cell(-$item["amount"]);
            label_cell($item["memo_"]);
            end_row();
            $total_amount += $item["amount"];
        }
    }
    label_row(_("Total"), number_format2(-$total_amount, user_price_dec()), "colspan=" . (2 + $dim) . " align=right", "align=right");
    end_table(1);
    display_allocations_from($to_trans['person_type_id'], $to_trans['person_id'], 2, $trans_no, $to_trans['settled_amount']);
}
end_page(true, false, false, ST_BANKDEPOSIT, $trans_no);
Esempio n. 2
0
            $th = array(_("Account Code"), _("Account Description"), _("Amount"), _("Memo"));
        }
    }
    table_header($th);
    $k = 0;
    //row colour counter
    $total_amount = 0;
    while ($item = db_fetch($items)) {
        if ($item["account"] != $from_trans["account_code"]) {
            alt_table_row_color($k);
            label_cell($item["account"]);
            label_cell($item["account_name"]);
            if ($dim >= 1) {
                label_cell(get_dimension_string($item['dimension_id'], true));
            }
            if ($dim > 1) {
                label_cell(get_dimension_string($item['dimension2_id'], true));
            }
            amount_cell($item["amount"]);
            label_cell($item["memo_"]);
            end_row();
            $total_amount += $item["amount"];
        }
    }
    label_row(_("Total"), number_format2($total_amount, user_price_dec()), "colspan=" . (2 + $dim) . " align=right", "align=right");
    end_table(1);
    if (!$voided) {
        display_allocations_from($from_trans['person_type_id'], $from_trans['person_id'], 1, $trans_no, -$from_trans['amount']);
    }
}
end_page(true, false, false, ST_BANKPAYMENT, $trans_no);
Esempio n. 3
0
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);
$total_grn = display_grn_items($supp_trans, 2);
$display_sub_tot = number_format2($total_gl + $total_grn, user_price_dec());
start_table(TABLESTYLE, "width=95%");
label_row(_("Sub Total"), $display_sub_tot, "align=right", "nowrap align=right width=17%");
$tax_items = get_trans_tax_details(ST_SUPPCREDIT, $trans_no);
display_supp_trans_tax_details($tax_items, 1);
$display_total = number_format2(-($supp_trans->ov_amount + $supp_trans->ov_gst), user_price_dec());
label_row("<font color=red>" . _("TOTAL CREDIT NOTE") . "</font", "<font color=red>{$display_total}</font>", "colspan=1 align=right", "nowrap align=right");
end_table(1);
$voided = is_voided_display(ST_SUPPCREDIT, $trans_no, _("This credit note has been voided."));
if (!$voided) {
    display_allocations_from(PT_SUPPLIER, $supp_trans->supplier_id, ST_SUPPCREDIT, $trans_no, -($supp_trans->ov_amount + $supp_trans->ov_gst));
}
end_page(true, false, false, ST_SUPPCREDIT, $trans_no);
Esempio n. 4
0
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);
end_table(1);
$voided = is_voided_display(systypes::cust_payment(), $trans_id, tr("This customer payment has been voided."));
if (!$voided) {
    display_allocations_from(payment_person_types::customer(), $receipt['debtor_no'], systypes::cust_payment(), $trans_id, -$receipt['Total']);
}
end_page(true);
    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 {
    label_cells(_("Payment Type"), $bank_transfer_types[$receipt['BankTransType']], "class='tableheader2'");
}
end_row();
start_row();
if ($show_currencies) {
    label_cells(_("Supplier's Currency"), $receipt['curr_code'], "class='tableheader2'");
}
if ($show_both_amounts) {
    label_cells(_("Amount"), number_format2(-$receipt['Total'], user_price_dec()), "class='tableheader2'");
}
label_cells(_("Reference"), $receipt['ref'], "class='tableheader2'");
end_row();
if ($receipt['ov_discount'] != 0) {
    start_row();
    label_cells(_("Payment Type"), $bank_transfer_types[$receipt['BankTransType']], "class='tableheader2'");
    end_row();
}
comments_display_row(ST_SUPPAYMENT, $trans_no);
end_table(1);
$voided = is_voided_display(ST_SUPPAYMENT, $trans_no, _("This payment has been voided."));
// now display the allocations for this payment
if (!$voided) {
    display_allocations_from(PT_SUPPLIER, $receipt['supplier_id'], ST_SUPPAYMENT, $trans_no, -$receipt['Total']);
}
end_page(true, false, false, ST_SUPPAYMENT, $trans_no);
}
page(_($help_context = "View Customer Payment"), true, false, "", $js);
if (isset($_GET["trans_no"])) {
    $trans_id = $_GET["trans_no"];
}
$receipt = get_customer_trans($trans_id, ST_CUSTPAYMENT);
display_heading(sprintf(_("Customer Payment #%d"), $trans_id));
echo "<br>";
start_table(TABLESTYLE, "width=80%");
start_row();
label_cells(_("From Customer"), $receipt['DebtorName'], "class='tableheader2'");
label_cells(_("Reference"), $receipt['reference'], "class='tableheader2'");
label_cells(_("Date of Deposit"), sql2date($receipt['tran_date']), "class='tableheader2'");
end_row();
start_row();
label_cells(_("Customer Currency"), $receipt['curr_code'], "class='tableheader2'");
label_cells(_("Amount"), price_format($receipt['Total'] - $receipt['ov_discount']), "class='tableheader2'");
label_cells(_("Discount"), price_format($receipt['ov_discount']), "class='tableheader2'");
end_row();
start_row();
label_cells(_("Into Bank Account"), $receipt['bank_account_name'] . ' [' . $receipt['bank_curr_code'] . ']', "class='tableheader2'");
label_cells(_("Bank Amount"), price_format($receipt['bank_amount']), "class='tableheader2'");
label_cells(_("Payment Type"), $bank_transfer_types[$receipt['BankTransType']], "class='tableheader2'");
end_row();
comments_display_row(ST_CUSTPAYMENT, $trans_id);
end_table(1);
$voided = is_voided_display(ST_CUSTPAYMENT, $trans_id, _("This customer payment has been voided."));
if (!$voided) {
    display_allocations_from(PT_CUSTOMER, $receipt['debtor_no'], ST_CUSTPAYMENT, $trans_id, $receipt['Total']);
}
end_page(true, false, false, ST_CUSTPAYMENT, $trans_id);
Esempio n. 7
0
        label_cell($myrow2["units"], "align=right");
        amount_cell($myrow2["unit_price"]);
        label_cell($display_discount, "align=right");
        amount_cell($value);
        end_row();
    }
    //end while there are line items to print out
} else {
    display_note(_("There are no line items on this credit note."), 1, 2);
}
$display_sub_tot = price_format($sub_total);
$credit_total = $myrow["ov_freight"] + $myrow["ov_gst"] + $myrow["ov_amount"] + $myrow["ov_freight_tax"];
$display_total = price_format($credit_total);
/*Print out the invoice text entered */
if ($sub_total != 0) {
    label_row(_("Sub Total"), $display_sub_tot, "colspan=6 align=right", "nowrap align=right width='15%'");
}
if ($myrow["ov_freight"] != 0.0) {
    $display_freight = price_format($myrow["ov_freight"]);
    label_row(_("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right");
}
$tax_items = get_trans_tax_details(ST_CUSTCREDIT, $trans_id);
display_customer_trans_tax_details($tax_items, 6);
label_row("<font color=red>" . _("TOTAL CREDIT") . "</font", "<font color=red>{$display_total}</font>", "colspan=6 align=right", "nowrap align=right");
end_table(1);
$voided = is_voided_display(ST_CUSTCREDIT, $trans_id, _("This credit note has been voided."));
if (!$voided) {
    display_allocations_from(PT_CUSTOMER, $myrow['debtor_no'], ST_CUSTCREDIT, $trans_id, $credit_total);
}
/* end of check to see that there was an invoice record to print */
end_page(true, false, false, ST_CUSTCREDIT, $trans_id);
Esempio n. 8
0
        label_cell($myrow2["StockDescription"]);
        qty_cell($myrow2["quantity"]);
        label_cell($myrow2["units"], "align=right");
        amount_cell($myrow2["unit_price"]);
        label_cell($display_discount, "align=right");
        amount_cell($value);
        end_row();
    }
    //end while there are line items to print out
} else {
    display_note(tr("There are no line items on this credit note."), 1, 2);
}
$display_sub_tot = price_format($sub_total);
$display_freight = price_format($myrow["ov_freight"]);
$credit_total = $myrow["ov_freight"] + $myrow["ov_gst"] + $myrow["ov_amount"] + $myrow["ov_freight_tax"];
$display_total = price_format($credit_total);
/*Print out the invoice text entered */
if ($sub_total != 0) {
    label_row(tr("Sub Total"), $display_sub_tot, "colspan=6 align=right", "nowrap align=right width=15%");
}
label_row(tr("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right");
$tax_items = get_customer_trans_tax_details(11, $trans_id);
display_customer_trans_tax_details($tax_items, 6);
label_row("<font color=red>" . tr("TOTAL CREDIT") . "</font", "<font color=red>{$display_total}</font>", "colspan=6 align=right", "nowrap align=right");
end_table(1);
$voided = is_voided_display(11, $trans_id, tr("This credit note has been voided."));
if (!$voided) {
    display_allocations_from(payment_person_types::customer(), $myrow['debtor_no'], 11, $trans_id, $credit_total);
}
/* end of check to see that there was an invoice record to print */
end_page(true);
Esempio n. 9
0
echo "<br>";
start_table("{$table_style2} width=80%");
start_row();
label_cells(tr("To Supplier"), $receipt['supplier_name'], "class='tableheader2'");
label_cells(tr("From Bank Account"), $receipt['bank_account_name'], "class='tableheader2'");
label_cells(tr("Date Paid"), sql2date($receipt['tran_date']), "class='tableheader2'");
end_row();
start_row();
if ($show_currencies) {
    label_cells(tr("Payment Currency"), $receipt['bank_curr_code'], "class='tableheader2'");
}
label_cells(tr("Amount"), number_format2(-$receipt['BankAmount'], user_price_dec()), "class='tableheader2'");
label_cells(tr("Payment Type"), $receipt['BankTransType'], "class='tableheader2'");
end_row();
start_row();
if ($show_currencies) {
    label_cells(tr("Supplier's Currency"), $receipt['SupplierCurrCode'], "class='tableheader2'");
}
if ($show_both_amounts) {
    label_cells(tr("Amount"), number_format2(-$receipt['ov_amount'], user_price_dec()), "class='tableheader2'");
}
label_cells(tr("Reference"), $receipt['ref'], "class='tableheader2'");
end_row();
comments_display_row(22, $trans_no);
end_table(1);
$voided = is_voided_display(22, $trans_no, tr("This payment has been voided."));
// now display the allocations for this payment
if (!$voided) {
    display_allocations_from(payment_person_types::supplier(), $receipt['supplier_id'], 22, $trans_no, -$receipt['ov_amount']);
}
end_page(true);
Esempio n. 10
0
echo "<br>";
start_table($table_style2);
start_row();
label_cells(tr("Supplier"), $supp_trans->supplier_name, "class='tableheader2'");
label_cells(tr("Reference"), $supp_trans->reference, "class='tableheader2'");
label_cells(tr("Supplier's Reference"), $supp_trans->supp_reference, "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Invoice Date"), $supp_trans->tran_date, "class='tableheader2'");
label_cells(tr("Due Date"), $supp_trans->due_date, "class='tableheader2'");
label_cells(tr("Currency"), get_supplier_currency($supp_trans->supplier_id), "class='tableheader2'");
end_row();
comments_display_row(21, $trans_no);
end_table(1);
$total_gl = display_gl_items($supp_trans, 3);
$total_grn = display_grn_items($supp_trans, 2);
$display_sub_tot = number_format2($total_gl + $total_grn, user_price_dec());
start_table("{$table_style} width=95%");
label_row(tr("Sub Total"), $display_sub_tot, "align=right", "nowrap align=right width=17%");
$tax_items = get_supp_invoice_tax_items(21, $trans_no);
display_supp_trans_tax_details($tax_items, 1);
$display_total = number_format2(-($supp_trans->ov_amount + $supp_trans->ov_gst), user_price_dec());
label_row(tr("TOTAL CREDIT NOTE"), $display_total, "colspan=1 align=right", "nowrap align=right");
end_table(1);
$voided = is_voided_display(21, $trans_no, tr("This credit note has been voided."));
if (!$voided) {
    $tax_total = 0;
    // ??????
    display_allocations_from(payment_person_types::supplier(), $supp_trans->supplier_id, 21, $trans_no, -($supp_trans->ov_amount + $tax_total));
}
end_page(true);