785 lines
43 KiB
HTML
785 lines
43 KiB
HTML
<TITLE>Albarán Interno</TITLE>
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>albaranes</TITLE>
|
|
<META NAME="GENERATOR" CONTENT="AdmiSys Sistemas informáticos">
|
|
<META NAME="Author" CONTENT="WebTeam">
|
|
<META NAME="Organization" CONTENT="AdmiSys S.L.">
|
|
<META NAME="Document description" CONTENT="Alta y Modificación de Albaranes Internos">
|
|
<META NAME="Last modified date" CONTENT="Thursday, February 06, 1997 07:33:31">
|
|
</HEAD>
|
|
<SCRIPT SRC="global.js">
|
|
</SCRIPT>
|
|
<SCRIPT SRC="ctasapagar.js">
|
|
</SCRIPT>
|
|
<SCRIPT SRC="albaran.js">
|
|
</SCRIPT>
|
|
<SERVER>
|
|
// Variables para el Server
|
|
var HOY=new Date();
|
|
var entorno = new entObj(0);
|
|
// Algunos formatos para fechas.
|
|
var NLDF=""; // para columnas en las queries INFORMIX
|
|
var IFDF=""; // para columnas en SQL según DBDATE
|
|
// Algunos formatos para nros.
|
|
var NF2=""
|
|
var NF3=""
|
|
var NF4=""
|
|
var NF5=""
|
|
var NF6=""
|
|
var NF7=""
|
|
var NF8=""
|
|
var NF9=""
|
|
var NF10=""
|
|
var NF11=""
|
|
var NF12=""
|
|
var baseHtml="";
|
|
dbAcl();
|
|
//if ((!request.waux && request.lock) || request.nvo )
|
|
LoadParametros();
|
|
writeln("<SCRIPT LANGUAGE='JavaScript'>");
|
|
//if ((!request.waux && request.lock) || request.nvo )
|
|
SetParametros();
|
|
writeln('function MasLineas(obj) {');
|
|
writeln(' if (obj.name == "AlineasMas" ) { ');
|
|
writeln(' nro=parseInt(document.f_albaran.nrolineas.value);');
|
|
writeln(' document.f_albaran.nrolineas.value=nro+1;');
|
|
writeln(' } ');
|
|
writeln(' if (obj.name == "ActasMas" ) { ');
|
|
writeln(' nro=parseInt(document.f_albaran.nroctas.value);');
|
|
writeln(' document.f_albaran.nroctas.value=nro+1;');
|
|
writeln(' } ');
|
|
writeln(' FormPaint(obj);');
|
|
writeln('} ');
|
|
writeln('function FormPaint(obj) {');
|
|
writeln(' document.f_albaran.action=window.document.location.href+"&cookie=1&lock=true"');
|
|
writeln(' document.f_albaran.submit();'); writeln(' } ');
|
|
if ( request.FrameType == "F" || request.FrameType == "T" ) {
|
|
writeln('function RunFunction(obj,valor,clave,f_nro) {');
|
|
writeln(' var mainFrame=find_frame(top,"main");');
|
|
writeln(' var f_frame=mainFrame.document.f_albaran;');
|
|
writeln(' if ( obj == "Ayuda" ) {');
|
|
writeln(' NetHelp(valor);');
|
|
writeln(' }');
|
|
writeln(' history.back();');
|
|
writeln('}');
|
|
writeln('function WriteFrameButtons() {')
|
|
if (!request.waux) {
|
|
writeln(' var topFrame=find_frame(top,"top");');
|
|
writeln(' var ndoc=topFrame.document; ');
|
|
writeln(' var mainFrame=find_frame(top,"main");');
|
|
writeln(' var formAction=mainFrame.document.location.href;');
|
|
ObjButtons(request.ab_nro_reg,"Albaranes","ab_");
|
|
}
|
|
writeln('}');
|
|
}
|
|
if ( request.ViewFkey == "S" ) {
|
|
writeln('function RePaint(obj) {');
|
|
writeln(' var mainFrame=find_frame(top,"main");');
|
|
writeln(' for ( var i=0; i < document.f_albaran.length; i++ ) { ');
|
|
writeln(' if ( document.f_albaran.elements[i].name == obj.name ) ');
|
|
writeln(' break; ');
|
|
writeln(' } ');
|
|
writeln(' document.f_albaran.action=mainFrame.document.location.href+"&cookie=1&nro="+nl+"&lock=true"');
|
|
writeln(' document.f_albaran.submit();');
|
|
writeln('} ');
|
|
}
|
|
else {
|
|
writeln('function ScrollVer(obj) {');
|
|
writeln(' status_scroll=true; ');
|
|
writeln(' MESSAGE=" ¡¡¡ El Albarán ha cambiado usar el botón de \'Ver\' para "+ ');
|
|
writeln(' " actualizar los datos del la Base de Datos desde el Servidor !!! " ');
|
|
writeln(' scroll = new statusMessageObject(); ');
|
|
writeln(' scroller(); ');
|
|
writeln('} ');
|
|
writeln('function RePaint(obj) {');
|
|
writeln(' if (status_scroll != true ) ');
|
|
writeln(' ScrollVer(obj); ');
|
|
writeln('} ');
|
|
}
|
|
writeln('function Enfoca(obj) {')
|
|
writeln(' if (obj.name == "linCta" )');
|
|
if (request.nvo)
|
|
writeln(' document.f_albaran.ac_'+request.nroctas+'_cod_cta.focus();');
|
|
else
|
|
writeln(' document.f_albaran.ac_1_cod_cta.focus();');
|
|
writeln(' if (obj.name == "linAlb" )');
|
|
if (request.nvo)
|
|
writeln(' document.f_albaran.al_'+request.nrolineas+'_referencia.focus();');
|
|
else
|
|
writeln(' document.f_albaran.al_1_referencia.focus();');
|
|
if ( request.nro ) {
|
|
writeln(' document.f_albaran.elements['+request.nro+'].focus();');
|
|
}
|
|
writeln('}');
|
|
writeln(' function Chek_fields(obj) {');
|
|
if (request.waux || !request.lock)
|
|
writeln(' return true;');
|
|
else {
|
|
writeln(' if ( emptyField(obj.ab_nro_reg) == true ) { ');
|
|
writeln(' alert("!!! Es necesario rellenar el Código de albaran !!!->"+obj.ab_nro_reg.value+"<-");');
|
|
writeln(' return false;');
|
|
writeln(' } ');
|
|
writeln(' if ( emptyField(obj.ab_fecha_emision) == true ) { ');
|
|
writeln(' alert("!!! Es necesario rellenar la Fecha de Emisión del Albarán !!!->"+obj.ab_fecha_emision.value+"<-");');
|
|
writeln(' return false;');
|
|
writeln(' }');
|
|
writeln(' if ( emptyField(obj.ab_nif) == true ) { ');
|
|
writeln(' alert("!!! Es necesario rellenar el NIF del albarán !!!->"+obj.ab_nif.value+"<-");');
|
|
writeln(' return false;');
|
|
writeln(' }');
|
|
}
|
|
writeln(' }');
|
|
writeln(' function SumaCtas(obj) {');
|
|
writeln(' var SumaDebe=0;');
|
|
writeln(' var SumaHaber=0;');
|
|
writeln(' var nro=0;');
|
|
writeln(' var importe=0;');
|
|
writeln(' var Limite=0;');
|
|
writeln(' tipoApte="";');
|
|
writeln(' Limite=parseInt(document.f_albaran.nroctas.value);');
|
|
writeln(' for (var nl=1; nl <= Limite ; nl++) { ');
|
|
writeln(' eval("importe=NroUnformat(document.f_albaran.ac_"+nl+"_importe.value)");');
|
|
writeln(' nro=parseFloat(importe);');
|
|
//writeln(' alert(nro+" "+importe) ');
|
|
writeln(' eval("tipoApte=get_value(\'select\',document.f_albaran.ac_"+nl+"_tipo_apte);")');
|
|
writeln(' if (tipoApte == "D" ) ');
|
|
writeln(' SumaDebe=parseFloat(SumaDebe)+parseFloat(nro);');
|
|
writeln(' if (tipoApte == "H" ) ');
|
|
writeln(' SumaHaber=parseFloat(SumaHaber)+parseFloat(nro);');
|
|
writeln(' }');
|
|
//writeln(' alert(" Debe:"+SumaDebe+" Haber:"+SumaHaber)');
|
|
writeln(' document.f_albaran.ac_totaldebe.value=NroFormat(SumaDebe+" ",NF11);');
|
|
writeln(' document.f_albaran.ac_totalhaber.value=NroFormat(SumaHaber+" ",NF11);');
|
|
writeln(' }');
|
|
writeln(' function SumaLineas(obj) {');
|
|
writeln(' var SumaLineas=0;');
|
|
writeln(' var Limite=0;');
|
|
writeln(' var cantidad=0;');
|
|
writeln(' var precio=0;');
|
|
writeln(' var nro=0;');
|
|
writeln(' Limite=parseInt(document.f_albaran.nrolineas.value);');
|
|
writeln(' for (var nl=1; nl <= Limite ; nl++) { ');
|
|
writeln(' eval("cantidad=NroUnformat(document.f_albaran.al_"+nl+"_cantidad.value)");');
|
|
writeln(' eval("precio=NroUnformat(document.f_albaran.al_"+nl+"_precio_und.value)");');
|
|
writeln(' nro=parseFloat(cantidad)*parseFloat(precio); ');
|
|
writeln(' eval("document.f_albaran.al_"+nl+"_total.value=NroFormat(nro+\' \',NF9);");');
|
|
writeln(' SumaLineas=parseFloat(SumaLineas)+parseFloat(nro); ');
|
|
writeln(' }');
|
|
writeln(' document.f_albaran.al_total.value=NroFormat(SumaLineas+" ",NF9);');
|
|
writeln(' }');
|
|
writeln(' function CalculaLinea(nl) {');
|
|
//writeln(' eval("alert(document.f_albaran.al_1_precio_und.value)") ');
|
|
writeln(' var nro=0;');
|
|
writeln(' eval("nro=Math.round(parseFloat(NroUnformat(document.f_albaran.al_"+nl+"_cantidad.value))*parseFloat(NroUnformat(document.f_albaran.al_"+nl+"_precio_und.value)))");');
|
|
writeln(' eval("document.f_albaran.al_"+nl+"_total.value=NroFormat(nro+\' \',NF11);")');
|
|
writeln(' SumaLineas(document.f_albaran); ');
|
|
writeln(' }');
|
|
writeln(' function GoNextField(obj) {');
|
|
writeln(' var pos=0; ');
|
|
writeln(' pos=pos_form(document.f_albaran,obj.name); ');
|
|
writeln(' if ( pos+1 >= 0 && pos+1 <= document.f_albaran.elements.length) ');
|
|
writeln(' document.f_albaran.elements[pos+1].focus();');
|
|
writeln(' }');
|
|
writeln(' function ChkLinCta(icta) {');
|
|
writeln(' var f=document.f_albaran;');
|
|
writeln(' var paso=true; ');
|
|
writeln(' var valor="";');
|
|
writeln(' var nro=0;');
|
|
writeln(' eval("if ( f.ac_"+icta+"_cod_cta.value.length < 2 || f.ac_"+icta+"_cod_cta.value == \'\') { paso=false }")');
|
|
writeln(' if ( paso == false ) ');
|
|
writeln(' return; ');
|
|
writeln(' eval("valor=f.ac_"+icta+"_clave.value;")');
|
|
writeln(' eval("if ( valor.length < 2 || valor == \'\' || !valor ) { scanClaveCta("+icta+");}")');
|
|
writeln(' eval("nro=parseInt(NroUnformat(f.ac_"+icta+"_importe.value));")');
|
|
writeln(' eval("valor=f.ac_"+icta+"_concepto.value;")');
|
|
writeln(' if ( valor.length == 0 ) { ');
|
|
writeln(' if ( nro < 0 ) { '),
|
|
writeln(' eval("f.ac_"+icta+"_concepto.value=\'A\'");');
|
|
writeln(' }');
|
|
writeln(' if ( nro > 0 ) { ');
|
|
writeln(' eval("f.ac_"+icta+"_concepto.value=\' \'"); ');
|
|
writeln(' }');
|
|
writeln(' };');
|
|
writeln(' }');
|
|
writeln(' function GoField() {');
|
|
writeln(' var f=document.f_albaran; ');
|
|
writeln(' var nregy=""; ');
|
|
writeln(' var nregn=""; ');
|
|
writeln(' if ( f.ab_is_locked.value == "S" ) {');
|
|
writeln(' if ( f.ab_fra_reg.value.length > 0 ) {');
|
|
writeln(' nregy=f.ab_fra_reg.value.substring(0,4); ');
|
|
writeln(' nregn=f.ab_fra_reg.value.substring(4,10); ');
|
|
writeln(' alert("\\r El Albarán está bloqueado.\\r Fra. Nro. Reg. "+nregn+"/"+nregy); ');
|
|
writeln(' } else ');
|
|
writeln(' alert("\\r¡¡¡ El Albarán está bloqueado !!!"); ');
|
|
writeln(' } ');
|
|
if ( request.prt) {
|
|
// writeln('w_auxiliar(\'factura\',\'Reg_'+request.prt+'\',\'fa_nro_reg\',\''+StringClip(true,request.prt)+'\');');
|
|
// writeln(' alert("\\rNro. Regisro: '+nregn+'/'+nregy+' creado. ");');
|
|
}
|
|
if (request.exec=="add" || request.exec == "upd" )
|
|
writeln(' f.submit(); ');
|
|
writeln(' if ( f.ab_t_razon_social.value == "NO EXISTE" ) {');
|
|
writeln(' alert("!!! El NIF del Proveedor no Existe !!!->"+f.ab_nif.value+"<-");');
|
|
writeln(' return; ');
|
|
writeln(' }' );
|
|
writeln(' if (f.ab_cond_pago.value+"" == pa_cp_lock+"" ) {');
|
|
writeln(' alert("!!! El Proveedor está Bloqueado !!!->"+f.ab_cond_pago.value+"<-");');
|
|
writeln(' }' );
|
|
if (request.Alb || request.exec == "lin" )
|
|
writeln(' Enfoca("linAlb");');
|
|
if (request.Act || request.exec == "cta")
|
|
writeln(' Enfoca("linCta");');
|
|
if (!request.Act && !request.Alb)
|
|
writeln(' f.ab_nro_reg.focus();');
|
|
writeln(' }');
|
|
writeln("</SCRIPT>");
|
|
if (request.gofunc)
|
|
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\',\''+request.nvo+'\','+request.nro+')"');
|
|
else {
|
|
if ( request.FrameType == "F" || request.FrameType == "T" )
|
|
writeln(' <BODY OnLoad="WriteFrameButtons();GoField();SumaCtas(this);SumaLineas(this)"');
|
|
else
|
|
writeln('<BODY OnLoad="GoField();SumaCtas(this);SumaLineas(this)" ');
|
|
}
|
|
writeln(' BACKGROUND="images/backgrnd.gif">');
|
|
if (request.gofunc) {
|
|
writeln(' </BODY>');
|
|
writeln(' </HTML>');
|
|
writeln(' <!--');
|
|
}
|
|
if (!request.cookie && !request.gofunc) {
|
|
dbConnect();
|
|
// Vemos que tarea hay que ejecutar:
|
|
if (request.add) {
|
|
if ( entriesExist(" from albaranes where nro_reg=\'"+StringClip(true,request.ab_nro_reg)+"\'") == true ){
|
|
redirect(addClient('error.html?alert=2'));
|
|
}
|
|
else {
|
|
client.is_trans=true;
|
|
database.beginTransaction();
|
|
status=database.execute("INSERT INTO albaranes(" +
|
|
" nro_reg," +
|
|
" is_locked," +
|
|
" fra_reg," +
|
|
" fecha_emision," +
|
|
" nif," +
|
|
" cod_centro," +
|
|
" por_reten," +
|
|
" importe_reten," +
|
|
" nro_pedido," +
|
|
" vto_jefe_obra," +
|
|
" vto_jefe_grupo," +
|
|
" vto_proveedor," +
|
|
" observaciones) VALUES ('" + StringClip(true,request.ab_nro_reg) + "','" +
|
|
request.ab_is_locked + "','"+
|
|
request.ab_fra_reg + "','"+
|
|
DateFormat(request.ab_fecha_emision,NLDF) + "','"+
|
|
StringClip(true,request.ab_nif) + "','"+
|
|
StringClip(true,request.ab_cod_centro) + "','"+
|
|
NroUnformat(request.ab_por_reten) + "','"+
|
|
NroUnformat(request.ab_importe_reten) + "','"+
|
|
StringClip(true,request.ab_nro_pedido) + "','"+
|
|
StringClip(true,request.ab_vto_jefe_obra) + "','"+
|
|
StringClip(true,request.ab_vto_jefe_grupo) + "','"+
|
|
StringClip(true,request.ab_vto_proveedor) + "','"+
|
|
StringClip(true,request.ab_observaciones) + "')");
|
|
if ( status != 0 ) {
|
|
client.is_trans=false;
|
|
database.rollbackTransaction();
|
|
redirect(addClient('error.html?alert=8'));
|
|
}
|
|
DbsError(true,status);
|
|
InsAlbLins();
|
|
database.commitTransaction();
|
|
client.is_trans=false;
|
|
}
|
|
redirect(addClient("o_albaran.html?nvo=1&"+baseHtml));
|
|
}
|
|
//Ejecuta una actualización de la fila sobre la fila actual ...
|
|
if (request.upd && request.ab_nro_reg) {
|
|
// if (request.lock)
|
|
// client.is_trans=true;
|
|
database.beginTransaction();
|
|
status=database.execute("UPDATE albaranes SET "+
|
|
" is_locked='" + request.ab_is_locked + "',"+
|
|
" fra_reg='" + request.ab_fra_reg + "',"+
|
|
" fecha_emision='" + DateFormat(request.ab_fecha_emision,NLDF) + "',"+
|
|
" nif='" + StringClip(true,request.ab_nif) + "',"+
|
|
" cod_centro='" + StringClip(true,request.ab_cod_centro) + "',"+
|
|
" por_reten='" + NroUnformat(request.ab_por_reten) + "',"+
|
|
" importe_reten='" + NroUnformat(request.ab_importe_reten) + "',"+
|
|
" nro_pedido='" + StringClip(true,request.ab_nro_pedido) + "',"+
|
|
" vto_jefe_obra='" + StringClip(true,request.ab_vto_jefe_obra) + "',"+
|
|
" vto_jefe_grupo='" + StringClip(true,request.ab_vto_jefe_grupo) + "',"+
|
|
" vto_proveedor='" + StringClip(true,request.ab_vto_proveedor) + "',"+
|
|
" observaciones='" + StringClip(true,request.ab_observaciones) + "'"+
|
|
" WHERE nro_reg = '" + request.ab_nro_reg + "'" );
|
|
if ( status != 0 ) {
|
|
client.is_trans=false;
|
|
database.rollbackTransaction();
|
|
redirect(addClient('error.html?alert=9'));
|
|
}
|
|
DbsError(true,status);
|
|
DelAlbLins();
|
|
InsAlbLins();
|
|
database.commitTransaction();
|
|
client.is_trans=false;
|
|
redirect(addClient("g_albaran.html?"+baseHtml));
|
|
}
|
|
//Ejecuta un borrado de la fila actual ...
|
|
if (request.del) {
|
|
client.is_trans=true;
|
|
database.beginTransaction();
|
|
status=database.execute("DELETE FROM albaranes WHERE nro_reg = \'" + request.ab_nro_reg + "\'");
|
|
if ( status != 0 ) {
|
|
client.is_trans=false;
|
|
database.rollbackTransaction();
|
|
redirect(addClient('error.html?alert=10'));
|
|
}
|
|
DbsError(true,status);
|
|
DelAlbLins();
|
|
database.commitTransaction();
|
|
client.is_trans=false;
|
|
redirect(addClient("g_albaran.html?"+baseHtml));
|
|
}
|
|
if (request.ab_nro_reg && !request.upd && !request.add ) {
|
|
// Si hay Clave de la tabla seleccionamos los datos ....
|
|
//Si se busca la fila ... usando la clave primaria de la relación
|
|
if (request.lock) {
|
|
client.is_trans=true;
|
|
database.beginTransaction();
|
|
CursorTabla("ab","nro_reg","=\'"+request.ab_nro_reg+"\'",true,true);
|
|
}
|
|
else
|
|
CursorTabla("ab","nro_reg","=\'"+request.ab_nro_reg+"\'",true,"");
|
|
// Asignamos a request todas las columnas necesarias para el form.
|
|
request.ab_nro_reg=StringClip(true,c_albaranes.nro_reg);
|
|
request.ab_is_locked=c_albaranes.is_locked;
|
|
request.ab_fra_reg=StringClip(true,c_albaranes.fra_reg);
|
|
request.ab_fecha_emision=datetoString(c_albaranes.fecha_emision);
|
|
request.ab_nif=StringClip(true,c_albaranes.nif);
|
|
request.ab_cod_centro=StringClip(false,c_albaranes.cod_centro);
|
|
request.ab_por_reten=c_albaranes.por_reten;
|
|
request.ab_importe_reten=NroFormat(c_albaranes.importe_reten,NF9);
|
|
request.ab_nro_pedido=StringClip(true,c_albaranes.nro_pedido);
|
|
request.ab_vto_jefe_obra=StringClip(true,c_albaranes.vto_jefe_obra);
|
|
request.ab_vto_jefe_grupo=StringClip(true,c_albaranes.vto_jefe_grupo);
|
|
request.ab_vto_proveedor=StringClip(true,c_albaranes.vto_proveedor);
|
|
request.ab_observaciones=StringClip(true,c_albaranes.observaciones);
|
|
request.ab_is_locked=StringClip(true,c_albaranes.is_locked);
|
|
if (request.lock)
|
|
c_albaranes.close();
|
|
if (request.ab_is_locked == "S" )
|
|
request.waux=8;
|
|
if (request.ab_nif && request.ab_nif != null ) {
|
|
CursorTabla("pr","nif","=\'"+StringClip(true,request.ab_nif)+"\'",false,false);
|
|
request.ab_t_razon_social=StringClip(false,c_proveedores.razon_social);
|
|
if ( request.ab_t_razon_social == " " ) {
|
|
request.ab_t_razon_social="NO EXISTE";
|
|
request.ab_cta_contable="";
|
|
request.ab_cond_pago="";
|
|
} else {
|
|
request.ab_cta_contable=StringClip(false,c_proveedores.cta_contable);
|
|
request.ab_cond_pago=c_proveedores.cond_pago;
|
|
}
|
|
c_proveedores.close();
|
|
}
|
|
else {
|
|
request.ab_t_razon_social="";
|
|
request.ab_cta_contable="";
|
|
request.ab_cond_pago="";
|
|
}
|
|
if (request.ab_cod_centro && request.ab_cod_centro != null) {
|
|
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.ab_cod_centro)+"\'",false,false);
|
|
request.ab_t_des_centro=c_centros.descripcion;
|
|
c_centros.close();
|
|
}
|
|
else
|
|
request.ab_t_des_centro="";
|
|
if (request.ab_nro_pedido && request.ab_nro_pedido != null) {
|
|
CursorTabla("pe","nro_pedido","=\'"+StringClip(true,request.ab_nro_pedido)+"\'",false,false);
|
|
request.ab_t_des_pedido=c_pedidos.descripcion;
|
|
c_pedidos.close();
|
|
}
|
|
else
|
|
request.ab_t_des_pedido="";
|
|
if (request.lock)
|
|
CursorTabla("al","nro_reg","=\'"+request.ab_nro_reg+"\'",false,true);
|
|
else
|
|
CursorTabla("al","nro_reg","=\'"+request.ab_nro_reg+"\'",false,"");
|
|
var SumaLineas=0;
|
|
request.nrolineas=1;
|
|
nl=0;
|
|
while (c_albalineas.next()) {
|
|
request.nrolineas++; nl++;
|
|
eval("request.al_"+nl+"_nro_lin=request.c_albalineas.nro_lin");
|
|
eval("request.al_"+nl+"_nro_reg=StringClip(true,c_albalineas.nro_reg)");
|
|
eval("request.al_"+nl+"_cantidad=NroFormat(c_albalineas.cantidad,NF5)");
|
|
eval("request.al_"+nl+"_referencia=StringClip(true,c_albalineas.referencia)");
|
|
eval("request.al_"+nl+"_descripcion=StringClip(true,c_albalineas.descripcion)");
|
|
eval("request.al_"+nl+"_precio_und=NroFormat(c_albalineas.precio_und,NF8)");
|
|
eval("request.al_"+nl+"_total=NroFormat(c_albalineas.cantidad*c_albalineas.precio_und,NF9)");
|
|
SumaLineas=SumaLineas+(c_albalineas.cantidad*c_albalineas.precio_und);
|
|
}
|
|
c_albalineas.close()
|
|
request.al_total=NroFormat(SumaLineas,NF9);
|
|
if (request.lock)
|
|
CursorTabla("ac","nro_reg","=\'"+request.ab_nro_reg+"\'",false,true);
|
|
else
|
|
CursorTabla("ac","nro_reg","=\'"+request.ab_nro_reg+"\'",false,"");
|
|
var SumaDebe=0;
|
|
var SumaHaber=0;
|
|
request.nroctas=0;
|
|
nl=0;
|
|
while (c_aptecuentas.next()) {
|
|
request.nroctas++; nl++;
|
|
eval("request.ac_"+nl+"_nro_lin=c_aptecuentas.nro_lin");
|
|
eval("request.ac_"+nl+"_nro_reg=StringClip(true,c_aptecuentas.nro_reg)");
|
|
eval("request.ac_"+nl+"_tipolin=StringClip(true,c_aptecuentas.tipolin)");
|
|
eval("request.ac_"+nl+"_cod_cta=StringClip(true,c_aptecuentas.cod_cta)");
|
|
eval("request.ac_"+nl+"_concepto=StringClip(true,c_aptecuentas.concepto)");
|
|
eval("request.ac_"+nl+"_clave=StringClip(true,c_aptecuentas.clave)");
|
|
eval("request.ac_"+nl+"_importe=NroFormat(c_aptecuentas.importe,NF9);");
|
|
eval("request.ac_"+nl+"_tipo_apte=StringClip(true,c_aptecuentas.tipo_apte)");
|
|
eval("request.ac_"+nl+"_fecha=c_aptecuentas.fecha");
|
|
if ( c_aptecuentas.tipo_apte == "D" )
|
|
SumaDebe=SumaDebe+c_aptecuentas.importe;
|
|
if ( c_aptecuentas.tipo_apte == "H" )
|
|
SumaHaber=SumaHaber+c_aptecuentas.importe;
|
|
}
|
|
request.ac_totaldebe=NroFormat(SumaDebe,NF11);
|
|
request.ac_totalhaber=NroFormat(SumaHaber,NF11);
|
|
if (request.nroctas ==0 )
|
|
request.nroctas=1;
|
|
c_aptecuentas.close()
|
|
}
|
|
else {
|
|
// Estos son los Defaults Reales del Form ... Aquí pueden cambiarse ...
|
|
IniciaRequest("ab_");
|
|
request.lock=true;
|
|
request.nroctas=2;
|
|
request.nrolineas=1;
|
|
request.ac_totalhaber=0;
|
|
request.ac_totaldebe=0;
|
|
request.al_total=0;
|
|
request.ab_t_razon_social="";
|
|
request.ab_cta_contable="";
|
|
request.ab_t_des_pedido="";
|
|
request.ab_t_des_centro="";
|
|
request.ab_cond_pago="";
|
|
}
|
|
}
|
|
else if (!request.gofunc) {
|
|
// Se entiende que request contiene todas las columnas necesarias para el form.
|
|
// y que esta llamada es para leer y cargar las claves foráneas de la tabla.
|
|
if (request.nvo && request.ab_nro_reg && request.ab_nro_reg != null ) {
|
|
if ( entriesExist(" from albaranes where nro_reg=\'"+StringClip(true,request.ab_nro_reg)+"\'") == true ) {
|
|
redirect("alertpage.html?alert=2");
|
|
}
|
|
}
|
|
if (request.ab_nif && request.ab_nif != null ) {
|
|
CursorTabla("pr","nif","=\'"+StringClip(true,request.ab_nif)+"\'",false,false);
|
|
request.ab_t_razon_social=StringClip(false,c_proveedores.razon_social);
|
|
if ( request.ab_t_razon_social == " " ) {
|
|
request.ab_t_razon_social="NO EXISTE";
|
|
request.ab_cta_contable="";
|
|
request.ab_cond_pago="";
|
|
} else {
|
|
request.ab_cta_contable=StringClip(false,c_proveedores.cta_contable);
|
|
request.ab_cond_pago=c_proveedores.cond_pago;
|
|
}
|
|
c_proveedores.close();
|
|
}
|
|
else {
|
|
request.ab_t_razon_social="";
|
|
request.ab_cta_contable="";
|
|
request.ab_cond_pago="";
|
|
}
|
|
if (request.ab_cod_centro && request.ab_cod_centro != null) {
|
|
CursorTabla("ce","cod_centro","=\'"+StringClip(true,request.ab_cod_centro)+"\'",false,false);
|
|
request.ab_t_des_centro=c_centros.descripcion;
|
|
c_centros.close();
|
|
}
|
|
else
|
|
request.ab_t_des_centro="";
|
|
if (request.ab_nro_pedido && request.ab_nro_pedido != null) {
|
|
CursorTabla("pe","nro_pedido","=\'"+StringClip(true,request.ab_nro_pedido)+"\'",false,false);
|
|
request.ab_t_des_pedido=c_pedidos.descripcion;
|
|
c_pedidos.close();
|
|
}
|
|
else
|
|
request.ab_t_des_pedido="";
|
|
}
|
|
writeln('<FORM NAME="f_albaran" METHOD="post"');
|
|
if (request.ab_nro_reg && !request.nvo)
|
|
htmlpath="o_albaran.html?ab_nro_reg="+escape(request.ab_nro_reg)+"&"+baseHtml;
|
|
else
|
|
htmlpath="o_albaran.html?nvo=1"+baseHtml;
|
|
writeln('action="'+htmlpath+'"');
|
|
writeln(' onSubmit="return Chek_fields(this)">');
|
|
LoadHidden(htmlpath);
|
|
if (!request.waux && request.FrameType == "L" )
|
|
ObjHeadBar(request.ab_nro_reg,"Albarán","ab_");
|
|
write('<CENTER><TABLE BORDER=1 ALIGN=CENTER><TR>');
|
|
//if (!request.waux)
|
|
// writeln('<TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" Código " ONCLICK="w_auxiliar(\'nro_reg\',\'nro_reg\',\'ab_nro_reg\',\''+request.ab_nro_reg+'\')">');
|
|
//else {
|
|
//if (request.waux == 2)
|
|
// writeln('<TD></TD><TD align="right" valign="top"><A HREF="javascript:top.close()"><IMG SRC="images/exit1.gif" BORDER=0 HEIGHT=37 WIDTH=44></A></TD></TR>');
|
|
writeln('<TR><TD ALIGN=RIGHT><B> Nro.Reg.: </B>');
|
|
//}
|
|
if (request.ab_nro_reg && !request.nvo)
|
|
writeln('<FONT COLOR="#800040"><B>'+request.ab_nro_reg+'</B></FONT><INPUT type="hidden" name="ab_nro_reg" VALUE="'+request.ab_nro_reg+'"></TD></FONT>');
|
|
else
|
|
writeln('<INPUT TYPE="text" NAME="ab_nro_reg" VALUE="'+request.ab_nro_reg+'" SIZE=10 OnChange="//RePaint(this)"></TD>');
|
|
if (request.waux || !request.lock) {
|
|
if ( request.ab_fra_reg.length > 2 )
|
|
writeln('<FONT COLOR="#800040">Nro.Reg.Fra.:<B>'+request.ab_fra_reg+'</FONT>');
|
|
if ( request.ab_is_locked == "S" )
|
|
writeln('<FONT COLOR="#800040">Bloqueado<B></FONT></TR>');
|
|
}
|
|
writeln('<INPUT type="hidden" name="ab_is_locked" VALUE="'+request.ab_is_locked+'">');
|
|
writeln('<INPUT type="hidden" name="ab_fra_reg" VALUE="'+request.ab_fra_reg+'"></TD>');
|
|
writeln('<TD ALIGN=RIGHT><B>Fecha Emisión:</B>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<FONT COLOR="#800040"><B>'+request.ab_fecha_emision+'</FONT><INPUT type="hidden" name="ab_fecha_emision" VALUE="'+request.ab_fecha_emision+'" size=8 maxlength=8></TD></FONT></TR>');
|
|
else
|
|
writeln('<INPUT type="text" name="ab_fecha_emision" VALUE="'+request.ab_fecha_emision+'" onBlur="ToStringDate(this,IFDF)" onFocus="UnfrmtStrDate(this,IFDF)" size=8 maxlength=8></TD></TR>');
|
|
if (!request.waux || !request.lock)
|
|
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE=" N.I.F. " ONCLICK="w_auxiliar(\'proveedor\',\'Proveedores\',\'pr_nif\',\''+StringClip(true,request.ab_nif)+'\')">');
|
|
else
|
|
writeln('<TR><TD ALIGN=RIGHT><B> N.I.F. </B>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<FONT COLOR="#800040"><B>'+request.ab_nif+'</B></FONT><INPUT type="hidden" name="ab_nif" VALUE="'+request.ab_nif+'"></TD>');
|
|
else
|
|
writeln('<INPUT TYPE="text" NAME="ab_nif" VALUE="'+request.ab_nif+'" SIZE=12 OnChange="this.value=this.value.toUpperCase();RePaint(this)" ></TD>');
|
|
if (request.ab_t_razon_social == "NO EXISTE")
|
|
writeln('<TD ALIGN=LEFT><BLINK><FONT COLOR="#800040">'+request.ab_t_razon_social+'</FONT></BLINK></TD></TR>');
|
|
else
|
|
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.ab_t_razon_social+'</FONT></TD></TR>');
|
|
writeln('<INPUT type="hidden" name="ab_t_razon_social" VALUE="'+request.ab_t_razon_social+'">');
|
|
writeln('<INPUT type="hidden" name="ab_cta_contable" VALUE="'+request.ab_cta_contable+'">');
|
|
writeln('<INPUT type="hidden" name="ab_cond_pago" VALUE="'+request.ab_cond_pago+'">');
|
|
if (!request.waux || !request.lock)
|
|
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE="Centro" ONCLICK="w_auxiliar(\'centro\',\'Centros\',\'ce_cod_centro\',\''+StringClip(true,request.ab_cod_centro)+'\')">');
|
|
else
|
|
writeln('<TR><TD ALIGN=RIGHT><B>Centro</B>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<FONT COLOR="#800040"><B>'+request.ab_cod_centro+'</B></FONT><INPUT TYPE="hidden" NAME="ab_con_centro" VALUE="'+request.ab_cod_centro+'" SIZE=12 OnChange="RePaint(this)"> </TD>');
|
|
else
|
|
writeln('<INPUT TYPE="text" NAME="ab_cod_centro" VALUE="'+request.ab_cod_centro+'" SIZE=12 OnChange="RePaint(this)"> </TD>');
|
|
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.ab_t_des_centro+'</FONT></TD>');
|
|
if (!request.waux || !request.lock)
|
|
writeln('<TR><TD ALIGN=RIGHT><INPUT TYPE="button" VALUE="Pedido" ONCLICK="w_auxiliar(\'pedido\',\'Pedidos\',\'pe_nro_pedido\',\''+StringClip(true,request.ab_nro_pedido)+'\')">');
|
|
else
|
|
writeln('<TR><TD ALIGN=RIGHT><B>Pedido</B>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<FONT COLOR="#800040"><B>'+request.ab_nro_pedido+'</B></FONT><INPUT TYPE="hidden" NAME="ab_nro_pedio" VALUE="'+request.ab_nro_pedido+'" SIZE=12 maxlength=20 OnChange="RePaint(this)"> </TD>');
|
|
else
|
|
writeln('<INPUT TYPE="text" NAME="ab_nro_pedido" VALUE="'+request.ab_nro_pedido+'" SIZE=12 MAXLENGTH=20 OnChange="RePaint(this)"> </TD>');
|
|
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040">'+request.ab_t_des_pedido+'</FONT></TD>');
|
|
writeln('<TR><TD ALIGN=RIGHT><B>Retenciones:</B>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<FONT COLOR="#800040"><B>'+request.ab_por_reten+'</FONT><INPUT type="hidden" name="ab_por_reten" VALUE="'+request.ab_por_reten+'" size=2 maxlength=2></TD></FONT></TD>');
|
|
else
|
|
writeln('<INPUT type="text" name="ab_por_reten" VALUE="'+request.ab_por_reten+'" onBlur="NroToString(this,NF2)" onFocus="StringToNro(this,NF2)" size=2 maxlength=2></TD>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<TD><FONT COLOR="#800040"><B>'+request.ab_importe_reten+'</FONT><INPUT type="hidden" name="ab_importe_reten" VALUE="'+request.ab_importe_reten+'" size=10 maxlength=10></TD></FONT></TR>');
|
|
else
|
|
writeln('<TD><INPUT type="text" name="ab_importe_reten" VALUE="'+request.ab_importe_reten+'" onBlur="NroToString(this,NF9)" onFocus="StringToNro(this,NF9)" size=11 maxlength=11></TD></TR>');
|
|
writeln('</TABLE>');
|
|
writeln('<A NAME="lin-ctas"><CENTER><H2><FONT COLOR="#800040"> Cuentas de Gastos </FONT></H2></CENTER><A>');
|
|
writeln('<INPUT TYPE="hidden" NAME="nroctas" VALUE="'+request.nroctas+'" SIZE=2 >');
|
|
writeln('<TABLE BORDER=1 ALIGN=CENTER>');
|
|
writeln('<TR><TD ALIGN=CENTER><B>N.</B> </TD>');
|
|
writeln('<TD><INPUT TYPE="button" VALUE="Cuenta Cont." ');
|
|
writeln(' ONCLICK="w_auxiliar(\'ctascont\',\'Cuentas_Contables\',\'ct_cta_contable\',\'\')"></TD>');
|
|
writeln('<TD ALIGN=CENTER><B>Título Cuenta</B></TD>');
|
|
writeln('<TD ALIGN=CENTER><B>Importe</B> </TD>');
|
|
writeln('<TD ALIGN=CENTER><B>Tipo Ap.</B> </TD>');
|
|
writeln('<TD><B>Clave</B></TD>');
|
|
writeln('<TD ALIGN=CENTER><B>Concepto</B> </TD>');
|
|
for (var nl=1; nl <= request.nroctas ; nl++) {
|
|
eval('if (!request.ac_'+nl+'_nro_lin) { request.ac_'+nl+'_nro_lin='+nl+'}');
|
|
eval('if (!request.ac_'+nl+'_tipolin) { request.ac_'+nl+'_tipolin="G"};');
|
|
eval('if (!request.ac_'+nl+'_cod_cta) { request.ac_'+nl+'_cod_cta=""; request.ac_'+nl+'_t_cta_contable=""};');
|
|
eval('if (!request.ac_'+nl+'_clave){ request.ac_'+nl+'_clave=""};');
|
|
eval('if (!request.ac_'+nl+'_concepto){ request.ac_'+nl+'_concepto=""};');
|
|
eval('if (!request.ac_'+nl+'_tipo_apte){ request.ac_'+nl+'_tipo_apte=""};');
|
|
eval('if (!request.ac_'+nl+'_importe) { request.ac_'+nl+'_importe=0};');
|
|
eval('writeln(\'<TR><TD><FONT COLOR="#800040"><B>\'+request.ac_'+nl+'_nro_lin+\'</B></FONT><INPUT TYPE="hidden" NAME="ac_'+nl+'_nro_lin" VALUE="\'+request.ac_'+nl+'_nro_lin+\'" SIZE=2 ></TD> \');');
|
|
eval('writeln(\'<INPUT TYPE="hidden" NAME="ac_'+nl+'_tipolin" VALUE="\'+request.ac_'+nl+'_tipolin+\'" SIZE=1 ></TD>\');');
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD ALIGN=CENTER>\'+request.ac_'+nl+'_cod_cta+\'<FONT COLOR="#800040"><B><INPUT TYPE="hidden" NAME="ac_'+nl+'_cod_cta" VALUE="\'+request.ac_'+nl+'_cod_cta+\'" SIZE=12 ></TD>\');');
|
|
else
|
|
eval('writeln(\'<TD ALIGN=CENTER><INPUT TYPE="text" NAME="ac_'+nl+'_cod_cta" VALUE="\'+request.ac_'+nl+'_cod_cta+\'" OnChange="CtaNroPad(this);RePaint(this)" SIZE='+client.pa_longcta+' ></TD>\');');
|
|
eval('valor=request.ac_'+nl+'_cod_cta;');
|
|
if (valor != " " && valor != "" && valor != "null" ) {
|
|
CursorTabla("ct","cta_contable","=\'"+StringClip(true,valor)+"\'",false,false);
|
|
texto=c_ctas_contables.descripcion;
|
|
c_ctas_contables.close();
|
|
}
|
|
else {
|
|
texto=" "
|
|
}
|
|
eval('request.ac_'+nl+'_t_cta_contable=texto;');
|
|
eval('writeln(\'<TD><FONT COLOR="#800040">\'+request.ac_'+nl+'_t_cta_contable+\'</FONT></TD>\');');
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.ac_'+nl+'_importe+\'</B></FONT><INPUT TYPE="hidden" NAME="ac_'+nl+'_importe" VALUE="\'+request.ac_'+nl+'_importe+\'" SIZE=11 ></TD>\');');
|
|
else
|
|
eval('writeln(\'<TD><INPUT TYPE="text" NAME="ac_'+nl+'_importe" VALUE="\'+request.ac_'+nl+'_importe+\'" OnChange="ChkLinCta('+nl+');SumaCtas(this)" onBlur="NroToString(this,NF9)" onFocus="StringToNro(this,NF9)" SIZE=11 ></TD>\');');
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.ac_'+nl+'_tipo_apte+\'</B></FONT><INPUT TYPE="hidden" NAME="ac_'+nl+'_tipo_apte" VALUE="\'+request.ac_'+nl+'_tipo_apte+\'" SIZE=1 ></TD>\');'); else
|
|
eval('if (request.ac_'+nl+'_tipo_apte == "H") {writeln(\'<TD><SELECT NAME="ac_'+nl+'_tipo_apte" OnChange="ChkLinCta('+nl+');SumaCtas(this)" SIZE=1><OPTION VALUE="H" SELECTED>Haber<OPTION VALUE="D">Debe</SELECT></TD>\');}else{writeln(\'<TD><SELECT NAME="ac_'+nl+'_tipo_apte" SIZE=1><OPTION VALUE="D" SELECTED>Debe<OPTION VALUE="H">Haber</SELECT></TD>\');}');
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD ALIGN=CENTER>\'+request.ac_'+nl+'_clave+\'<FONT COLOR="#800040"><B><INPUT TYPE="hidden" NAME="ac_'+nl+'_clave" VALUE="\'+request.ac_'+nl+'_clave+\'" OnFocus="ChkLinCta('+nl+');//RePaint(this)" SIZE=3 ></TD>\');');
|
|
else
|
|
eval('writeln(\'<TD ALIGN=CENTER><INPUT TYPE="text" NAME="ac_'+nl+'_clave" VALUE="\'+request.ac_'+nl+'_clave+\'" OnChange="//RePaint(this)" SIZE=3 ></TD>\');');
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD ALIGN=CENTER>\'+request.ac_'+nl+'_concepto+\'<FONT COLOR="#800040"><B><INPUT TYPE="hidden" NAME="ac_'+nl+'_concepto" VALUE="\'+request.ac_'+nl+'_concepto+\'" SIZE=12 maxlength=35 ></TD>\');');
|
|
else
|
|
eval('writeln(\'<TD ALIGN=CENTER><INPUT TYPE="text" NAME="ac_'+nl+'_concepto" VALUE="\'+request.ac_'+nl+'_concepto+\'" OnChange="//RePaint(this)" SIZE=12 maxlength=35 ></TD>\');');
|
|
|
|
writeln("</TR>");
|
|
}
|
|
writeln('</TABLE>');
|
|
if (!request.waux && request.lock) {
|
|
writeln('<TABLE ALIGN="CENTER" BORDER="0" CELLSPACING="2" CELLPADDING="0" WIDTH="100%"><TR>');
|
|
writeln('<TD ALIGN=LEFT><INPUT type="button" name="Ver" value="Ver" onClick="FormPaint(this)"></TD>');
|
|
writeln('<TD ALIGN=RIGHT><INPUT type="button" name="ActasMas" value="Más Líneas" onClick="MasLineas(this)"></TD>');
|
|
writeln('</TR></TABLE>');
|
|
}
|
|
writeln('<TABLE BORDER=1 ALIGN=CENTER><TR>');
|
|
writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>Total Debe</B></FONT></TD>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<TD><FONT COLOR="#800040"><B>'+request.ac_totaldebe+'<INPUT TYPE="hidden" NAME="ac_totaldebe" VALUE="'+request.ac_totaldebe+'" SIZE=14 ></FONT></TD>');
|
|
else
|
|
writeln('<TD><FONT COLOR="#800040"><B><INPUT TYPE="text" NAME="ac_totaldebe" VALUE="'+request.ac_totaldebe+'" OnFocus="SumaCtas(this);//GoNextField(this)" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF11)" SIZE=14 ></FONT></TD>');
|
|
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>Total Haber</B></FONT></TD>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<TD><FONT COLOR="#800040"><B>'+request.ac_totalhaber+'<INPUT TYPE="hidden" NAME="ac_totalhaber" VALUE="'+request.ac_totalhaber+'" SIZE=14 ></FONT></TD>');
|
|
else
|
|
writeln('<TD><FONT COLOR="#800040"><B><INPUT TYPE="text" NAME="ac_totalhaber" VALUE="'+request.ac_totalhaber+'" OnFocus="SumaCtas(this);//GoNextField(this)" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF11)" SIZE=14 ></FONT></TD>');
|
|
writeln('</TR></TABLE>');
|
|
writeln('<A NAME="lin-albaran"><CENTER><H2><FONT COLOR="#800040"> Líneas del Albarán </FONT></H2></CENTER></A>');
|
|
writeln('<INPUT TYPE="hidden" NAME="nrolineas" VALUE="'+request.nrolineas+'" SIZE=2 >');
|
|
writeln('<TABLE BORDER=1 ALIGN=CENTER>');
|
|
writeln('<TR><TD><B>Nro.</B> </TD>');
|
|
writeln('<TD><B>Referencia</B></TD>');
|
|
writeln('<TD><B>Cant.</B> </TD>');
|
|
writeln('<TD><B>D e s c r i p c i ó n</B> </TD>');
|
|
writeln('<TD><B>P. Unidad</B></TD>');
|
|
writeln('<TD><B>T O T A L</B> </TD></TR>');
|
|
for (var nl=1; nl <= request.nrolineas; nl++) {
|
|
eval('if (!request.al_'+nl+'_nro_lin) { request.al_'+nl+'_nro_lin='+nl+'};');
|
|
eval('if (!request.al_'+nl+'_referencia) { request.al_'+nl+'_referencia=" "};');
|
|
eval('if (!request.al_'+nl+'_cantidad) { request.al_'+nl+'_cantidad=0};');
|
|
eval('if (!request.al_'+nl+'_descripcion) { request.al_'+nl+'_descripcion=" "};');
|
|
eval('if (!request.al_'+nl+'_precio_und) { request.al_'+nl+'_precio_und=0};');
|
|
eval('if (!request.al_'+nl+'_total) { request.al_'+nl+'_total=0};');
|
|
eval('writeln(\'<TR><TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_nro_lin+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_nro_lin" VALUE="\'+request.al_'+nl+'_nro_lin+\'" SIZE=2 ></TD> \');');
|
|
// eval('writeln(\' OnFocus="AlValor('+nl+')"></TD>\');');
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_referencia+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_referencia" VALUE="\'+request.al_'+nl+'_referencia+\'" SIZE=8 maxlength=12 ></TD>\')');
|
|
else
|
|
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_referencia" VALUE="\'+request.al_'+nl+'_referencia+\'" SIZE=8 maxlength=12 ></TD>\')');
|
|
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_cantidad+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_cantidad" VALUE="\'+request.al_'+nl+'_cantidad+\'" SIZE=6 ></TD>\')');
|
|
else
|
|
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_cantidad" VALUE="\'+request.al_'+nl+'_cantidad+\'" OnChange="CalculaLinea('+nl+')" onBlur="NroToString(this,NF5)" onFocus="StringToNro(this,NF5)" SIZE=6 ></TD>\')');
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_descripcion+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_descripcion" VALUE="\'+request.al_'+nl+'_descripcion+\'" SIZE=25 maxlength=40></TD>\');');
|
|
else
|
|
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_descripcion" VALUE="\'+request.al_'+nl+'_descripcion+\'" SIZE=25 maxlength=40></TD>\');');
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_precio_und+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_precio_und" VALUE="\'+request.al_'+nl+'_precio_und+\'" SIZE=10 ></TD>\');');
|
|
else
|
|
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_precio_und" VALUE="\'+request.al_'+nl+'_precio_und+\'" OnChange="CalculaLinea('+nl+')" onBlur="NroToString(this,NF8)" onFocus="StringToNro(this,NF8)" SIZE=10 ></TD>\');');
|
|
eval('request.al_'+nl+'_total=request.al_'+nl+'_cantidad*request.al_'+nl+'_precio_und;');
|
|
if (request.waux || !request.lock)
|
|
eval('writeln(\'<TD><FONT COLOR="#800040"><B>\'+request.al_'+nl+'_total+\'</B></FONT><INPUT TYPE="hidden" NAME="al_'+nl+'_total" VALUE="\'+request.al_'+nl+'_total+ \'" SIZE=15 ></TD></TR>\');');
|
|
else
|
|
eval('writeln(\'<TD><INPUT TYPE="text" NAME="al_'+nl+'_total" VALUE="\'+request.al_'+nl+'_total+ \'" OnFocus="CalculaLinea('+nl+');//GoNextField(this)" onBlur="NroToString(this,NF9)" onFocus="StringToNro(this,NF9)" SIZE=11 ></TD></TR>\');');
|
|
}
|
|
writeln('<TR><TD></TD>');
|
|
writeln('<TD></TD><TD></TD>');
|
|
writeln('<TD ALIGN=RIGHT><FONT COLOR="#800040"><B>S u m a T o t a l ...... </B></FONT></TD>');
|
|
writeln('<TD></TD>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<TD><FONT COLOR="#800040"><B>'+request.al_total+'<INPUT TYPE="hidden" NAME="al_total" VALUE="'+request.ac_total+'" SIZE=11 ></FONT></TD>');
|
|
else
|
|
writeln('<TD><INPUT TYPE="text" NAME="al_total" VALUE="'+request.al_total+'" OnFocus="SumaLineas(this);//GoNextField(this)" onBlur="NroToString(this,NF11)" onFocus="StringToNro(this,NF9)" SIZE=11 ></TD>');
|
|
writeln('<TR></TABLE>');
|
|
if (!request.waux && request.lock) {
|
|
writeln('<TABLE ALIGN="CENTER" BORDER="0" CELLSPACING="2" CELLPADDING="0" WIDTH="100%"><TR>');
|
|
writeln('<TD ALIGN=LEFT><INPUT type="button" name="Ver" value="Ver" onClick="FormPaint(this)"></TD>');
|
|
writeln('<TD ALIGN=RIGHT><INPUT type="button" name="AlineasMas" value="Más Líneas" onClick="MasLineas(this)"></TD>');
|
|
writeln('</TR></TABLE>');
|
|
}
|
|
writeln('<A NAME="pie-albaran"><CENTER><H2><FONT COLOR="#800040"> Notas </FONT></H2></CENTER></A>');
|
|
writeln('<TABLE BORDER=1 ALIGN=CENTER>');
|
|
writeln('<TR> <TD ALIGN=RIGHT><B>Observaciones: </B></TD>');
|
|
writeln('<FONT COLOR="#800040"><TD ALIGN=LEFT> <TEXTAREA NAME="ab_observaciones" ROWS=4 COLS=30 SIZE=30 maxlength=30 WRAP="virtual">'+request.ab_observaciones+'</TEXTAREA> </TD> </TR>');
|
|
writeln('<TD ALIGN=RIGHT><B>Vto. Jefe Obra:</B></TD>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.ab_vto_jefe_obra+'</B></FONT><INPUT type="hidden" name="ab_vto_jefe_obra" VALUE="'+request.ab_vto_jefe_obra+'" size=1 maxlength=1></TD></TR>');
|
|
else {
|
|
if ( request.ab_vto_jefe_obra == "S" ) {
|
|
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_jefe_obra" VALUE="S" CHECKED>Si');
|
|
writeln('<INPUT TYPE="radio" NAME="ab_vto_jefe_obra" VALUE="N" >No </TD></TR>');
|
|
}
|
|
else {
|
|
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_jefe_obra" VALUE="S" >Si');
|
|
writeln('<INPUT TYPE="radio" NAME="ab_vto_jefe_obra" VALUE="N" CHECKED>No </TD></TR>');
|
|
}
|
|
}
|
|
writeln('<TR><TD ALIGN=RIGHT><B>Vto. Jefe Grupo Obra:</B>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.ab_vto_jefe_grupo+'</B></FONT><INPUT type="hidden" name="ab_vto_jefe_grupo" VALUE="'+request.ab_vto_jefe_grupo+'" size=1 maxlength=1></TD></TR>');
|
|
else {
|
|
if ( request.ab_vto_jefe_grupo == "S" ) {
|
|
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_jefe_grupo" VALUE="S" CHECKED>Si');
|
|
writeln('<INPUT TYPE="radio" NAME="ab_vto_jefe_grupo" VALUE="N" >No </TD></TR>');
|
|
}
|
|
else {
|
|
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_jefe_grupo" VALUE="S" >Si');
|
|
writeln('<INPUT TYPE="radio" NAME="ab_vto_jefe_grupo" VALUE="N" CHECKED>No </TD></TR>');
|
|
}
|
|
}
|
|
writeln('<TD ALIGN=RIGHT><B>Conforme Proveedor:</B>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<TD ALIGN=LEFT><FONT COLOR="#800040"><B>'+request.ab_vto_proveedor+'</B></FONT><INPUT type="hidden" name="ab_vto_proveedor" VALUE="'+request.ab_vto_proveedor+'" size=1 maxlength=1></TD></TR>');
|
|
else {
|
|
if ( request.ab_vto_proveedor == "S" ) {
|
|
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_proveedor" VALUE="S" CHECKED>Si');
|
|
writeln('<INPUT TYPE="radio" NAME="ab_vto_proveedor" VALUE="N" >No </TD></TR>');
|
|
}
|
|
else {
|
|
writeln('<TD ALIGN=LEFT><INPUT TYPE="radio" NAME="ab_vto_proveedor" VALUE="S" >Si');
|
|
writeln('<INPUT TYPE="radio" NAME="ab_vto_proveedor" VALUE="N" CHECKED>No </TD></TR>');
|
|
}
|
|
}
|
|
writeln('<TR><TD ALIGN=RIGHT><B>Expediente:</B></TD>');
|
|
if (request.waux || !request.lock)
|
|
writeln('<TD><FONT COLOR="#800040"><B>'+request.ab_expediente+'</B></FONT><INPUT type="hidden" name="ab_expediente" VALUE="'+request.ab_expediente+'" size=35 maxlength=40></TD></TR>');
|
|
else
|
|
writeln('<TD><INPUT type="text" name="ab_expediente" VALUE="'+request.ab_expediente+'" size=35 maxlength=40></TD>');
|
|
writeln('</TR></TABLE></CENTER>');
|
|
writeln('</FORM></FONT>');
|
|
if (!request.waux) {
|
|
writeSignature(true);
|
|
}
|
|
if (request.gofunc) {
|
|
writeln('-->');
|
|
}
|
|
else {
|
|
writeln('</BODY>');
|
|
writeln('</HTML>');
|
|
}
|
|
</SERVER>
|
|
|