digikhata-mashreq-sdk 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/app/database/clients.js +31 -16
- package/lib/module/app/database/clients.js.map +1 -1
- package/lib/module/app/screens/Banks.js +4 -1
- package/lib/module/app/screens/Banks.js.map +1 -1
- package/lib/module/app/screens/GetStarted.js +2 -3
- package/lib/module/app/screens/GetStarted.js.map +1 -1
- package/lib/module/app/screens/PinScreen.js +10 -13
- package/lib/module/app/screens/PinScreen.js.map +1 -1
- package/lib/module/app/screens/SelectBusiness.js +3 -0
- package/lib/module/app/screens/SelectBusiness.js.map +1 -1
- package/lib/module/app/screens/Suppliers.js +5 -3
- package/lib/module/app/screens/Suppliers.js.map +1 -1
- package/lib/typescript/src/app/database/clients.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/Banks.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/GetStarted.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/PinScreen.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/SelectBusiness.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/Suppliers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app/database/clients.js +37 -23
- package/src/app/screens/Banks.js +3 -1
- package/src/app/screens/GetStarted.js +2 -1
- package/src/app/screens/PinScreen.js +16 -20
- package/src/app/screens/SelectBusiness.js +2 -0
- package/src/app/screens/Suppliers.js +13 -3
|
@@ -200,6 +200,8 @@ export default function SelectBusiness({ navigation }) {
|
|
|
200
200
|
const businesses = await getAllBusinesses();
|
|
201
201
|
const allClients = await getAllClients();
|
|
202
202
|
|
|
203
|
+
console.log({ allClients })
|
|
204
|
+
|
|
203
205
|
// 2️⃣ Add client counts to each business
|
|
204
206
|
const updatedBusinesses = businesses.map((business) => {
|
|
205
207
|
const clientCount = allClients.filter(
|
|
@@ -337,12 +337,22 @@ export default function Suppliers() {
|
|
|
337
337
|
});
|
|
338
338
|
|
|
339
339
|
const totalSubamountSum = currentMonthSuppliers?.reduce(
|
|
340
|
-
(sum, item) => sum + (
|
|
340
|
+
(sum, item) => sum + (Number(item?.total_subamount) || 0),
|
|
341
|
+
0
|
|
342
|
+
);
|
|
343
|
+
|
|
344
|
+
const allSubamountSum = suppliers?.reduce(
|
|
345
|
+
(sum, item) => sum + (Number(item?.total_subamount) || 0),
|
|
341
346
|
0
|
|
342
347
|
);
|
|
343
348
|
|
|
344
349
|
const totalAmountSum = currentMonthSuppliers?.reduce(
|
|
345
|
-
(sum, item) => sum + (
|
|
350
|
+
(sum, item) => sum + (Number(item?.total_amount) || 0),
|
|
351
|
+
0
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
const allAmountSum = suppliers?.reduce(
|
|
355
|
+
(sum, item) => sum + (Number(item?.total_amount) || 0),
|
|
346
356
|
0
|
|
347
357
|
);
|
|
348
358
|
|
|
@@ -382,7 +392,7 @@ export default function Suppliers() {
|
|
|
382
392
|
});
|
|
383
393
|
}
|
|
384
394
|
|
|
385
|
-
let finalAmount =
|
|
395
|
+
let finalAmount = allSubamountSum - allAmountSum;
|
|
386
396
|
|
|
387
397
|
let type = 'none';
|
|
388
398
|
if (finalAmount > 0) {
|