コード例 #1
0
ファイル: customer_allocate.php プロジェクト: M-Shahbaz/FA
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();
}
コード例 #2
0
ファイル: exchange_rates.php プロジェクト: ravenii/guardocs
function display_rate_edit()
{
    global $selected_id, $table_style2;
    start_table($table_style2);
    if (isset($_POST['get_rate'])) {
        $_POST['BuyRate'] = exrate_format(get_ecb_rate($_POST['curr_abrev']));
    }
    if ($selected_id != "") {
        //editing an existing exchange rate
        $myrow = get_exchange_rate($selected_id);
        $_POST['date_'] = sql2date($myrow["date_"]);
        $_POST['BuyRate'] = exrate_format($myrow["rate_buy"]);
        hidden('selected_id', $selected_id);
        hidden('date_', $_POST['date_']);
        hidden('curr_abrev', $_POST['curr_abrev']);
        label_row(tr("Date to Use From:"), $_POST['date_']);
    } else {
        date_row(tr("Date to Use From:"), 'date_');
    }
    small_amount_row(tr("Exchange Rate:"), 'BuyRate', null, '', submit('get_rate', tr("Get")), user_exrate_dec());
    end_table(1);
    submit_add_or_update_center($selected_id == "");
    display_note(tr("Exchange rates are entered against the company currency."), 1);
}
コード例 #3
0
ファイル: purchasing_data.php プロジェクト: ravenii/guardocs
    $myrow = db_fetch($result);
    $supp_name = $myrow["supp_name"];
    $_POST['price'] = price_format($myrow["price"]);
    $_POST['suppliers_uom'] = $myrow["suppliers_uom"];
    $_POST['supplier_description'] = $myrow["supplier_description"];
    $_POST['conversion_factor'] = exrate_format($myrow["conversion_factor"]);
}
echo "<br>";
start_table($table_style2);
if (isset($_GET['Edit'])) {
    hidden('supplier_id', $supplier_id);
    label_row(tr("Supplier:"), $supp_name);
} else {
    supplier_list_row(tr("Supplier:"), 'supplier_id', null, false, true);
    $supplier_id = $_POST['supplier_id'];
}
amount_row(tr("Price:"), 'price', null, '', get_supplier_currency($supplier_id));
text_row(tr("Suppliers Unit of Measure:"), 'suppliers_uom', null, 50, 51);
if (!isset($_POST['conversion_factor']) || $_POST['conversion_factor'] == "") {
    $_POST['conversion_factor'] = exrate_format(1);
}
amount_row(tr("Conversion Factor (to our UOM):"), 'conversion_factor', exrate_format($_POST['conversion_factor']), null, null, user_exrate_dec());
text_row(tr("Supplier's Code or Description:"), 'supplier_description', null, 50, 51);
end_table(1);
if (isset($_GET['Edit'])) {
    submit_center('UpdateRecord', tr("Update Purchasing Data"));
} else {
    submit_center('AddRecord', tr("Add Purchasing Data"));
}
end_form();
end_page();