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.8 to 1.0.9

6

index.js

@@ -1,3 +0,6 @@

const getAllProducts = require("./sections/stock/stockScripts");
const {
getAllProducts,
getAllSales,
} = require("./sections/stock/stockScripts");
const {
getAllPriceListItems,

@@ -19,2 +22,3 @@ showPassiveItemsOnPriceList,

getAllData,
getAllSales,
};

2

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

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

@@ -42,2 +42,52 @@ const { sleep } = require("../helpers/sleep");

module.exports = getAllProducts;
/**
* @description It retrieves all the sales between two dates
* @param {object} aaro authorized object
* @param {string} date1 for starting date, like "2021-07-01"
* @param {string} date2 for ending date, like "2021-07-25"
* @param {object} TipID for sales, default 10005
* @param {object} params extra params for limitations like DepoID:11
* @returns {array}
*/
const getAllSales = async (aaro, date1, date2, TipID = 10005, params = {}) => {
try {
const sales = [];
let page = 1;
let currentPage = await aaro
.get("StokHareketleri", {
Sayfa: page,
TarihBas: date1,
TarihBit: date2,
TipID,
SayfaSatirSayisi: 100,
...params,
})
.then((response) => response.data);
currentPage.Model.forEach((el) => sales.push(el));
while (currentPage.SayfalandirmaBilgisi.SonrakiSayfaVarMi) {
page += 1;
currentPage = await aaro
.get("StokHareketleri", {
Sayfa: page,
SayfaSatirSayisi: 100,
TarihBas: date1,
TarihBit: date2,
TipID,
...params,
})
.then((response) => response.data);
currentPage.Model.forEach((el) => sales.push(el));
await sleep(200);
}
return sales;
} catch (err) {
throw err;
}
};
module.exports = {
getAllProducts,
getAllSales,
};
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