fix: refs #7524 backSuppliersPackaging
gitea/salix/pipeline/pr-master There was a failure building this commit
Details
gitea/salix/pipeline/pr-master There was a failure building this commit
Details
This commit is contained in:
parent
52e8bac168
commit
e90d48c777
|
@ -15,12 +15,17 @@ module.exports = Self => {
|
|||
Self.getWithPackaging = async options => {
|
||||
const models = Self.app.models;
|
||||
const myOptions = {};
|
||||
const oneYearAgo = new Date();
|
||||
oneYearAgo.setFullYear(oneYearAgo.getFullYear() - 1);
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
const entries = await models.Entry.find({
|
||||
where: {typeFk: 'packaging'},
|
||||
where: {
|
||||
typeFk: 'packaging',
|
||||
created: {gte: oneYearAgo}
|
||||
},
|
||||
include: {
|
||||
relation: 'supplier',
|
||||
scope: {
|
||||
|
|
|
@ -18,6 +18,7 @@ describe('Supplier getWithPackaging()', () => {
|
|||
|
||||
await entry.updateAttributes({
|
||||
typeFk: typeFk,
|
||||
created: new Date()
|
||||
});
|
||||
|
||||
const result = await models.Supplier.getWithPackaging(myOptions);
|
||||
|
|
Loading…
Reference in New Issue