Ammends
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-08-05 13:42:19 +02:00
parent 94b668c01e
commit 1b9ca13391
5 changed files with 10 additions and 10 deletions

View File

@ -1,14 +1,14 @@
create table `vn`.`buyImportReference`
create table `vn`.`itemMatchProperties`
(
itemFk int not null,
name varchar(80) not null,
company varchar(80) not null,
producer varchar(80) not null,
size int not null,
constraint buyImportReference_pk
primary key (itemFk, name, company, size),
constraint itemMatchProperties_pk
primary key (itemFk, name, producer, size),
constraint itemFk___fk
foreign key (itemFk) references item (id)
on update cascade on delete cascade
)
comment 'Referencias de compras importadas';
comment 'Propiedades para encontrar articulos equivalentes en verdnatura';

View File

@ -72,7 +72,7 @@ module.exports = Self => {
packageFk: buy.packageFk
});
await models.BuyImportReference.upsert({
await models.ItemMatchProperties.upsert({
itemFk: buy.itemFk,
name: buy.description,
company: buy.companyName,

View File

@ -41,7 +41,7 @@ module.exports = Self => {
if (packaging)
buy.packageFk = packaging.id;
const reference = await models.BuyImportReference.findOne({
const reference = await models.ItemMatchProperties.findOne({
fields: ['itemFk'],
where: {
name: buy.description,

View File

@ -5,7 +5,7 @@
"Buy": {
"dataSource": "vn"
},
"BuyImportReference": {
"ItemMatchProperties": {
"dataSource": "vn"
},
"EntryLog": {

View File

@ -1,9 +1,9 @@
{
"name": "BuyImportReference",
"name": "ItemMatchProperties",
"base": "VnModel",
"options": {
"mysql": {
"table": "buyImportReference"
"table": "itemMatchProperties"
}
},
"properties": {