Mantenedor de compras!

This commit is contained in:
2021-07-14 03:58:17 -04:00
parent 4b71bc67aa
commit 0816f37611
9 changed files with 436 additions and 29 deletions

View File

@@ -183,31 +183,25 @@ create table compras
create table facturas
(
id uuid primary key default gen_random_uuid(),
numero text not null,
monto_bruto bigint not null,
iva bigint not null default 0,
ila bigint not null default 0,
monto_neto bigint not null,
fecha_emision date not null,
fecha_vencimiento date not null,
compra_id uuid references compras,
created_at timestamptz not null default current_timestamp,
updated_at timestamptz not null default current_timestamp,
deleted_at timestamptz
id uuid primary key default gen_random_uuid(),
numero text not null,
monto_bruto bigint not null,
compra_id uuid references compras,
created_at timestamptz not null default current_timestamp,
updated_at timestamptz not null default current_timestamp,
deleted_at timestamptz
);
create table compra_ingredientes
(
id uuid primary key default gen_random_uuid(),
unidades numeric not null,
monto_unitario_bruto bigint not null,
monto_unitario_neto bigint not null,
compra_id uuid references compras,
ingrediente_id uuid references ingredientes,
created_at timestamptz not null default current_timestamp,
updated_at timestamptz not null default current_timestamp,
deleted_at timestamptz
id uuid primary key default gen_random_uuid(),
unidades numeric not null,
monto_unitario bigint not null,
compra_id uuid references compras,
ingrediente_id uuid references ingredientes,
created_at timestamptz not null default current_timestamp,
updated_at timestamptz not null default current_timestamp,
deleted_at timestamptz
);
create table sectores

View File

@@ -0,0 +1,8 @@
alter table facturas drop column iva;
alter table facturas drop column ila;
alter table facturas drop column monto_neto;
alter table facturas drop column fecha_emision;
alter table facturas drop column fecha_vencimiento;
alter table compra_ingredientes rename column monto_unitario_bruto to monto_unitario;
alter table compra_ingredientes drop column monto_unitario_neto;