parent/children register
Posted: 2015-09-06 01:30
Hi, I have 2 tables with parent/children option enabled:
ventas (parent): id,fecha,vendedor,importe
detalle_venta (children): id,id_venta,codigo_producto,precio,cantidad,importe
When insert a new register in detalle_venta, don't show nothing in the table, and when check in the phpmyadmin, the id_venta is null. For example
ventas:
id=5
fecha= 2015-09-05 18:59:25
vendedor=2
importe=0
detalle_venta:
id=4
id_venta=null
codigo_producto=3
precio=null
cantidad=20
why this happens?
Another thing. I have the field codigo_producto like lookup field and precio like autofill, both from the another table. If I choose one item from the select list of the field codigo_producto, the field precio appears the content of the field from another table, but don't save the price.
I need to save the value of precio in the detalle_venta table too.
Can you tell me how to fix that?
ventas (parent): id,fecha,vendedor,importe
detalle_venta (children): id,id_venta,codigo_producto,precio,cantidad,importe
When insert a new register in detalle_venta, don't show nothing in the table, and when check in the phpmyadmin, the id_venta is null. For example
ventas:
id=5
fecha= 2015-09-05 18:59:25
vendedor=2
importe=0
detalle_venta:
id=4
id_venta=null
codigo_producto=3
precio=null
cantidad=20
why this happens?
Another thing. I have the field codigo_producto like lookup field and precio like autofill, both from the another table. If I choose one item from the select list of the field codigo_producto, the field precio appears the content of the field from another table, but don't save the price.
I need to save the value of precio in the detalle_venta table too.
Can you tell me how to fix that?