fix bugs in sales and purchases API.

This commit is contained in:
Ahmed Bouhuolia
2020-08-04 23:00:15 +02:00
parent db28cd2aef
commit ad772cf247
31 changed files with 420 additions and 819 deletions

View File

@@ -132,6 +132,18 @@ const getTotalDeep = (items, deepProp, totalProp) =>
return _.sumBy(item, totalProp) + total + acc;
}, 0);
function applyMixins(derivedCtor, baseCtors) {
baseCtors.forEach((baseCtor) => {
Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
Object.defineProperty(
derivedCtor.prototype,
name,
Object.getOwnPropertyDescriptor(baseCtor.prototype, name)
);
});
});
}
export {
hashPassword,
origin,
@@ -143,4 +155,5 @@ export {
flatToNestedArray,
itemsStartWith,
getTotalDeep,
applyMixins,
};