Example #1
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);
if (isset($_POST['AddItem'])) {
    handle_new_item();
}
if (isset($_POST['UpdateItem'])) {
    handle_update_item();
}
if (isset($_POST['CancelItemChanges'])) {
    line_start_focus();
}
if (isset($_POST['go'])) {
    display_quick_entries($_SESSION['pay_items'], $_POST['person_id'], input_num('totamount'), $_SESSION['pay_items']->trans_type == ST_BANKPAYMENT ? QE_PAYMENT : QE_DEPOSIT);
    $_POST['totamount'] = price_format(0);
    $Ajax->activate('totamount');
    line_start_focus();
}
//-----------------------------------------------------------------------------------------------
start_form();
display_bank_header($_SESSION['pay_items']);
start_table(TABLESTYLE2, "width=90%", 10);
start_row();
echo "<td>";
display_gl_items($_SESSION['pay_items']->trans_type == ST_BANKPAYMENT ? _("Payment Items") : _("Deposit Items"), $_SESSION['pay_items']);
gl_options_controls($_SESSION['pay_items']);
echo "</td>";
end_row();
end_table(1);
submit_center_first('Update', _("Update"), '', null);
submit_center_last('Process', $_SESSION['pay_items']->trans_type == ST_BANKPAYMENT ? _("Process Payment") : _("Process Deposit"), '', 'default');
end_form();
//------------------------------------------------------------------------------------------------
end_page();
Example #3
0
    unset($_SESSION['supp_trans']);
    meta_forward($_SERVER['PHP_SELF'], "AddedID={$invoice_no}");
}
//--------------------------------------------------------------------------------------------------
if (isset($_POST['PostInvoice'])) {
    handle_commit_invoice();
}
//--------------------------------------------------------------------------------------------------
start_form(false, true);
start_table("{$table_style2} width=80%", 8);
echo "<tr><td valign=center>";
// outer table
echo "<center>";
invoice_header($_SESSION['supp_trans']);
echo "</td></tr><tr><td valign=center>";
// outer table
echo "<center>";
display_grn_items($_SESSION['supp_trans']);
display_gl_items($_SESSION['supp_trans']);
//echo "</td></tr><tr><td align=center colspan=2>"; // outer table
echo "<br>";
invoice_totals($_SESSION['supp_trans']);
echo "</td></tr>";
end_table();
// outer table
echo "<br>";
submit_center('PostInvoice', tr("Enter Invoice"));
echo "<br>";
end_form();
//--------------------------------------------------------------------------------------------------
end_page();
Example #4
0
}
if (isset($_POST['AddItem'])) {
    handle_new_item();
}
if (isset($_POST['UpdateItem'])) {
    handle_update_item();
}
if (isset($_POST['CancelItemChanges'])) {
    line_start_focus();
}
if (isset($_POST['go'])) {
    display_quick_entries($_SESSION['journal_items'], $_POST['person_id'], input_num('totamount'), QE_JOURNAL);
    $_POST['totamount'] = price_format(0);
    $Ajax->activate('totamount');
    line_start_focus();
}
//-----------------------------------------------------------------------------------------------
start_form();
display_order_header($_SESSION['journal_items']);
start_table(TABLESTYLE2, "width='90%'", 10);
start_row();
echo "<td>";
display_gl_items(_("Rows"), $_SESSION['journal_items']);
gl_options_controls();
echo "</td>";
end_row();
end_table(1);
submit_center('Process', _("Process Journal Entry"), true, _('Process journal entry only if debits equal to credits'), 'default');
end_form();
//------------------------------------------------------------------------------------------------
end_page();
Example #5
0
    }
    $invoice_no = add_supp_invoice($_SESSION['supp_trans']);
    $_SESSION['supp_trans']->clear_items();
    unset($_SESSION['supp_trans']);
    meta_forward($_SERVER['PHP_SELF'], "AddedID={$invoice_no}");
}
//--------------------------------------------------------------------------------------------------
if (isset($_POST['PostCreditNote'])) {
    handle_commit_credit_note();
}
//--------------------------------------------------------------------------------------------------
start_form(false, true);
start_table("{$table_style} width=80%", 8);
echo "<tr><td valign=center>";
// outer table
echo "<center>";
invoice_header($_SESSION['supp_trans']);
echo "</td></tr><tr><td valign=center>";
// outer table
$total_grn_value = display_grn_items($_SESSION['supp_trans']);
$total_gl_value = display_gl_items($_SESSION['supp_trans']);
echo "</td></tr><tr><td align=center colspan=2>";
// outer table
invoice_totals($_SESSION['supp_trans']);
echo "</td></tr>";
end_table(1);
// outer table
submit_center('PostCreditNote', tr("Enter Credit Note"));
echo "<br><br>";
end_form();
end_page();
Example #6
0
}
if (isset($_POST['AddItem'])) {
    handle_new_item();
}
if (isset($_POST['UpdateItem'])) {
    handle_update_item();
}
//-----------------------------------------------------------------------------------------------
if (isset($_GET['NewDeposit']) || !isset($_SESSION['deposit_items'])) {
    handle_new_order();
}
//-----------------------------------------------------------------------------------------------
start_form(false, true);
display_order_header($_SESSION['deposit_items']);
start_table("{$table_style} width=90%", 10);
start_row();
echo "<td>";
display_gl_items(tr("Deposit Items"), $_SESSION['deposit_items']);
gl_options_controls();
echo "</td>";
end_row();
end_table(1);
if (!isset($_POST['Process'])) {
    submit_center_first('Update', tr("Update"));
    if ($_SESSION['deposit_items']->count_gl_items() >= 1) {
        submit_center_last('Process', tr("Process Deposit"));
    }
}
end_form();
//------------------------------------------------------------------------------------------------
end_page();
if ($bank_currency != $supplier_currency) {
    amount_row(_("Bank Amount:"), 'bank_amount', null, '', $bank_currency, 2);
}
amount_row(_("Bank Charge:"), 'charge', null, '', $bank_currency);
end_outer_table(1);
div_start('alloc_tbl');
show_allocatable(false);
div_end();
start_table(TABLESTYLE, "width=60%");
amount_row(_("Amount of Discount:"), 'discount', null, '', $supplier_currency);
amount_row(_("Amount of Payment:"), 'payment', null, '', $supplier_currency);
hidden("p2", $_POST['p2']);
textarea_row(_("Memo:"), 'memo_', null, 22, 4);
end_table(1);
br();
if ($_POST['supplier_id'] == '') {
    display_error(_("There is no supplier selected."));
} else {
    $b = str_replace(',', '', get_post('payment'));
    display_gl_items($_SESSION['alloc'], 1);
    div_start('inv_tot');
    invoice_totals($_SESSION['alloc'], $b);
    div_end();
}
if (get_post('AddGLCodeToTrans')) {
    $Ajax->activate('inv_tot');
}
br(2);
submit_center('ProcessSuppPayment', _("Enter Payment"), true, '', 'default');
end_form();
end_page();
Example #8
0
}
if (isset($_POST['AddItem'])) {
    handle_new_item();
}
if (isset($_POST['UpdateItem'])) {
    handle_update_item();
}
//-----------------------------------------------------------------------------------------------
if (isset($_GET['NewPayment']) || !isset($_SESSION['pay_items'])) {
    handle_new_order();
}
//-----------------------------------------------------------------------------------------------
start_form(false, true);
display_order_header($_SESSION['pay_items']);
start_table("{$table_style2} width=90%", 10);
start_row();
echo "<td>";
display_gl_items(tr("Payment Items"), $_SESSION['pay_items']);
gl_options_controls();
echo "</td>";
end_row();
end_table(1);
if (!isset($_POST['Process'])) {
    submit_center_first('Update', tr("Update"));
    if ($_SESSION['pay_items']->count_gl_items() >= 1) {
        submit_center_last('Process', tr("Process Payment"));
    }
}
end_form();
//------------------------------------------------------------------------------------------------
end_page();