Modelo de base de datos en lumen
This commit is contained in:
@@ -108,22 +108,22 @@ values ('2021-01-01'::date, (select id from proveedores where nombre = 'Coca-Col
|
||||
('2021-02-01'::date, (select id from proveedores where nombre = 'Santa Isabel'), (select id from restaurantes where nombre = 'Todo Rico Restaurant')),
|
||||
('2021-01-01'::date, (select id from proveedores where nombre = 'Coca-Cola'), (select id from restaurantes where nombre = 'Todo Rico Restaurant'));
|
||||
|
||||
insert into compra_ingredientes (unidades, monto_unitario_bruto, iva, ila, monto_unitario_neto, compra_id, ingrediente_id)
|
||||
values (20, 500, 500 * .19, 0, 500 * 1.19, (select id from compras limit 1 offset 0), (select id from ingredientes where nombre = 'Coca-Cola')),
|
||||
(50, 1000, 1000 * .19, 0, 1000 * 1.19, (select id from compras limit 1 offset 1), (select id from ingredientes where nombre = 'Chuletas')),
|
||||
(25, 1000, 1000 * .19, 0, 1000 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Papas')),
|
||||
(10, 500, 500 * .19, 0, 500 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Papas Pre-Fritas')),
|
||||
(5, 300, 300 * .19, 0, 300 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Sal')),
|
||||
(10, 2000, 2000 * .19, 0, 2000 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Mantequilla')),
|
||||
(10, 700, 700 * .19, 0, 700 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Leche')),
|
||||
(50, 1000, 1000 * .19, 0, 1000 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Aceite')),
|
||||
(20, 500, 500 * .19, 0, 500 * 1.19, (select id from compras limit 1 offset 3), (select id from ingredientes where nombre = 'Coca-Cola'));
|
||||
insert into compra_ingredientes (unidades, monto_unitario_bruto, monto_unitario_neto, compra_id, ingrediente_id)
|
||||
values (20, 500, 500 * 1.19, (select id from compras limit 1 offset 0), (select id from ingredientes where nombre = 'Coca-Cola')),
|
||||
(50, 1000, 1000 * 1.19, (select id from compras limit 1 offset 1), (select id from ingredientes where nombre = 'Chuletas')),
|
||||
(25, 1000, 1000 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Papas')),
|
||||
(10, 500, 500 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Papas Pre-Fritas')),
|
||||
(5, 300, 300 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Sal')),
|
||||
(10, 2000, 2000 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Mantequilla')),
|
||||
(10, 700, 700 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Leche')),
|
||||
(50, 1000, 1000 * 1.19, (select id from compras limit 1 offset 2), (select id from ingredientes where nombre = 'Aceite')),
|
||||
(20, 500, 500 * 1.19, (select id from compras limit 1 offset 3), (select id from ingredientes where nombre = 'Coca-Cola'));
|
||||
|
||||
insert into facturas (numero, monto_bruto, iva, ila, monto_neto, fecha_emision, fecha_vencimiento, compra_id)
|
||||
values ('1', 500 * 20, 500 * 20 * .19, 0, 500 * 20 * 1.19, '2021-01-01'::date, '2021-01-30'::date, (select id from compras limit 1 offset 0)),
|
||||
('1', 1000 * 50, 1000 * 50 * .19, 0, 1000 * 50 * 1.19, '2021-02-01'::date, '2021-02-28'::date, (select id from compras limit 1 offset 1)),
|
||||
('1', 108500, 20615, 0, 129115, '2021-02-10'::date, '2021-02-28'::date, (select id from compras limit 1 offset 2)),
|
||||
('1', 500 * 20, 500 * 20 * .19, 0, 500 * 20 * 1.19, '2021-01-01'::date, '2021-01-30'::date, (select id from compras limit 1 offset 0));
|
||||
insert into facturas (numero, monto_bruto, monto_neto, fecha_emision, fecha_vencimiento, compra_id)
|
||||
values ('1', 500 * 20, 500 * 20 * 1.19, '2021-01-01'::date, '2021-01-30'::date, (select id from compras limit 1 offset 0)),
|
||||
('1', 1000 * 50, 1000 * 50 * 1.19, '2021-02-01'::date, '2021-02-28'::date, (select id from compras limit 1 offset 1)),
|
||||
('1', 108500, 129115, '2021-02-10'::date, '2021-02-28'::date, (select id from compras limit 1 offset 2)),
|
||||
('1', 500 * 20, 500 * 20 * 1.19, '2021-01-01'::date, '2021-01-30'::date, (select id from compras limit 1 offset 0));
|
||||
|
||||
-----------------------------------
|
||||
--- Creando ventas para descontar del inventario
|
||||
|
||||
Reference in New Issue
Block a user