function p_before($codigo)
 {
     if (get("transaccion") == "INSERT") {
         if (get("metodo") == "Asiento_Cab") {
             #InsAsientodet($codigo);//Crea detalle
             Asiento('Editar', $codigo, 0);
         }
         if (get("metodo") == "AsientoDet") {
             #$CodigoCab=UpdateCampos($codigo);//Crea detalle
             Asiento('Editar', $CodigoCab, 0);
         }
     }
 }
        }
    }
    function p_before($codigo)
    {
    }
    if (get("TipoDato") == "texto") {
        if (get("transaccion") == "UPDATE") {
            if (get("metodo") == "Asiento") {
                p_gf_ult("Asiento", get('CodigoPD'), $ConexionEmpresa);
                Asiento("Listado");
            }
        }
        if (get("transaccion") == "INSERT") {
            if (get("metodo") == "Asiento") {
                p_gf_ult("Asiento", "", $ConexionEmpresa);
                Asiento("Listado");
            }
        }
    }
    if (get("transaccion") == "DELETE") {
        if (get("metodo") == "Entidades") {
            DReg("Entidad", "Codigo", "'" . get("codEnt") . "'", $ConexionEmpresa);
            Entidades("Listado");
        }
    }
    exit;
}
function Asiento($Arg)
{
    global $ConexionEmpresa, $enlace;
    switch ($Arg) {
Example #3
0
            if (get("metodo") == "AsientoDet") {
                p_gf_ult("AsientoDet", "", $ConexionEmpresa);
                Asiento("ListadoDet");
            }
        }
        if (get("transaccion") == "OTRO") {
        }
    }
    if (get("transaccion") == "DELETE") {
        if (get("metodo") == "Asiento") {
            DReg("ct_asiento", "Codigo", "'" . get("codAsi") . "'", $ConexionEmpresa);
            Asiento("Listado");
        }
        if (get("metodo") == "AsientoDet") {
            DReg("ct_asiento_det", "Codigo", "'" . get("codAsiDet") . "'", $ConexionEmpresa);
            Asiento("ListadoDet");
        }
    }
    exit;
}
function Reporte($Arg)
{
    global $ConexionEmpresa, $enlace;
    switch ($Arg) {
        case "Reporte1":
            $reporte = array('1' => 'SELECT DISTINCT YEAR(EMISION) AS COD, CONCAT("AÑO"," : ",YEAR(emision)) AS GRUPO,CONCAT("TOTAL ",year(emision),": ",(SELECT SUM(TOTAL) FROM ct_registro_ventas where year(emision)=COD)) FROM ct_registro_ventas', '2' => 'SELECT DISTINCT MONTH(EMISION) AS COD, CONCAT("MES"," : ",DATE_FORMAT(EMISION,"%M")) AS GRUPO,CONCAT("TOTAL ",DATE_FORMAT(EMISION,"%M")," : ",(SELECT SUM(TOTAL) FROM ct_registro_ventas where month(emision)=COD)) FROM ct_registro_ventas where year(emision)', '3' => 'SELECT DISTINCT EMISION AS COD, CONCAT("DIA"," : ",DATE_FORMAT(emision,"%W %d")) as GRUPO,CONCAT("TOTAL  ",DATE_FORMAT(EMISION,"%W %d")," : ",(SELECT SUM(TOTAL) FROM ct_registro_ventas where emision=COD)) FROM ct_registro_ventas where month(emision)');
            $url = $enlace . '?Reporte=Reporte1';
            $i = get('i');
            $cod = get('cod');
            $titulo = 'Reporte de Registro de Ventas por Fechas';
            $rep = reporte_multinivel_sql($reporte, $i, $cod, $ConexionEmpresa, $url, $titulo);