diff --git a/modules/entry/back/methods/entry/import.js b/modules/entry/back/methods/entry/import.js index efcd1001d..4b33fe964 100644 --- a/modules/entry/back/methods/entry/import.js +++ b/modules/entry/back/methods/entry/import.js @@ -29,7 +29,6 @@ module.exports = Self => { const models = Self.app.models; const entry = await models.Entry.findById(id); - console.log(entry); const buys = []; for (let buy of args.buys) { @@ -37,8 +36,10 @@ module.exports = Self => { entryFk: entry.id, itemFk: buy.itemFk, stickers: 1, + quantity: 1, packing: buy.packing, grouping: buy.grouping, + buyingValue: buy.buyingValue, packageFk: 1 }); } diff --git a/modules/entry/back/methods/entry/importPreview.js b/modules/entry/back/methods/entry/importPreview.js new file mode 100644 index 000000000..074f27ca7 --- /dev/null +++ b/modules/entry/back/methods/entry/importPreview.js @@ -0,0 +1,25 @@ +module.exports = Self => { + Self.remoteMethod('importPreview', { + description: '', + accessType: 'READ', + accepts: { + arg: 'id', + type: 'number', + required: true, + description: 'The entry id', + http: {source: 'path'} + }, + returns: { + type: ['Object'], + root: true + }, + http: { + path: `/:id/importPreview`, + verb: 'GET' + } + }); + + Self.importPreview = async id => { + return buys; + }; +}; diff --git a/modules/entry/front/buy/import/index.html b/modules/entry/front/buy/import/index.html index f3fbdc50c..231b086fd 100644 --- a/modules/entry/front/buy/import/index.html +++ b/modules/entry/front/buy/import/index.html @@ -87,15 +87,11 @@