#6321 - Negative tickets #1945

Open
jsegarra wants to merge 93 commits from 6321_negative_tickets into dev
3 changed files with 785 additions and 0 deletions
Showing only changes of commit 91f5ee3b93 - Show all commits

View File

@ -3043,3 +3043,6 @@ INSERT INTO `vn`.`clientSms` (`id`, `clientFk`, `smsFk`, `ticketFk`)
(4, 1103, 4, 32),
(13, 1101, 1, NULL),
(14, 1101, 4, 27);
-- Auto-generated SQL script #202401191358
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('Ticket','itemLack','READ','ALLOW','ROLE','employee');

View File

@ -0,0 +1,781 @@
module.exports = Self => {
Self.remoteMethod('itemLack', {
description: 'Download a ticket delivery note document',
accessType: 'READ',
accepts: [
{
arg: 'filter',
type: 'object',
description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string',
http: {source: 'query'}
},
],
returns: [
{
arg: 'body',
type: ['object'],
root: true
}
],
http: {
path: `/itemLack`,
verb: 'GET'
}
});
Self.itemLack = async(ctx, filter, options) => {
const myOptions = {};
if (typeof options == 'object')
Object.assign(myOptions, options);
// let query = 'CALL vn.item_getLack(?, ?)';
// const result = await Self.rawSql(query, [true, 2]);
// if (tx) await tx.commit();
return [
{
'itemFk': 7176,
'longName': 'Anthurium Olivius x20',
'warehouseFk': 60,
'producer': null,
'size': null,
'category': null,
'warehouse': 'Algemesi',
'lack': -40,
'inkFk': 'VRD',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 14613,
'longName': 'Crisantemo Uniflora Anastasia Topsin',
'warehouseFk': 60,
'producer': null,
'size': 70,
'category': null,
'warehouse': 'Algemesi',
'lack': -10,
'inkFk': 'BLN',
'timed': '2024-01-19T15:20:00.000Z',
'minTimed': '16:20'
},
{
'itemFk': 28619,
'longName': 'Clavel Mix Fancy',
'warehouseFk': 60,
'producer': 'Benchmark',
'size': 60,
'category': 'Fan',
'warehouse': 'Algemesi',
'lack': -700,
'inkFk': 'MIX',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 29422,
'longName': 'Lisianthus Doble Green',
'warehouseFk': 60,
'producer': 'L.I.S.',
'size': 65,
'category': null,
'warehouse': 'Algemesi',
'lack': -10,
'inkFk': 'VRC',
'timed': '2024-01-19T16:00:00.000Z',
'minTimed': '17:00'
},
{
'itemFk': 29590,
'longName': 'Schlumbergera (3 Colors)',
'warehouseFk': 60,
'producer': 'Gartneriet Thoruplund',
'size': 18,
'category': null,
'warehouse': 'Algemesi',
'lack': -18,
'inkFk': 'MIX',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 33636,
'longName': 'Antirrinum Lavander',
'warehouseFk': 60,
'producer': null,
'size': 80,
'category': null,
'warehouse': 'Algemesi',
'lack': -10,
'inkFk': 'LAV',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 36864,
'longName': 'Kattegrass (Comida para gatos)',
'warehouseFk': 60,
'producer': 'Willem Jongenotter Kw.',
'size': 10,
'category': null,
'warehouse': 'Algemesi',
'lack': -10,
'inkFk': 'VRD',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 38631,
'longName': 'Triple Accion Listo Uso',
'warehouseFk': 60,
'producer': 'Flower',
'size': null,
'category': 'ml',
'warehouse': 'Algemesi',
'lack': -24,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 53233,
'longName': 'Clavel Cheerio Fancy',
'warehouseFk': 60,
'producer': 'Benchmark',
'size': 60,
'category': 'Fan',
'warehouse': 'Algemesi',
'lack': -50,
'inkFk': 'R\/B',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 60525,
'longName': 'Rosa Explorer Extra',
'warehouseFk': 60,
'producer': 'Floraroma',
'size': 60,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -500,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 68998,
'longName': 'Clavel Hot Pink Select',
'warehouseFk': 60,
'producer': 'Funza',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -25,
'inkFk': 'FUC',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 77807,
'longName': 'Hydrangea Mix 4Flo',
'warehouseFk': 60,
'producer': 'Schroll-Flowers',
'size': 35,
'category': null,
'warehouse': 'Algemesi',
'lack': -6,
'inkFk': 'MIX',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 84883,
'longName': 'Rosa Freedom Standard',
'warehouseFk': 60,
'producer': 'El Milagro',
'size': 40,
'category': 'Sta',
'warehouse': 'Algemesi',
'lack': -600,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 92466,
'longName': 'Clavel Kino Select',
'warehouseFk': 60,
'producer': 'Funza',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -25,
'inkFk': 'P\/B',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 93355,
'longName': 'Clavel Caramel Fancy',
'warehouseFk': 60,
'producer': 'Funza',
'size': 60,
'category': 'Fan',
'warehouse': 'Algemesi',
'lack': -50,
'inkFk': 'TRR',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 95068,
'longName': 'Alstroemeria Fifi Plus',
'warehouseFk': 60,
'producer': 'Funza',
'size': 80,
'category': 'Plu',
'warehouse': 'Algemesi',
'lack': -30,
'inkFk': 'SWE',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 107891,
'longName': 'Rosa Freedom Select',
'warehouseFk': 60,
'producer': 'Excellence',
'size': 40,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -1000,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 113163,
'longName': 'Lilium Oriental Roselily Aisha 2',
'warehouseFk': 60,
'producer': 'Moerman Lilium BV',
'size': 65,
'category': null,
'warehouse': 'Algemesi',
'lack': -10,
'inkFk': 'BLN',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 117832,
'longName': 'Rosa Freedom Standard',
'warehouseFk': 60,
'producer': 'Multiflora',
'size': 50,
'category': 'Sta',
'warehouse': 'Algemesi',
'lack': -200,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 123005,
'longName': 'Rosa Orange Crush Extra',
'warehouseFk': 60,
'producer': 'Trebol',
'size': 50,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -125,
'inkFk': 'NAR',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 123380,
'longName': 'Clavel Hypnosis Standard',
'warehouseFk': 60,
'producer': 'GEOFLORA',
'size': 50,
'category': 'Sta',
'warehouse': 'Algemesi',
'lack': -25,
'inkFk': 'LAV',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 124948,
'longName': 'Cymbidium Mon Amour',
'warehouseFk': 60,
'producer': 'New Orchids',
'size': 60,
'category': null,
'warehouse': 'Algemesi',
'lack': -1,
'inkFk': 'BLN',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 125062,
'longName': 'Hoya Kerri Cerámica',
'warehouseFk': 60,
'producer': 'Gartneriet Lundager',
'size': 15,
'category': null,
'warehouse': 'Algemesi',
'lack': -18,
'inkFk': 'VRD',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 125593,
'longName': 'Hoya Kerri Cerámica Roja',
'warehouseFk': 60,
'producer': 'v.d. Arend Tropical',
'size': 12,
'category': null,
'warehouse': 'Algemesi',
'lack': -1,
'inkFk': 'VRD',
'timed': '2024-01-19T15:20:00.000Z',
'minTimed': '16:20'
},
{
'itemFk': 126428,
'longName': 'Rosa Freedom Extra',
'warehouseFk': 60,
'producer': 'Matina',
'size': 50,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -25,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 128417,
'longName': 'Rosa Brighton Select',
'warehouseFk': 60,
'producer': 'Excellence',
'size': 50,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -75,
'inkFk': 'AMA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 132651,
'longName': 'Rosa Freedom Select',
'warehouseFk': 60,
'producer': 'Excellence',
'size': 60,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -1250,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 135194,
'longName': 'Eucalipto Torreliana Small',
'warehouseFk': 60,
'producer': null,
'size': 40,
'category': null,
'warehouse': 'Algemesi',
'lack': -20,
'inkFk': 'M\/V',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 135516,
'longName': 'Hydrangea Curaçao Petite',
'warehouseFk': 60,
'producer': 'Flores del Este',
'size': 60,
'category': 'Pet',
'warehouse': 'Algemesi',
'lack': -15,
'inkFk': 'AZL',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 136169,
'longName': 'Hydrangea Turquesa Jumbo',
'warehouseFk': 60,
'producer': null,
'size': 0,
'category': null,
'warehouse': 'Algemesi',
'lack': -1,
'inkFk': 'TUR',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 136518,
'longName': 'Rosa Freedom Select',
'warehouseFk': 60,
'producer': 'Excellence',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -200,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 136733,
'longName': 'Rosa LightHouse Premium',
'warehouseFk': 60,
'producer': 'Santa Dorotea',
'size': 50,
'category': 'Pre',
'warehouse': 'Algemesi',
'lack': -100,
'inkFk': 'AMA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 137200,
'longName': 'Rosa Luciano Extra',
'warehouseFk': 60,
'producer': 'Santa Dorotea',
'size': 50,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -250,
'inkFk': 'RSA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 137203,
'longName': 'Rosa Satina Extra',
'warehouseFk': 60,
'producer': 'Santa Dorotea',
'size': 40,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -600,
'inkFk': 'RSA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 137204,
'longName': 'Rosa Satina Extra',
'warehouseFk': 60,
'producer': 'Santa Dorotea',
'size': 50,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -125,
'inkFk': 'RSA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 137207,
'longName': 'Rosa Mix Extra',
'warehouseFk': 60,
'producer': 'Santa Dorotea',
'size': 40,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -875,
'inkFk': 'MIX',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 137213,
'longName': 'Rosa Vendela Extra',
'warehouseFk': 60,
'producer': 'Santa Dorotea',
'size': 40,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -1800,
'inkFk': 'BLN',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 137233,
'longName': 'Rosa Freedom Extra',
'warehouseFk': 60,
'producer': 'Santa Dorotea',
'size': 40,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -1200,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 137234,
'longName': 'Rosa Freedom Extra',
'warehouseFk': 60,
'producer': 'Santa Dorotea',
'size': 50,
'category': 'Ext',
'warehouse': 'Algemesi',
'lack': -600,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 137748,
'longName': 'Clavel Mini Hot Pink Select',
'warehouseFk': 60,
'producer': null,
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -20,
'inkFk': 'FUC',
'timed': '2024-01-19T12:45:00.000Z',
'minTimed': '13:45'
},
{
'itemFk': 137814,
'longName': 'Rosa Freedom Premium',
'warehouseFk': 60,
'producer': 'Santa Dorotea',
'size': 80,
'category': 'Pre',
'warehouse': 'Algemesi',
'lack': -1200,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 139016,
'longName': 'Cesta Cassius',
'warehouseFk': 60,
'producer': 'Mega Ceramics',
'size': 29,
'category': null,
'warehouse': 'Algemesi',
'lack': -2,
'inkFk': 'NAT',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 142330,
'longName': 'Rosa Glam Dome Rosa',
'warehouseFk': 60,
'producer': null,
'size': 0,
'category': null,
'warehouse': 'Algemesi',
'lack': -3,
'inkFk': 'RSA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 142331,
'longName': 'Rosa Glam Dome Rojo',
'warehouseFk': 60,
'producer': null,
'size': 0,
'category': null,
'warehouse': 'Algemesi',
'lack': -6,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143511,
'longName': 'Clavel White Florafil Select',
'warehouseFk': 60,
'producer': 'Colibri',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -200,
'inkFk': 'BLN',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143512,
'longName': 'Clavel Red Florafil Select',
'warehouseFk': 60,
'producer': 'Colibri',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -200,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143513,
'longName': 'Clavel Lege Pink Florafil Select',
'warehouseFk': 60,
'producer': 'Colibri',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -200,
'inkFk': 'RSA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143556,
'longName': 'Clavel Mini White Select',
'warehouseFk': 60,
'producer': 'Colibri',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -400,
'inkFk': 'BLN',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143557,
'longName': 'Clavel Mini Red Select',
'warehouseFk': 60,
'producer': 'Colibri',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -400,
'inkFk': 'ROJ',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143575,
'longName': 'Clavel Mini Bicolor Mix Select',
'warehouseFk': 60,
'producer': 'Colibri',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -2000,
'inkFk': 'MIX',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143697,
'longName': 'Syngonium Rosa Colgante',
'warehouseFk': 60,
'producer': 'Quakelplant BV',
'size': 35,
'category': null,
'warehouse': 'Algemesi',
'lack': -3,
'inkFk': 'RSA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143833,
'longName': 'Cymbidium Magic',
'warehouseFk': 60,
'producer': 'HVS Orchids',
'size': 50,
'category': null,
'warehouse': 'Algemesi',
'lack': -3,
'inkFk': 'BLN',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143918,
'longName': 'Ranunculus Sprinkles Mix',
'warehouseFk': 60,
'producer': 'Firma P.A.M. van Os',
'size': 27,
'category': null,
'warehouse': 'Algemesi',
'lack': -12,
'inkFk': 'MIX',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 143923,
'longName': 'Dieff se Tropic Snow 2 Plantas',
'warehouseFk': 60,
'producer': 'Floramiata',
'size': 80,
'category': null,
'warehouse': 'Algemesi',
'lack': -1,
'inkFk': 'VRD',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 144034,
'longName': 'Clavel Pink Florafil Select',
'warehouseFk': 60,
'producer': 'Colibri',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -200,
'inkFk': 'RSA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 144035,
'longName': 'Clavel Bicolor Mix Florafil Select',
'warehouseFk': 60,
'producer': 'Colibri',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -2000,
'inkFk': 'MIX',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
},
{
'itemFk': 144115,
'longName': 'Clavel Mini Hot Pink Select',
'warehouseFk': 60,
'producer': 'Colibri',
'size': 70,
'category': 'Sel',
'warehouse': 'Algemesi',
'lack': -400,
'inkFk': 'RSA',
'timed': '2024-01-19T22:59:59.000Z',
'minTimed': '2024-01-19 23:59:59'
}];
};
};

View File

@ -43,4 +43,5 @@ module.exports = function(Self) {
require('../methods/ticket/saveSign')(Self);
require('../methods/ticket/invoiceTickets')(Self);
require('../methods/ticket/docuwareDownload')(Self);
require('../methods/ticket/itemLack')(Self);
};