Mantenedor de compras!
This commit is contained in:
@@ -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
|
||||
|
||||
8
database/modifications/03-simplify-facturas.sql
Normal file
8
database/modifications/03-simplify-facturas.sql
Normal 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;
|
||||
Reference in New Issue
Block a user