コード例 #1
0
ファイル: enter_trans.php プロジェクト: k9ert/ac4ngos
    if ($vr_tp == "DB") {
        $ac_array = get_ac5_sc_array("5(1/2)", "");
    } elseif ($vr_tp == "CR") {
        $ac_array = get_ac5_sc_array("5(1/2)", "");
    } elseif ($vr_tp == "JV") {
        $ac_array = get_ac5_sc_array("5(1/2)", "");
    } else {
        die("Unknown Voucher-type: ({$vr_tp})");
    }
    beginPrettyTable("1", "I call it \"Counterbooking\"");
    ?>
 <tr><td>AccountName</td><td>Narration</td><td>Dept</td><td>Amount</td></tr><?php 
    for ($i = 0; $i < $ac_count; $i++) {
        startRow();
        makePlainDropBox("ac_name_{$i}", $ac_array);
        makePlainTextField("remarks_{$i}", "", "", 20);
        makePlainDropBox("dept_{$i}", $dept_array, $edit["DEPT_ID"]);
        makePlainTextField("amount_{$i}", "");
        endRow();
    }
    $ac_count++;
    makeSpecialSubmitter("moreRows", "onClick='this.form.ac_count.value={$ac_count}'");
    endPrettyTable();
    makeSpecialSubmitter("submit", "onClick='this.form.submitnow.value=\"1\"'");
    closeForm();
    ?>
	</td>
	  </table>
	  <?php 
}
endDocument();
コード例 #2
0
ファイル: remove_voucher.php プロジェクト: k9ert/ac4ngos
            if ($row["VR_TP"] == "CR") {
                die("Requested Voucher is a Credit-Voucher. Credit-Vouchers can't get deleted. Instead, make a Debit-Voucher and correct the mistake!");
            } else {
                if (mysql_fetch_array($result, MYSQL_ASSOC)) {
                    die("more than one Voucher found! Database-integrity is in Danger! Call your System-maintainer!");
                }
            }
        }
        beginPrettyTable("1", "Do you want to Remove this Voucher ?");
        printRow(array("AC_Codes", "VR_TP", "Vr_No", "VR_DT", "PARTY", "NARRATION", "AMOUNT"), "", "1,5");
        $row["VR_DT"] = conv_to_hrd($row["VR_DT"]);
        printRow($row, "something");
        openForm("removevoucher_confirm_form", $PHP_SELF);
        makeHiddenField("remove_confirm", 0);
        makeHiddenField("vr_no", $vr_no);
        makeSpecialSubmitter("yes, remove it!", "this.form.remove_confirm.value=1", 6);
        endPrettyTable();
        mysql_close($db);
    } else {
        ?>
 
	<table cellpadding=5 cellspacing=0 border=0 width='100%'>
	 <tr>
	  <td valign=top width='15%'>
	
           <?php 
        beginPrettyTable("1");
        ?>
	   <tr>
	    <?php 
        echo "<td><a href='not_existing.php'>bad link here</a></td>";
コード例 #3
0
        }
        $amount = $_POST[$field_name];
        $vr_no = get_new_vrno();
        # insert voucher
        $query = $query_part1 . "('{$vr_no}','{$today}','CR','{$ac1}', '{$ac2}','{$ac3}','{$ac4}','{$ac5}','D','','{$amount}','','opening Balance','{$today}','')";
        $result = mysql_query($query, $db);
        checkMySQLError();
        # insert counterbooking
        $query = $query_part1 . "('{$vr_no}','{$today}','CR','0', '5','0','0','0','C','','{$amount}','','opening Balance','{$today}','')";
        $result = mysql_query($query, $db);
        checkMySQLError();
    }
    report(1, "Everything seems to be fine. Check via Bank and Cash Report!");
} else {
    $db = getDBConnection();
    $result = mysql_query("Select * FROM TRANS");
    if (mysql_num_rows($result) != 0) {
        report(0, "Sorry, opening balance can only be performed when you have no Vouchers entered");
    }
    $accounts_array = get_ac5_sc_array("5(1)", "B");
    beginPrettyTable("2", "enter opening balances");
    openForm("openingbalance", $PHP_SELF);
    makeHiddenField("submitnow", 0);
    foreach ($accounts_array as $ac5 => $desc) {
        makeTextField("account_field_" . $ac5, "", $desc);
    }
    makeSpecialSubmitter("submit", "this.form.submitnow.value=\"1\"");
    closeForm();
    endPrettyTable();
}
endDocument();
コード例 #4
0
ファイル: remove_voucher.php プロジェクト: k9ert/ac4ngos
            if ($row["VR_TP"] == "CR") {
                die("Requested Voucher is a Credit-Voucher. Credit-Vouchers can't get deleted. Instead, make a Debit-Voucher and correct the mistake!");
            } else {
                if (mysql_fetch_array($result, MYSQL_ASSOC)) {
                    die("more than one Voucher found! Database-integrity is in Danger! Call your System-maintainer!");
                }
            }
        }
        beginPrettyTable("1", "Do you want to Remove this Voucher ?");
        printRow(array("AC_Codes", "VR_TP", "Vr_No", "VR_DT", "PARTY", "NARRATION", "AMOUNT"), "", "1,5");
        $row["VR_DT"] = conv_to_hrd($row["VR_DT"]);
        printRow($row, "fluct");
        openForm("removevoucher_confirm_form", $PHP_SELF);
        makeHiddenField("remove_confirm", 0);
        makeHiddenField("vr_no", $vr_no);
        makeSpecialSubmitter("yes, remove it!", "onClick='this.form.remove_confirm.value=1'", 6);
        endPrettyTable();
        mysql_close($db);
    } else {
        ?>
 
	<table cellpadding=5 cellspacing=0 border=0 width='100%'>
	 <tr>
	  <td valign=top width='15%'>
	
           <?php 
        beginPrettyTable("1");
        ?>
	   <tr>
	    <?php 
        echo "<td><a href='not_existing.php'>bad link here</a></td>";