コード例 #1
0
<?php

$page_security = 'SA_FORMSETUP';
$path_to_root = "..";
include $path_to_root . "/includes/session.inc";
page(_($help_context = "Forms Setup"));
include $path_to_root . "/includes/ui.inc";
//-------------------------------------------------------------------------------------------------
if (isset($_POST['setprefs'])) {
    $systypes = get_systypes();
    begin_transaction();
    while ($type = db_fetch($systypes)) {
        save_next_reference($type["type_id"], $_POST['id' . $type["type_id"]]);
    }
    commit_transaction();
    display_notification_centered(_("Forms settings have been updated."));
}
start_form();
start_outer_table(TABLESTYLE2);
$systypes = get_systypes();
table_section(1);
$th = array(_("Form"), _("Next Reference"));
table_header($th);
$i = 0;
while ($type = db_fetch($systypes)) {
    if ($i++ == ST_CUSTCREDIT) {
        table_section(2);
        table_header($th);
    }
    ref_row($systypes_array[$type["type_id"]], 'id' . $type["type_id"], '', $type["next_reference"]);
}
コード例 #2
0
         display_error(_("Error: Could not find dimension with dimension reference '{$dim2_ref}' (line {$line} in import file '{$_FILES['imp']['name']}')"));
         $error = true;
     }
 }
 if ($reference == '') {
     display_error(_("{$line} does not have a reference. (line {$line} in import file '{$_FILES['imp']['name']}')"));
     $error = true;
 }
 if ($Refs->exists($type, $reference) && $reference != $prev_ref) {
     display_error(_("Error: Reference from table 'refs': '{$reference}' is already in use. (line {$line} in import file '{$_FILES['imp']['name']}')"));
     $error = true;
 } elseif ($Refs->exists($type, $reference) && $reference == $prev_ref) {
     //do nothing $Refs->save($type,$line,$reference);
 } elseif ($Refs->exists($type, $reference) == null && $reference != $prev_ref) {
     $Refs->save($type, $curEntryId, $reference);
     save_next_reference($type, $reference);
 }
 if ($type == ST_BANKDEPOSIT || $type == ST_BANKPAYMENT || $type == ST_JOURNAL) {
     $description = get_gl_account_name($code_id);
 }
 if (is_date($date) == false) {
     display_error(_("Error: date '{$date}' not properly formatted (line {$line} in import file '{$_FILES['imp']['name']}')"));
     $error = true;
 }
 //$date = sql2date($date);
 if (is_date_in_fiscalyear($date) == false) {
     display_error(_("Error: Date not within company fiscal year. Make sure date is in dd/mm/yyyy format and your csv years are 4 digits long. Check that current fiscal year is active under Setup..Company Setup"));
     $error = true;
 }
 // validation for
 if ($type == ST_BANKDEPOSIT || $type == ST_BANKPAYMENT) {