registrar ventas( Power Builder 9.0)
Publicado por edwin alfredo carmen lazo (3 intervenciones) el 20/11/2009 15:14:59
Hola amigos , por favor quiero q me ayuden a desarrollar un formulario, para registrar ventas en power builder 9.0, Este es mi codigo:
integer idusuario,idclie,idper,idprod
//datetime fech
double subtot,ig,tot
int li_rc
li_rc=MessageBox("Finalizar venta","¿Esta seguro de Finalizar la venta?",Question!,YesNo!)
if li_rc = 1 then
tot=dw_1.object.compute_1[dw_1.getrow()]
//GRABA LOS CAMPOS DE LA TABLA VENTAS
INSERT INTO venta
( cod_venta,
cod_cliente,
cod_personal,
tot_venta,
fech_venta,
hora_venta )
VALUES ( :sle_codigo.text,
:sle_codcliente.text,
:sle_personal.text,
:tot,
:sle_fecha.text,
:sle_hora.text ) ;
end if
String descripcion
double punitario,importe
int indice,Ub,Ed,idpedido,cant
for indice=1 to dw_1.rowcount()
if dw_1.accepttext()=1 then
idpedido=Integer(dw_1.object.cod_venta[indice])
idprod=Integer(dw_1.object.cod_producto[indice] )
descripcion=String(dw_2.object.nom_producto[indice])
punitario=double(dw_2.object.pre_producto[indice])
cant=integer(dw_2.object.cant_producto[indice])
Ub=integer(dw_2.object.dscto_producto[indice])
importe=double(dw_2.object.sub_venta[indice])
end if
insert into detalleventa(Cod_venta,Cod_producto,Nom_producto,Pre_producto,Cant_producto,Dscto_producto,Sub_venta)
values(:idpedido,:idprod,:descripcion,:punitario,:cant,:Ub,:importe);
dw_1.scrollnextrow()
next
dw_1.reset()
w_ventas.TriggerEvent(OPEN!)
/*else
return
end if*/
Lo que kiero hacer es registrar la venta del y que se graben los datos tanto en la tabla ventas como la table detalle de la venta, por favor.
integer idusuario,idclie,idper,idprod
//datetime fech
double subtot,ig,tot
int li_rc
li_rc=MessageBox("Finalizar venta","¿Esta seguro de Finalizar la venta?",Question!,YesNo!)
if li_rc = 1 then
tot=dw_1.object.compute_1[dw_1.getrow()]
//GRABA LOS CAMPOS DE LA TABLA VENTAS
INSERT INTO venta
( cod_venta,
cod_cliente,
cod_personal,
tot_venta,
fech_venta,
hora_venta )
VALUES ( :sle_codigo.text,
:sle_codcliente.text,
:sle_personal.text,
:tot,
:sle_fecha.text,
:sle_hora.text ) ;
end if
String descripcion
double punitario,importe
int indice,Ub,Ed,idpedido,cant
for indice=1 to dw_1.rowcount()
if dw_1.accepttext()=1 then
idpedido=Integer(dw_1.object.cod_venta[indice])
idprod=Integer(dw_1.object.cod_producto[indice] )
descripcion=String(dw_2.object.nom_producto[indice])
punitario=double(dw_2.object.pre_producto[indice])
cant=integer(dw_2.object.cant_producto[indice])
Ub=integer(dw_2.object.dscto_producto[indice])
importe=double(dw_2.object.sub_venta[indice])
end if
insert into detalleventa(Cod_venta,Cod_producto,Nom_producto,Pre_producto,Cant_producto,Dscto_producto,Sub_venta)
values(:idpedido,:idprod,:descripcion,:punitario,:cant,:Ub,:importe);
dw_1.scrollnextrow()
next
dw_1.reset()
w_ventas.TriggerEvent(OPEN!)
/*else
return
end if*/
Lo que kiero hacer es registrar la venta del y que se graben los datos tanto en la tabla ventas como la table detalle de la venta, por favor.
Valora esta pregunta
0