Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aaro-scripts

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aaro-scripts - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

6

index.js
const getAllProducts = require("./sections/stock/stockScripts");
const getAllPriceListItems = require("./sections/priceList/priceListScripts");
const {
getAllPriceListItems,
showPassiveItemsOnPriceList,
} = require("./sections/priceList/priceListScripts");
const getStocksForPriceList = require("./sections/combined/combinedScripts");

@@ -9,2 +12,3 @@

getStocksForPriceList,
showPassiveItemsOnPriceList,
};

2

package.json
{
"name": "aaro-scripts",
"version": "1.0.4",
"version": "1.0.5",
"description": "Useful scripts for aaro erp",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,3 +6,3 @@ const { sleep } = require("../helpers/sleep");

* @param {object} aaro object
* @param {object} params extra limitations like EsnekAramaKisiti="PRF.PRVU"
* @param {object} params extra limitations like FiyatListesiID=84
* @returns {array}

@@ -43,2 +43,35 @@ */

module.exports = getAllPriceListItems;
/**
* @description It removes all the passive products from a price list.
* When you duplicate a price list and turn a product into a passive which is already in the list
* Remains on the list. With that method you can see them.
* @param {object} aaro authenticated object
* @param {integer} priceListID
* @return {array} of passive products
*/
const showPassiveItemsOnPriceList = async (aaro, priceListID) => {
try {
const passiveItems = [];
const products = await getAllPriceListItems(aaro, {
FiyatListesiID: priceListID,
});
const search = products.map((el) => el.StokID);
while (search.length) {
const partialSearch = search.splice(0, 100);
const searchQuery = partialSearch.join(",");
const detailedProducts = await aaro
.get("Stok", { SayfaSatirSayisi: 100, StokID: searchQuery })
.then((response) => response.data.Model);
detailedProducts.forEach((product) =>
product.Durum == false ? passiveItems.push(product) : ""
);
}
return passiveItems;
} catch (err) {
throw err;
}
};
module.exports = { getAllPriceListItems, showPassiveItemsOnPriceList };
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc