Como cambiar a IVA18 con módulos 2.1

22 views
Skip to first unread message

Russo

unread,
Aug 7, 2010, 7:53:13 AM8/7/10
to abanq
Después de pelearme con el, al final he conseguido que aparezca el IVA
al 18% en la factura.
El procedimiento que he seguido es:
* Crear un nuevo IVA, IVA18 con el 18%
* Modificar el report de la factura
* Modificar el script de la factura

Modificar el report de la factura:
Editar el archivo i_facturascli.kut, yo lo he hecho con un editor de
texto.
Modificar donde pone <!--16%--> y sustituir por:

<!--18%-->
<CalculatedField WordWrap="0" CalculationType="6"
FunctionName="flfactinfo.pub_datosPieFactura" Width="100" X="60"
Y="95" BorderStyle="0" NegValueColor="0,0,0" Height="20"
HAlignment="2" DataType="2" Field="BI18" DateFormat="11" Currency="32"
BorderColor="0,0,0" BackgroundColor="255,255,255" FontItalic="0"
VAlignment="1" ForegroundColor="0,0,0" CommaSeparator="44" Text=""
FontWeight="50" FontSize="10" BorderWidth="1" Precision="2"
FontFamily="Arial Narrow" />
<Label WordWrap="0" Width="30" X="195" Y="95" BorderStyle="0"
Height="20" HAlignment="2" BorderColor="0,0,0"
BackgroundColor="255,255,255" FontItalic="0" VAlignment="1"
ForegroundColor="0,0,0" Text="18%" FontWeight="65" FontSize="9"
BorderWidth="1" FontFamily="Arial" />
<CalculatedField WordWrap="0" CalculationType="6"
FunctionName="flfactinfo.pub_datosPieFactura" Width="70" X="235"
Y="95" BorderStyle="0" NegValueColor="0,0,0" Height="20"
HAlignment="2" DataType="2" Field="IVA18" DateFormat="11"
Currency="32" BorderColor="0,0,0" BackgroundColor="255,255,255"
FontItalic="0" VAlignment="1" ForegroundColor="0,0,0"
CommaSeparator="44" Text="" FontWeight="50" FontSize="10"
BorderWidth="1" Precision="2" FontFamily="Arial Narrow" />
<CalculatedField WordWrap="0" CalculationType="6"
FunctionName="flfactinfo.pub_datosPieFactura" Width="30" X="335"
Y="95" BorderStyle="0" NegValueColor="0,0,0" Height="20"
HAlignment="2" DataType="0" Field="POR_RE18" DateFormat="11"
Currency="32" BorderColor="0,0,0" BackgroundColor="255,255,255"
FontItalic="0" VAlignment="1" ForegroundColor="0,0,0"
CommaSeparator="44" Text="" FontWeight="65" FontSize="9"
BorderWidth="1" Precision="2" FontFamily="Arial Narrow" />
<CalculatedField WordWrap="0" CalculationType="6"
FunctionName="flfactinfo.pub_datosPieFactura" Width="80" X="365"
Y="95" BorderStyle="0" NegValueColor="0,0,0" Height="20"
HAlignment="2" DataType="0" Field="RE18" DateFormat="11" Currency="32"
BorderColor="0,0,0" BackgroundColor="255,255,255" FontItalic="0"
VAlignment="1" ForegroundColor="0,0,0" CommaSeparator="44" Text=""
FontWeight="50" FontSize="10" BorderWidth="1" Precision="2"
FontFamily="Arial Narrow" />
<CalculatedField WordWrap="0" CalculationType="6"
FunctionName="flfactinfo.pub_datosPieFactura" Width="110" X="460"
Y="95" BorderStyle="0" NegValueColor="0,0,0" Height="20"
HAlignment="2" DataType="2" Field="T18" DateFormat="11" Currency="32"
BorderColor="0,0,0" BackgroundColor="255,255,255" FontItalic="0"
VAlignment="1" ForegroundColor="0,0,0" CommaSeparator="44" Text=""
FontWeight="50" FontSize="10" BorderWidth="1" Precision="2"
FontFamily="Arial Narrow" />

Con ésto hemos creado varios campos adicionales en el report, BI18,
IVA18, POR_RE18, RE18 y T18.

Ahora modificamos el script flfactinfo.qs para agregar esos campos,
concretamente la funcion "oficial_datosPieFactura"
Sustituimos desde la línea que pone "if (campo == "BI4")
{" (incluyendo ésta) hasta la línea que pone "if (parseFloat(res) ==
0 || !res)" (sin incluirla) por lo siguiente:

if (campo == "BI4") {
res = util.sqlSelect(tablaIva, "neto", "idfactura = " + idFactura
+ " AND iva = 4");
} else if (campo == "BI7") {
res = util.sqlSelect(tablaIva, "neto", "idfactura = " + idFactura
+ " AND iva = 7");
} else if (campo == "BI16") {
res = util.sqlSelect(tablaIva, "neto", "idfactura = " + idFactura
+ " AND iva = 16");
} else if (campo == "BI18") {
res = util.sqlSelect(tablaIva, "neto",
"idfactura = " + idFactura + " AND iva = 18");
} else if (campo == "IVA4") {
res = util.sqlSelect(tablaIva, "totaliva", "idfactura = " +
idFactura + " AND iva = 4");
} else if (campo == "IVA7") {
res = util.sqlSelect(tablaIva, "totaliva", "idfactura = " +
idFactura + " AND iva = 7");
} else if (campo == "IVA16") {
res = util.sqlSelect(tablaIva, "totaliva", "idfactura = " +
idFactura + " AND iva = 16");
} else if (campo == "IVA18") {
res = util.sqlSelect(tablaIva,
"totaliva", "idfactura = " + idFactura + " AND iva = 18");
} else if (campo == "POR_RE4") {
res = util.sqlSelect(tablaIva, "recargo", "idfactura = " +
idFactura + " AND iva = 4");
if (res && parseFloat(res) != 0)
res += "%";
} else if (campo == "POR_RE7") {
res = util.sqlSelect(tablaIva, "recargo", "idfactura = " +
idFactura + " AND iva = 7");
if (res && parseFloat(res) != 0)
res += "%";
} else if (campo == "POR_RE16") {
res = util.sqlSelect(tablaIva, "recargo", "idfactura = " +
idFactura + " AND iva = 16");
if (res && parseFloat(res) != 0)
res += "%";
} else if (campo == "POR_RE18") {
res = util.sqlSelect(tablaIva,
"recargo", "idfactura = " + idFactura + " AND iva = 18");
if (res && parseFloat(res) != 0)
res += "%";

} else if (campo == "RE4") {
res = util.sqlSelect(tablaIva, "totalrecargo", "idfactura = " +
idFactura + " AND iva = 4");
if (parseFloat(res) != 0)
res = util.buildNumber(res, "f", 2);
} else if (campo == "RE7") {
res = util.sqlSelect(tablaIva, "totalrecargo", "idfactura = " +
idFactura + " AND iva = 7");
if (parseFloat(res) != 0)
res = util.buildNumber(res, "f", 2);
} else if (campo == "RE16") {
res = util.sqlSelect(tablaIva, "totalrecargo", "idfactura = " +
idFactura + " AND iva = 16");
if (parseFloat(res) != 0)
res = util.buildNumber(res, "f", 2);
} else if (campo == "RE18") {
res = util.sqlSelect(tablaIva,
"totalrecargo", "idfactura = " + idFactura + " AND iva = 18");
if (parseFloat(res) != 0)
res =
util.buildNumber(res, "f", 2);

} else if (campo == "T4") {
res = util.sqlSelect(tablaIva,
"totallinea", "idfactura = " + idFactura + " AND iva = 4");
} else if (campo == "T7") {
res = util.sqlSelect(tablaIva, "totallinea", "idfactura = " +
idFactura + " AND iva = 7");
} else if (campo == "T16") {
res = util.sqlSelect(tablaIva, "totallinea", "idfactura = " +
idFactura + " AND iva = 16");
} else if (campo == "T18") {
res = util.sqlSelect(tablaIva,
"totallinea", "idfactura = " + idFactura + " AND iva = 18");

}


Básicamente lo que he hecho ha sido agregar varios if para generar los
campos *18 del report.

Solo he creado el IVA18 que es lo que utilizo, para cambiar el IVA8
hay que hacer lo mismo.


De momento solo he cambiado el report de la factura, pero supongo que
para los pedidos, presupuestos, etc será exactamente igual.


Espero que le sirva a alguien !!

salu2



Reply all
Reply to author
Forward
0 new messages