Ejemplo n.º 1
0
/** Imprime una fila de checkboxes con dos columnas, se le entrega los par�metros en el siguiente orden:
    Etiqueta de la fila, Nombre del campo, Arreglo de opciones, Clase CSS, Si es o no campo requerido, El
    valor que debe estar chequeado por defecto y el Caracter que divide a cada uno de los botones.*/
function print_checkblock($slabel, $sname, $aoptions, $brequired = false, $checkedval = 0, $sdiv = " ")
{
    global $html;
    echo "<tr><td><b>{$slabel}</b>";
    if ($brequired == true) {
        echo "<img src=\"" . $html['imgreq'] . "\" alt=\"Campo Obligatorio\" hspace=3>";
    }
    echo "</td>";
    echo "<td>";
    for ($i = 0; $i < count($aoptions); $i++) {
        if ($checkedval == $aoptions[$i][1]) {
            print_check($aoptions[$i][0], $sname, $aoptions[$i][1], 1);
        } else {
            print_check($aoptions[$i][0], $sname, $aoptions[$i][1]);
        }
        echo $sdiv;
    }
    echo "</td></tr>\n";
}
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = $_POST['PARAM_0'] == $_POST['PARAM_1'] ? 'SA_SUPPTRANSVIEW' : 'SA_SUPPBULKREP';
// ----------------------------------------------------------------
// $ Revision:	2.2 $
// Creator:	Joe Hunt - Based on the new Report Engine by Tom Hallman
// Creator:	Based on Tom Hallman's Report.
// Date:	2010-03-03
// Title:	Printable Check
// ----------------------------------------------------------------
$path_to_root = "..";
include_once $path_to_root . "/includes/session.inc";
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/includes/data_checks.inc";
//----------------------------------------------------------------------------------------------------
print_check();
//----------------------------------------------------------------------------------------------------
function get_remittance($type, $trans_no)
{
    $sql = "SELECT " . TB_PREF . "supp_trans.*, \n   \t\t(" . TB_PREF . "supp_trans.ov_amount+" . TB_PREF . "supp_trans.ov_gst+" . TB_PREF . "supp_trans.ov_discount) AS Total, \n   \t\t" . TB_PREF . "suppliers.supp_name,  " . TB_PREF . "suppliers.supp_account_no,\n   \t\t" . TB_PREF . "suppliers.curr_code, " . TB_PREF . "suppliers.payment_terms, " . TB_PREF . "suppliers.gst_no AS tax_id, \n   \t\t" . TB_PREF . "suppliers.address, " . TB_PREF . "suppliers.contact\n\t\tFROM " . TB_PREF . "supp_trans, " . TB_PREF . "suppliers\n\t\tWHERE " . TB_PREF . "supp_trans.supplier_id = " . TB_PREF . "suppliers.supplier_id\n\t\tAND " . TB_PREF . "supp_trans.type = " . db_escape($type) . "\n\t\tAND " . TB_PREF . "supp_trans.trans_no = " . db_escape($trans_no);
    $result = db_query($sql, "The remittance cannot be retrieved");
    if (db_num_rows($result) == 0) {
        return false;
    }
    return db_fetch($result);
}
function get_allocations_for_remittance($supplier_id, $type, $trans_no)
{
    $sql = get_alloc_supp_sql("amt, supp_reference, trans.alloc", "trans.trans_no = alloc.trans_no_to\n\t\tAND trans.type = alloc.trans_type_to\n\t\tAND alloc.trans_no_from=" . db_escape($trans_no) . "\n\t\tAND alloc.trans_type_from=" . db_escape($type) . "\n\t\tAND trans.supplier_id=" . db_escape($supplier_id), TB_PREF . "supp_allocations as alloc");
    $sql .= " ORDER BY trans_no";
    return db_query($sql, "Cannot retreive alloc to transactions");