digikhata-mashreq-sdk 1.0.0 → 1.1.0
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.js +13 -26
- package/lib/module/App.js.map +1 -1
- package/lib/module/app/api/api.js +12 -0
- package/lib/module/app/api/api.js.map +1 -0
- package/lib/module/app/assets/Icons/Bill.png +0 -0
- package/lib/module/app/assets/Icons/Bill_Grey.png +0 -0
- package/lib/module/app/assets/Icons/Cash.png +0 -0
- package/lib/module/app/assets/Icons/Cash_Grey.png +0 -0
- package/lib/module/app/assets/Icons/Expense.png +0 -0
- package/lib/module/app/assets/Icons/Expense_Grey.png +0 -0
- package/lib/module/app/assets/Icons/Staff.png +0 -0
- package/lib/module/app/assets/Icons/Stock.png +0 -0
- package/lib/module/app/assets/Icons/Stock_Grey.png +0 -0
- package/lib/module/app/assets/Icons/abc.png +0 -0
- package/lib/module/app/assets/Icons/bank_logo.png +0 -0
- package/lib/module/app/assets/Icons/download_sale.png +0 -0
- package/lib/module/app/assets/Icons/recycle-bin.png +0 -0
- package/lib/module/app/assets/animations/recording.json +1 -0
- package/lib/module/app/assets/animations/success.json +1 -0
- package/lib/module/app/assets/animations/voice_visualization.json +1 -0
- package/lib/module/app/assets/businessCards/card_11.png +0 -0
- package/lib/module/app/assets/businessCards/card_12_bg.png +0 -0
- package/lib/module/app/assets/businessCards/card_wall_01.jpeg +0 -0
- package/lib/module/app/assets/businessCards/card_wall_02.jpeg +0 -0
- package/lib/module/app/assets/businessCards/card_wall_03.jpeg +0 -0
- package/lib/module/app/assets/businessCards/card_wall_04.jpeg +0 -0
- package/lib/module/app/assets/businessCards/card_wall_05.jpeg +0 -0
- package/lib/module/app/assets/businessCards/card_wall_06.jpeg +0 -0
- package/lib/module/app/assets/businessCards/card_wall_07.jpeg +0 -0
- package/lib/module/app/assets/businessCards/card_wall_08.jpeg +0 -0
- package/lib/module/app/assets/illustrations/empty.png +0 -0
- package/lib/module/app/assets/illustrations/packages.png +0 -0
- package/lib/module/app/assets/images/Digikhata_idzarHgH0q_0.png +0 -0
- package/lib/module/app/assets/images/bank.png +0 -0
- package/lib/module/app/assets/images/digiLogo-main.png +0 -0
- package/lib/module/app/assets/images/svgviewer-output.svg +57 -0
- package/lib/module/app/assets/images/user.png +0 -0
- package/lib/module/app/assets/oldIcons/BILL.svg +3 -0
- package/lib/module/app/assets/oldIcons/CASH.svg +4 -0
- package/lib/module/app/assets/oldIcons/EXPENSE.svg +6 -0
- package/lib/module/app/assets/oldIcons/STAFF.svg +3 -0
- package/lib/module/app/assets/oldIcons/Sale Active.svg +14 -0
- package/lib/module/app/assets/oldIcons/Stock.svg +5 -0
- package/lib/module/app/assets/svg/BILL.svg +4 -0
- package/lib/module/app/assets/svg/CASH.svg +6 -0
- package/lib/module/app/assets/svg/EXPENSE.svg +5 -0
- package/lib/module/app/assets/svg/More Icon.svg +6 -0
- package/lib/module/app/assets/svg/Payment Icon.svg +4 -0
- package/lib/module/app/assets/svg/Pos.svg +13 -0
- package/lib/module/app/assets/svg/STAFF.svg +5 -0
- package/lib/module/app/assets/svg/Sale Active.svg +8 -0
- package/lib/module/app/assets/svg/Sale Icon.svg +3 -0
- package/lib/module/app/assets/svg/Stock.svg +5 -0
- package/lib/module/app/components/AccountSetupSteps.js +64 -0
- package/lib/module/app/components/AccountSetupSteps.js.map +1 -0
- package/lib/module/app/components/AddItemBillParent.js +366 -0
- package/lib/module/app/components/AddItemBillParent.js.map +1 -0
- package/lib/module/app/components/AdditemBillChild.js +1123 -0
- package/lib/module/app/components/AdditemBillChild.js.map +1 -0
- package/lib/module/app/components/Balance.js +116 -70
- package/lib/module/app/components/Balance.js.map +1 -1
- package/lib/module/app/components/BillList.js +428 -0
- package/lib/module/app/components/BillList.js.map +1 -0
- package/lib/module/app/components/BillSetupSteps.js +64 -0
- package/lib/module/app/components/BillSetupSteps.js.map +1 -0
- package/lib/module/app/components/BottomView.js +35 -0
- package/lib/module/app/components/BottomView.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card1.js +202 -0
- package/lib/module/app/components/BusinessCards/Card1.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card10.js +234 -0
- package/lib/module/app/components/BusinessCards/Card10.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card2.js +190 -0
- package/lib/module/app/components/BusinessCards/Card2.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card3.js +186 -0
- package/lib/module/app/components/BusinessCards/Card3.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card4.js +186 -0
- package/lib/module/app/components/BusinessCards/Card4.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card5.js +189 -0
- package/lib/module/app/components/BusinessCards/Card5.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card6.js +198 -0
- package/lib/module/app/components/BusinessCards/Card6.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card7.js +185 -0
- package/lib/module/app/components/BusinessCards/Card7.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card8.js +187 -0
- package/lib/module/app/components/BusinessCards/Card8.js.map +1 -0
- package/lib/module/app/components/BusinessCards/Card9.js +234 -0
- package/lib/module/app/components/BusinessCards/Card9.js.map +1 -0
- package/lib/module/app/components/BusinessCards/index.js +13 -0
- package/lib/module/app/components/BusinessCards/index.js.map +1 -0
- package/lib/module/app/components/CashEntryComponent.js +256 -0
- package/lib/module/app/components/CashEntryComponent.js.map +1 -0
- package/lib/module/app/components/CityModal.js +116 -0
- package/lib/module/app/components/CityModal.js.map +1 -0
- package/lib/module/app/components/CountryPhoneInput.js +263 -166
- package/lib/module/app/components/CountryPhoneInput.js.map +1 -1
- package/lib/module/app/components/CreateExpenseAccount.js +139 -0
- package/lib/module/app/components/CreateExpenseAccount.js.map +1 -0
- package/lib/module/app/components/CustomStatusBar.js +29 -0
- package/lib/module/app/components/CustomStatusBar.js.map +1 -0
- package/lib/module/app/components/CustomToast.js +135 -0
- package/lib/module/app/components/CustomToast.js.map +1 -0
- package/lib/module/app/components/DeleteBusinessModal.js +174 -0
- package/lib/module/app/components/DeleteBusinessModal.js.map +1 -0
- package/lib/module/app/components/DiscountTaxModal.js +242 -0
- package/lib/module/app/components/DiscountTaxModal.js.map +1 -0
- package/lib/module/app/components/Entries.js +54 -32
- package/lib/module/app/components/Entries.js.map +1 -1
- package/lib/module/app/components/ExpenseList.js +402 -0
- package/lib/module/app/components/ExpenseList.js.map +1 -0
- package/lib/module/app/components/ExpenseParent.js +441 -0
- package/lib/module/app/components/ExpenseParent.js.map +1 -0
- package/lib/module/app/components/FloatingInput.js +159 -0
- package/lib/module/app/components/FloatingInput.js.map +1 -0
- package/lib/module/app/components/Header.js +107 -0
- package/lib/module/app/components/Header.js.map +1 -0
- package/lib/module/app/components/Loader.js +45 -0
- package/lib/module/app/components/Loader.js.map +1 -0
- package/lib/module/app/components/PartyModal.js +230 -0
- package/lib/module/app/components/PartyModal.js.map +1 -0
- package/lib/module/app/components/PickerModal.js +153 -0
- package/lib/module/app/components/PickerModal.js.map +1 -0
- package/lib/module/app/components/SalePaymentModal.js +743 -0
- package/lib/module/app/components/SalePaymentModal.js.map +1 -0
- package/lib/module/app/components/SearchBar.js +179 -42
- package/lib/module/app/components/SearchBar.js.map +1 -1
- package/lib/module/app/components/StockDetailChild.js +425 -0
- package/lib/module/app/components/StockDetailChild.js.map +1 -0
- package/lib/module/app/components/StockList.js +448 -0
- package/lib/module/app/components/StockList.js.map +1 -0
- package/lib/module/app/components/StockReportTransaction.js +182 -0
- package/lib/module/app/components/StockReportTransaction.js.map +1 -0
- package/lib/module/app/components/Transaction.js +193 -53
- package/lib/module/app/components/Transaction.js.map +1 -1
- package/lib/module/app/components/User.js +106 -51
- package/lib/module/app/components/User.js.map +1 -1
- package/lib/module/app/components/index.js +20 -1
- package/lib/module/app/components/index.js.map +1 -1
- package/lib/module/app/database/bill.js +247 -0
- package/lib/module/app/database/bill.js.map +1 -0
- package/lib/module/app/database/business.js +262 -0
- package/lib/module/app/database/business.js.map +1 -0
- package/lib/module/app/database/cash.js +299 -0
- package/lib/module/app/database/cash.js.map +1 -0
- package/lib/module/app/database/clients.js +1182 -36
- package/lib/module/app/database/clients.js.map +1 -1
- package/lib/module/app/database/expense.js +299 -0
- package/lib/module/app/database/expense.js.map +1 -0
- package/lib/module/app/database/schema.js +113 -3
- package/lib/module/app/database/schema.js.map +1 -1
- package/lib/module/app/database/stock.js +509 -0
- package/lib/module/app/database/stock.js.map +1 -0
- package/lib/module/app/htmlTemplates/htmlTemplates.js +2504 -0
- package/lib/module/app/htmlTemplates/htmlTemplates.js.map +1 -0
- package/lib/module/app/navigation/BillStack/BillStack.js +40 -0
- package/lib/module/app/navigation/BillStack/BillStack.js.map +1 -0
- package/lib/module/app/navigation/BottomTabs/BottomTabs.js +10 -5
- package/lib/module/app/navigation/BottomTabs/BottomTabs.js.map +1 -1
- package/lib/module/app/navigation/BusinessStack/BusinessStack.js +30 -0
- package/lib/module/app/navigation/BusinessStack/BusinessStack.js.map +1 -0
- package/lib/module/app/navigation/CashStack/CashStack.js +79 -0
- package/lib/module/app/navigation/CashStack/CashStack.js.map +1 -0
- package/lib/module/app/navigation/EntriesStack/EntriesStack.js +223 -0
- package/lib/module/app/navigation/EntriesStack/EntriesStack.js.map +1 -0
- package/lib/module/app/navigation/ExpenseStack.js/ExpenseStack.js +37 -0
- package/lib/module/app/navigation/ExpenseStack.js/ExpenseStack.js.map +1 -0
- package/lib/module/app/navigation/HomeStack/HomeStack.js +93 -1
- package/lib/module/app/navigation/HomeStack/HomeStack.js.map +1 -1
- package/lib/module/app/navigation/Root.js +10 -1
- package/lib/module/app/navigation/Root.js.map +1 -1
- package/lib/module/app/navigation/SaleStack/SaleStack.js +73 -0
- package/lib/module/app/navigation/SaleStack/SaleStack.js.map +1 -0
- package/lib/module/app/navigation/StockStack/StockStack.js +49 -0
- package/lib/module/app/navigation/StockStack/StockStack.js.map +1 -0
- package/lib/module/app/navigation/index.js +3 -1
- package/lib/module/app/navigation/index.js.map +1 -1
- package/lib/module/app/redux/Store.js +3 -1
- package/lib/module/app/redux/Store.js.map +1 -1
- package/lib/module/app/redux/reducers/client/client_reducers.js +23 -2
- package/lib/module/app/redux/reducers/client/client_reducers.js.map +1 -1
- package/lib/module/app/redux/reducers/client/client_types.js +5 -0
- package/lib/module/app/redux/reducers/client/client_types.js.map +1 -1
- package/lib/module/app/redux/reducers/user/user_reducers.js +22 -0
- package/lib/module/app/redux/reducers/user/user_reducers.js.map +1 -0
- package/lib/module/app/redux/reducers/user/user_types.js +6 -0
- package/lib/module/app/redux/reducers/user/user_types.js.map +1 -0
- package/lib/module/app/screens/AddBank.js +237 -0
- package/lib/module/app/screens/AddBank.js.map +1 -0
- package/lib/module/app/screens/AddBusiness.js +905 -0
- package/lib/module/app/screens/AddBusiness.js.map +1 -0
- package/lib/module/app/screens/AddItems.js +433 -0
- package/lib/module/app/screens/AddItems.js.map +1 -0
- package/lib/module/app/screens/AddScreen.js +341 -77
- package/lib/module/app/screens/AddScreen.js.map +1 -1
- package/lib/module/app/screens/All.js +836 -0
- package/lib/module/app/screens/All.js.map +1 -0
- package/lib/module/app/screens/AllTransactions.js +846 -0
- package/lib/module/app/screens/AllTransactions.js.map +1 -0
- package/lib/module/app/screens/Banks.js +807 -48
- package/lib/module/app/screens/Banks.js.map +1 -1
- package/lib/module/app/screens/BillDetails.js +1033 -0
- package/lib/module/app/screens/BillDetails.js.map +1 -0
- package/lib/module/app/screens/BillHome.js +102 -0
- package/lib/module/app/screens/BillHome.js.map +1 -0
- package/lib/module/app/screens/BillParent.js +373 -0
- package/lib/module/app/screens/BillParent.js.map +1 -0
- package/lib/module/app/screens/BusinessDetail.js +787 -0
- package/lib/module/app/screens/BusinessDetail.js.map +1 -0
- package/lib/module/app/screens/CashEntry.js +2429 -0
- package/lib/module/app/screens/CashEntry.js.map +1 -0
- package/lib/module/app/screens/CashEntryDetails.js +574 -0
- package/lib/module/app/screens/CashEntryDetails.js.map +1 -0
- package/lib/module/app/screens/CashHome.js +544 -0
- package/lib/module/app/screens/CashHome.js.map +1 -0
- package/lib/module/app/screens/CashReport.js +1297 -0
- package/lib/module/app/screens/CashReport.js.map +1 -0
- package/lib/module/app/screens/CashSummary.js +602 -0
- package/lib/module/app/screens/CashSummary.js.map +1 -0
- package/lib/module/app/screens/CreateBill.js +2137 -0
- package/lib/module/app/screens/CreateBill.js.map +1 -0
- package/lib/module/app/screens/CustomerEntries.js +1093 -184
- package/lib/module/app/screens/CustomerEntries.js.map +1 -1
- package/lib/module/app/screens/Customers.js +727 -96
- package/lib/module/app/screens/Customers.js.map +1 -1
- package/lib/module/app/screens/EditCategory.js +299 -0
- package/lib/module/app/screens/EditCategory.js.map +1 -0
- package/lib/module/app/screens/EditCategoryStock.js +302 -0
- package/lib/module/app/screens/EditCategoryStock.js.map +1 -0
- package/lib/module/app/screens/Entry.js +1838 -275
- package/lib/module/app/screens/Entry.js.map +1 -1
- package/lib/module/app/screens/ExpenseDetail.js +15 -0
- package/lib/module/app/screens/ExpenseDetail.js.map +1 -0
- package/lib/module/app/screens/ExpenseEntries.js +713 -0
- package/lib/module/app/screens/ExpenseEntries.js.map +1 -0
- package/lib/module/app/screens/ExpenseEntry.js +2095 -0
- package/lib/module/app/screens/ExpenseEntry.js.map +1 -0
- package/lib/module/app/screens/ExpenseEntryDetails.js +508 -0
- package/lib/module/app/screens/ExpenseEntryDetails.js.map +1 -0
- package/lib/module/app/screens/ExpenseEntryReport.js +792 -0
- package/lib/module/app/screens/ExpenseEntryReport.js.map +1 -0
- package/lib/module/app/screens/ExpenseReport.js +792 -0
- package/lib/module/app/screens/ExpenseReport.js.map +1 -0
- package/lib/module/app/screens/Geolocation.js +374 -0
- package/lib/module/app/screens/Geolocation.js.map +1 -0
- package/lib/module/app/screens/GetStarted.js +213 -0
- package/lib/module/app/screens/GetStarted.js.map +1 -0
- package/lib/module/app/screens/HomeScreen.js +202 -55
- package/lib/module/app/screens/HomeScreen.js.map +1 -1
- package/lib/module/app/screens/InBuy.js +854 -0
- package/lib/module/app/screens/InBuy.js.map +1 -0
- package/lib/module/app/screens/ItemEntryDetails.js +652 -0
- package/lib/module/app/screens/ItemEntryDetails.js.map +1 -0
- package/lib/module/app/screens/LowStock.js +372 -0
- package/lib/module/app/screens/LowStock.js.map +1 -0
- package/lib/module/app/screens/NewPin.js +234 -0
- package/lib/module/app/screens/NewPin.js.map +1 -0
- package/lib/module/app/screens/OutSell.js +1883 -0
- package/lib/module/app/screens/OutSell.js.map +1 -0
- package/lib/module/app/screens/POSSale.js +637 -0
- package/lib/module/app/screens/POSSale.js.map +1 -0
- package/lib/module/app/screens/PinScreen.js +663 -0
- package/lib/module/app/screens/PinScreen.js.map +1 -0
- package/lib/module/app/screens/PreviewBill.js +329 -0
- package/lib/module/app/screens/PreviewBill.js.map +1 -0
- package/lib/module/app/screens/Profile.js +1160 -0
- package/lib/module/app/screens/Profile.js.map +1 -0
- package/lib/module/app/screens/RateList.js +432 -0
- package/lib/module/app/screens/RateList.js.map +1 -0
- package/lib/module/app/screens/Report.js +1105 -0
- package/lib/module/app/screens/Report.js.map +1 -0
- package/lib/module/app/screens/SaleItemDetail.js +1047 -0
- package/lib/module/app/screens/SaleItemDetail.js.map +1 -0
- package/lib/module/app/screens/SaleParent.js +289 -0
- package/lib/module/app/screens/SaleParent.js.map +1 -0
- package/lib/module/app/screens/SelectBank.js +220 -0
- package/lib/module/app/screens/SelectBank.js.map +1 -0
- package/lib/module/app/screens/SelectBusiness.js +497 -93
- package/lib/module/app/screens/SelectBusiness.js.map +1 -1
- package/lib/module/app/screens/Splash.js +93 -20
- package/lib/module/app/screens/Splash.js.map +1 -1
- package/lib/module/app/screens/StockChild.js +362 -0
- package/lib/module/app/screens/StockChild.js.map +1 -0
- package/lib/module/app/screens/StockDetail.js +705 -0
- package/lib/module/app/screens/StockDetail.js.map +1 -0
- package/lib/module/app/screens/StockParent.js +260 -0
- package/lib/module/app/screens/StockParent.js.map +1 -0
- package/lib/module/app/screens/StockReport.js +1031 -0
- package/lib/module/app/screens/StockReport.js.map +1 -0
- package/lib/module/app/screens/StockValue.js +545 -0
- package/lib/module/app/screens/StockValue.js.map +1 -0
- package/lib/module/app/screens/Suppliers.js +753 -98
- package/lib/module/app/screens/Suppliers.js.map +1 -1
- package/lib/module/app/screens/TransactionDetails.js +1169 -81
- package/lib/module/app/screens/TransactionDetails.js.map +1 -1
- package/lib/module/app/screens/UpdateBusiness.js +707 -0
- package/lib/module/app/screens/UpdateBusiness.js.map +1 -0
- package/lib/module/app/screens/VisionCamera.js +60 -0
- package/lib/module/app/screens/VisionCamera.js.map +1 -0
- package/lib/module/app/screens/index.js +46 -1
- package/lib/module/app/screens/index.js.map +1 -1
- package/lib/module/app/screens/new.html +171 -0
- package/lib/module/app/themes/config.js +299 -30
- package/lib/module/app/themes/config.js.map +1 -1
- package/lib/module/app/utils/city.json +7265 -0
- package/lib/typescript/eslint.config.d.mts +1 -1
- package/lib/typescript/src/App.d.ts.map +1 -1
- package/lib/typescript/src/app/api/api.d.ts +10 -0
- package/lib/typescript/src/app/api/api.d.ts.map +1 -0
- package/lib/typescript/src/app/components/AccountSetupSteps.d.ts +3 -0
- package/lib/typescript/src/app/components/AccountSetupSteps.d.ts.map +1 -0
- package/lib/typescript/src/app/components/AddItemBillParent.d.ts +5 -0
- package/lib/typescript/src/app/components/AddItemBillParent.d.ts.map +1 -0
- package/lib/typescript/src/app/components/AdditemBillChild.d.ts +6 -0
- package/lib/typescript/src/app/components/AdditemBillChild.d.ts.map +1 -0
- package/lib/typescript/src/app/components/Balance.d.ts +3 -1
- package/lib/typescript/src/app/components/Balance.d.ts.map +1 -1
- package/lib/typescript/src/app/components/BillList.d.ts +5 -0
- package/lib/typescript/src/app/components/BillList.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BillSetupSteps.d.ts +3 -0
- package/lib/typescript/src/app/components/BillSetupSteps.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BottomView.d.ts +6 -0
- package/lib/typescript/src/app/components/BottomView.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card1.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card1.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card10.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card10.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card2.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card2.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card3.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card3.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card4.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card4.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card5.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card5.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card6.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card6.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card7.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card7.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card8.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card8.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/Card9.d.ts +14 -0
- package/lib/typescript/src/app/components/BusinessCards/Card9.d.ts.map +1 -0
- package/lib/typescript/src/app/components/BusinessCards/index.d.ts +11 -0
- package/lib/typescript/src/app/components/BusinessCards/index.d.ts.map +1 -0
- package/lib/typescript/src/app/components/CashEntryComponent.d.ts +8 -0
- package/lib/typescript/src/app/components/CashEntryComponent.d.ts.map +1 -0
- package/lib/typescript/src/app/components/CityModal.d.ts +7 -0
- package/lib/typescript/src/app/components/CityModal.d.ts.map +1 -0
- package/lib/typescript/src/app/components/CountryPhoneInput.d.ts +4 -1
- package/lib/typescript/src/app/components/CountryPhoneInput.d.ts.map +1 -1
- package/lib/typescript/src/app/components/CreateExpenseAccount.d.ts +9 -0
- package/lib/typescript/src/app/components/CreateExpenseAccount.d.ts.map +1 -0
- package/lib/typescript/src/app/components/CustomStatusBar.d.ts +3 -0
- package/lib/typescript/src/app/components/CustomStatusBar.d.ts.map +1 -0
- package/lib/typescript/src/app/components/CustomToast.d.ts +10 -0
- package/lib/typescript/src/app/components/CustomToast.d.ts.map +1 -0
- package/lib/typescript/src/app/components/DeleteBusinessModal.d.ts +8 -0
- package/lib/typescript/src/app/components/DeleteBusinessModal.d.ts.map +1 -0
- package/lib/typescript/src/app/components/DiscountTaxModal.d.ts +9 -0
- package/lib/typescript/src/app/components/DiscountTaxModal.d.ts.map +1 -0
- package/lib/typescript/src/app/components/Entries.d.ts.map +1 -1
- package/lib/typescript/src/app/components/ExpenseList.d.ts +6 -0
- package/lib/typescript/src/app/components/ExpenseList.d.ts.map +1 -0
- package/lib/typescript/src/app/components/ExpenseParent.d.ts +4 -0
- package/lib/typescript/src/app/components/ExpenseParent.d.ts.map +1 -0
- package/lib/typescript/src/app/components/FloatingInput.d.ts +18 -0
- package/lib/typescript/src/app/components/FloatingInput.d.ts.map +1 -0
- package/lib/typescript/src/app/components/Header.d.ts +11 -0
- package/lib/typescript/src/app/components/Header.d.ts.map +1 -0
- package/lib/typescript/src/app/components/Loader.d.ts +5 -0
- package/lib/typescript/src/app/components/Loader.d.ts.map +1 -0
- package/lib/typescript/src/app/components/PartyModal.d.ts +7 -0
- package/lib/typescript/src/app/components/PartyModal.d.ts.map +1 -0
- package/lib/typescript/src/app/components/PickerModal.d.ts +8 -0
- package/lib/typescript/src/app/components/PickerModal.d.ts.map +1 -0
- package/lib/typescript/src/app/components/SalePaymentModal.d.ts +15 -0
- package/lib/typescript/src/app/components/SalePaymentModal.d.ts.map +1 -0
- package/lib/typescript/src/app/components/SearchBar.d.ts +2 -4
- package/lib/typescript/src/app/components/SearchBar.d.ts.map +1 -1
- package/lib/typescript/src/app/components/StockDetailChild.d.ts +5 -0
- package/lib/typescript/src/app/components/StockDetailChild.d.ts.map +1 -0
- package/lib/typescript/src/app/components/StockList.d.ts +6 -0
- package/lib/typescript/src/app/components/StockList.d.ts.map +1 -0
- package/lib/typescript/src/app/components/StockReportTransaction.d.ts +18 -0
- package/lib/typescript/src/app/components/StockReportTransaction.d.ts.map +1 -0
- package/lib/typescript/src/app/components/Transaction.d.ts +9 -2
- package/lib/typescript/src/app/components/Transaction.d.ts.map +1 -1
- package/lib/typescript/src/app/components/User.d.ts +3 -1
- package/lib/typescript/src/app/components/User.d.ts.map +1 -1
- package/lib/typescript/src/app/components/index.d.ts +26 -7
- package/lib/typescript/src/app/components/index.d.ts.map +1 -1
- package/lib/typescript/src/app/database/bill.d.ts +7 -0
- package/lib/typescript/src/app/database/bill.d.ts.map +1 -0
- package/lib/typescript/src/app/database/business.d.ts +9 -0
- package/lib/typescript/src/app/database/business.d.ts.map +1 -0
- package/lib/typescript/src/app/database/cash.d.ts +14 -0
- package/lib/typescript/src/app/database/cash.d.ts.map +1 -0
- package/lib/typescript/src/app/database/clients.d.ts +36 -5
- package/lib/typescript/src/app/database/clients.d.ts.map +1 -1
- package/lib/typescript/src/app/database/expense.d.ts +12 -0
- package/lib/typescript/src/app/database/expense.d.ts.map +1 -0
- package/lib/typescript/src/app/database/schema.d.ts.map +1 -1
- package/lib/typescript/src/app/database/stock.d.ts +16 -0
- package/lib/typescript/src/app/database/stock.d.ts.map +1 -0
- package/lib/typescript/src/app/htmlTemplates/htmlTemplates.d.ts +29 -0
- package/lib/typescript/src/app/htmlTemplates/htmlTemplates.d.ts.map +1 -0
- package/lib/typescript/src/app/navigation/BillStack/BillStack.d.ts +2 -0
- package/lib/typescript/src/app/navigation/BillStack/BillStack.d.ts.map +1 -0
- package/lib/typescript/src/app/navigation/BottomTabs/BottomTabs.d.ts.map +1 -1
- package/lib/typescript/src/app/navigation/BusinessStack/BusinessStack.d.ts +2 -0
- package/lib/typescript/src/app/navigation/BusinessStack/BusinessStack.d.ts.map +1 -0
- package/lib/typescript/src/app/navigation/CashStack/CashStack.d.ts +2 -0
- package/lib/typescript/src/app/navigation/CashStack/CashStack.d.ts.map +1 -0
- package/lib/typescript/src/app/navigation/EntriesStack/EntriesStack.d.ts +2 -0
- package/lib/typescript/src/app/navigation/EntriesStack/EntriesStack.d.ts.map +1 -0
- package/lib/typescript/src/app/navigation/ExpenseStack.js/ExpenseStack.d.ts +2 -0
- package/lib/typescript/src/app/navigation/ExpenseStack.js/ExpenseStack.d.ts.map +1 -0
- package/lib/typescript/src/app/navigation/HomeStack/HomeStack.d.ts.map +1 -1
- package/lib/typescript/src/app/navigation/Root.d.ts.map +1 -1
- package/lib/typescript/src/app/navigation/SaleStack/SaleStack.d.ts +2 -0
- package/lib/typescript/src/app/navigation/SaleStack/SaleStack.d.ts.map +1 -0
- package/lib/typescript/src/app/navigation/StockStack/StockStack.d.ts +2 -0
- package/lib/typescript/src/app/navigation/StockStack/StockStack.d.ts.map +1 -0
- package/lib/typescript/src/app/navigation/index.d.ts +3 -1
- package/lib/typescript/src/app/navigation/index.d.ts.map +1 -1
- package/lib/typescript/src/app/redux/Store.d.ts.map +1 -1
- package/lib/typescript/src/app/redux/reducers/client/client_reducers.d.ts.map +1 -1
- package/lib/typescript/src/app/redux/reducers/client/client_types.d.ts +5 -0
- package/lib/typescript/src/app/redux/reducers/client/client_types.d.ts.map +1 -1
- package/lib/typescript/src/app/redux/reducers/user/user_reducers.d.ts +3 -0
- package/lib/typescript/src/app/redux/reducers/user/user_reducers.d.ts.map +1 -0
- package/lib/typescript/src/app/redux/reducers/user/user_types.d.ts +4 -0
- package/lib/typescript/src/app/redux/reducers/user/user_types.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/AddBank.d.ts +5 -0
- package/lib/typescript/src/app/screens/AddBank.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/AddBusiness.d.ts +4 -0
- package/lib/typescript/src/app/screens/AddBusiness.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/AddItems.d.ts +5 -0
- package/lib/typescript/src/app/screens/AddItems.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/AddScreen.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/All.d.ts +2 -0
- package/lib/typescript/src/app/screens/All.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/AllTransactions.d.ts +5 -0
- package/lib/typescript/src/app/screens/AllTransactions.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/Banks.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/BillDetails.d.ts +6 -0
- package/lib/typescript/src/app/screens/BillDetails.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/BillHome.d.ts +5 -0
- package/lib/typescript/src/app/screens/BillHome.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/BillParent.d.ts +5 -0
- package/lib/typescript/src/app/screens/BillParent.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/BusinessDetail.d.ts +4 -0
- package/lib/typescript/src/app/screens/BusinessDetail.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/CashEntry.d.ts +5 -0
- package/lib/typescript/src/app/screens/CashEntry.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/CashEntryDetails.d.ts +5 -0
- package/lib/typescript/src/app/screens/CashEntryDetails.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/CashHome.d.ts +4 -0
- package/lib/typescript/src/app/screens/CashHome.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/CashReport.d.ts +4 -0
- package/lib/typescript/src/app/screens/CashReport.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/CashSummary.d.ts +5 -0
- package/lib/typescript/src/app/screens/CashSummary.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/CreateBill.d.ts +5 -0
- package/lib/typescript/src/app/screens/CreateBill.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/CustomerEntries.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/Customers.d.ts +1 -3
- package/lib/typescript/src/app/screens/Customers.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/EditCategory.d.ts +4 -0
- package/lib/typescript/src/app/screens/EditCategory.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/EditCategoryStock.d.ts +4 -0
- package/lib/typescript/src/app/screens/EditCategoryStock.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/Entry.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/ExpenseDetail.d.ts +3 -0
- package/lib/typescript/src/app/screens/ExpenseDetail.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/ExpenseEntries.d.ts +5 -0
- package/lib/typescript/src/app/screens/ExpenseEntries.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/ExpenseEntry.d.ts +5 -0
- package/lib/typescript/src/app/screens/ExpenseEntry.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/ExpenseEntryDetails.d.ts +5 -0
- package/lib/typescript/src/app/screens/ExpenseEntryDetails.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/ExpenseEntryReport.d.ts +5 -0
- package/lib/typescript/src/app/screens/ExpenseEntryReport.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/ExpenseReport.d.ts +5 -0
- package/lib/typescript/src/app/screens/ExpenseReport.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/Geolocation.d.ts +5 -0
- package/lib/typescript/src/app/screens/Geolocation.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/GetStarted.d.ts +4 -0
- package/lib/typescript/src/app/screens/GetStarted.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/HomeScreen.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/InBuy.d.ts +5 -0
- package/lib/typescript/src/app/screens/InBuy.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/ItemEntryDetails.d.ts +5 -0
- package/lib/typescript/src/app/screens/ItemEntryDetails.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/LowStock.d.ts +4 -0
- package/lib/typescript/src/app/screens/LowStock.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/NewPin.d.ts +5 -0
- package/lib/typescript/src/app/screens/NewPin.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/OutSell.d.ts +6 -0
- package/lib/typescript/src/app/screens/OutSell.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/POSSale.d.ts +9 -0
- package/lib/typescript/src/app/screens/POSSale.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/PinScreen.d.ts +5 -0
- package/lib/typescript/src/app/screens/PinScreen.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/PreviewBill.d.ts +5 -0
- package/lib/typescript/src/app/screens/PreviewBill.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/Profile.d.ts +5 -0
- package/lib/typescript/src/app/screens/Profile.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/RateList.d.ts +5 -0
- package/lib/typescript/src/app/screens/RateList.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/Report.d.ts +5 -0
- package/lib/typescript/src/app/screens/Report.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/SaleItemDetail.d.ts +6 -0
- package/lib/typescript/src/app/screens/SaleItemDetail.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/SaleParent.d.ts +2 -0
- package/lib/typescript/src/app/screens/SaleParent.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/SelectBank.d.ts +4 -0
- package/lib/typescript/src/app/screens/SelectBank.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/SelectBusiness.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/Splash.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/StockChild.d.ts +7 -0
- package/lib/typescript/src/app/screens/StockChild.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/StockDetail.d.ts +5 -0
- package/lib/typescript/src/app/screens/StockDetail.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/StockParent.d.ts +2 -0
- package/lib/typescript/src/app/screens/StockParent.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/StockReport.d.ts +5 -0
- package/lib/typescript/src/app/screens/StockReport.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/StockValue.d.ts +5 -0
- package/lib/typescript/src/app/screens/StockValue.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/Suppliers.d.ts +1 -3
- package/lib/typescript/src/app/screens/Suppliers.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/TransactionDetails.d.ts.map +1 -1
- package/lib/typescript/src/app/screens/UpdateBusiness.d.ts +5 -0
- package/lib/typescript/src/app/screens/UpdateBusiness.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/VisionCamera.d.ts +2 -0
- package/lib/typescript/src/app/screens/VisionCamera.d.ts.map +1 -0
- package/lib/typescript/src/app/screens/index.d.ts +56 -11
- package/lib/typescript/src/app/screens/index.d.ts.map +1 -1
- package/lib/typescript/src/app/themes/config.d.ts +60 -8
- package/lib/typescript/src/app/themes/config.d.ts.map +1 -1
- package/package.json +6 -2
- package/src/App.js +30 -34
- package/src/app/api/api.js +11 -0
- package/src/app/assets/Icons/Bill.png +0 -0
- package/src/app/assets/Icons/Bill_Grey.png +0 -0
- package/src/app/assets/Icons/Cash.png +0 -0
- package/src/app/assets/Icons/Cash_Grey.png +0 -0
- package/src/app/assets/Icons/Expense.png +0 -0
- package/src/app/assets/Icons/Expense_Grey.png +0 -0
- package/src/app/assets/Icons/Staff.png +0 -0
- package/src/app/assets/Icons/Stock.png +0 -0
- package/src/app/assets/Icons/Stock_Grey.png +0 -0
- package/src/app/assets/Icons/abc.png +0 -0
- package/src/app/assets/Icons/bank_logo.png +0 -0
- package/src/app/assets/Icons/download_sale.png +0 -0
- package/src/app/assets/Icons/recycle-bin.png +0 -0
- package/src/app/assets/animations/recording.json +1 -0
- package/src/app/assets/animations/success.json +1 -0
- package/src/app/assets/animations/voice_visualization.json +1 -0
- package/src/app/assets/businessCards/card_11.png +0 -0
- package/src/app/assets/businessCards/card_12_bg.png +0 -0
- package/src/app/assets/businessCards/card_wall_01.jpeg +0 -0
- package/src/app/assets/businessCards/card_wall_02.jpeg +0 -0
- package/src/app/assets/businessCards/card_wall_03.jpeg +0 -0
- package/src/app/assets/businessCards/card_wall_04.jpeg +0 -0
- package/src/app/assets/businessCards/card_wall_05.jpeg +0 -0
- package/src/app/assets/businessCards/card_wall_06.jpeg +0 -0
- package/src/app/assets/businessCards/card_wall_07.jpeg +0 -0
- package/src/app/assets/businessCards/card_wall_08.jpeg +0 -0
- package/src/app/assets/illustrations/empty.png +0 -0
- package/src/app/assets/illustrations/packages.png +0 -0
- package/src/app/assets/images/Digikhata_idzarHgH0q_0.png +0 -0
- package/src/app/assets/images/bank.png +0 -0
- package/src/app/assets/images/digiLogo-main.png +0 -0
- package/src/app/assets/images/svgviewer-output.svg +57 -0
- package/src/app/assets/images/user.png +0 -0
- package/src/app/assets/oldIcons/BILL.svg +3 -0
- package/src/app/assets/oldIcons/CASH.svg +4 -0
- package/src/app/assets/oldIcons/EXPENSE.svg +6 -0
- package/src/app/assets/oldIcons/STAFF.svg +3 -0
- package/src/app/assets/oldIcons/Sale Active.svg +14 -0
- package/src/app/assets/oldIcons/Stock.svg +5 -0
- package/src/app/assets/svg/BILL.svg +4 -0
- package/src/app/assets/svg/CASH.svg +6 -0
- package/src/app/assets/svg/EXPENSE.svg +5 -0
- package/src/app/assets/svg/More Icon.svg +6 -0
- package/src/app/assets/svg/Payment Icon.svg +4 -0
- package/src/app/assets/svg/Pos.svg +13 -0
- package/src/app/assets/svg/STAFF.svg +5 -0
- package/src/app/assets/svg/Sale Active.svg +8 -0
- package/src/app/assets/svg/Sale Icon.svg +3 -0
- package/src/app/assets/svg/Stock.svg +5 -0
- package/src/app/components/AccountSetupSteps.js +58 -0
- package/src/app/components/AddItemBillParent.js +373 -0
- package/src/app/components/AdditemBillChild.js +1257 -0
- package/src/app/components/Balance.js +211 -114
- package/src/app/components/BillList.js +548 -0
- package/src/app/components/BillSetupSteps.js +56 -0
- package/src/app/components/BottomView.js +39 -0
- package/src/app/components/BusinessCards/Card1.js +160 -0
- package/src/app/components/BusinessCards/Card10.js +209 -0
- package/src/app/components/BusinessCards/Card2.js +148 -0
- package/src/app/components/BusinessCards/Card3.js +147 -0
- package/src/app/components/BusinessCards/Card4.js +147 -0
- package/src/app/components/BusinessCards/Card5.js +151 -0
- package/src/app/components/BusinessCards/Card6.js +157 -0
- package/src/app/components/BusinessCards/Card7.js +146 -0
- package/src/app/components/BusinessCards/Card8.js +170 -0
- package/src/app/components/BusinessCards/Card9.js +209 -0
- package/src/app/components/BusinessCards/index.js +10 -0
- package/src/app/components/CashEntryComponent.js +297 -0
- package/src/app/components/CityModal.js +117 -0
- package/src/app/components/CountryPhoneInput.js +373 -267
- package/src/app/components/CreateExpenseAccount.js +141 -0
- package/src/app/components/CustomStatusBar.js +33 -0
- package/src/app/components/CustomToast.js +143 -0
- package/src/app/components/DeleteBusinessModal.js +196 -0
- package/src/app/components/DiscountTaxModal.js +256 -0
- package/src/app/components/Entries.js +87 -67
- package/src/app/components/ExpenseList.js +507 -0
- package/src/app/components/ExpenseParent.js +446 -0
- package/src/app/components/FloatingInput.js +188 -0
- package/src/app/components/Header.js +121 -0
- package/src/app/components/Loader.js +35 -0
- package/src/app/components/PartyModal.js +213 -0
- package/src/app/components/PickerModal.js +176 -0
- package/src/app/components/SalePaymentModal.js +822 -0
- package/src/app/components/SearchBar.js +225 -47
- package/src/app/components/StockDetailChild.js +461 -0
- package/src/app/components/StockList.js +582 -0
- package/src/app/components/StockReportTransaction.js +192 -0
- package/src/app/components/Transaction.js +277 -86
- package/src/app/components/User.js +188 -80
- package/src/app/components/index.js +51 -13
- package/src/app/database/bill.js +305 -0
- package/src/app/database/business.js +499 -0
- package/src/app/database/cash.js +451 -0
- package/src/app/database/clients.js +1536 -43
- package/src/app/database/expense.js +439 -0
- package/src/app/database/schema.js +115 -4
- package/src/app/database/stock.js +724 -0
- package/src/app/htmlTemplates/htmlTemplates.js +2603 -0
- package/src/app/navigation/BillStack/BillStack.js +38 -0
- package/src/app/navigation/BottomTabs/BottomTabs.js +24 -19
- package/src/app/navigation/BusinessStack/BusinessStack.js +27 -0
- package/src/app/navigation/CashStack/CashStack.js +59 -0
- package/src/app/navigation/EntriesStack/EntriesStack.js +186 -0
- package/src/app/navigation/ExpenseStack.js/ExpenseStack.js +50 -0
- package/src/app/navigation/HomeStack/HomeStack.js +106 -39
- package/src/app/navigation/Root.js +16 -1
- package/src/app/navigation/SaleStack/SaleStack.js +62 -0
- package/src/app/navigation/StockStack/StockStack.js +48 -0
- package/src/app/navigation/index.js +5 -1
- package/src/app/redux/Store.js +2 -0
- package/src/app/redux/reducers/client/client_reducers.js +31 -2
- package/src/app/redux/reducers/client/client_types.js +8 -1
- package/src/app/redux/reducers/user/user_reducers.js +24 -0
- package/src/app/redux/reducers/user/user_types.js +3 -0
- package/src/app/screens/AddBank.js +353 -0
- package/src/app/screens/AddBusiness.js +1161 -0
- package/src/app/screens/AddItems.js +515 -0
- package/src/app/screens/AddScreen.js +525 -165
- package/src/app/screens/All.js +1074 -0
- package/src/app/screens/AllTransactions.js +1138 -0
- package/src/app/screens/Banks.js +1134 -133
- package/src/app/screens/BillDetails.js +989 -0
- package/src/app/screens/BillHome.js +97 -0
- package/src/app/screens/BillParent.js +419 -0
- package/src/app/screens/BusinessDetail.js +939 -0
- package/src/app/screens/CashEntry.js +2913 -0
- package/src/app/screens/CashEntryDetails.js +650 -0
- package/src/app/screens/CashHome.js +594 -0
- package/src/app/screens/CashReport.js +1658 -0
- package/src/app/screens/CashSummary.js +607 -0
- package/src/app/screens/CreateBill.js +2504 -0
- package/src/app/screens/CustomerEntries.js +1578 -350
- package/src/app/screens/Customers.js +1066 -213
- package/src/app/screens/EditCategory.js +316 -0
- package/src/app/screens/EditCategoryStock.js +320 -0
- package/src/app/screens/Entry.js +2555 -585
- package/src/app/screens/ExpenseDetail.js +14 -0
- package/src/app/screens/ExpenseEntries.js +837 -0
- package/src/app/screens/ExpenseEntry.js +2478 -0
- package/src/app/screens/ExpenseEntryDetails.js +612 -0
- package/src/app/screens/ExpenseEntryReport.js +1059 -0
- package/src/app/screens/ExpenseReport.js +1071 -0
- package/src/app/screens/Geolocation.js +435 -0
- package/src/app/screens/GetStarted.js +201 -0
- package/src/app/screens/HomeScreen.js +368 -132
- package/src/app/screens/InBuy.js +918 -0
- package/src/app/screens/ItemEntryDetails.js +582 -0
- package/src/app/screens/LowStock.js +417 -0
- package/src/app/screens/NewPin.js +225 -0
- package/src/app/screens/OutSell.js +2153 -0
- package/src/app/screens/POSSale.js +639 -0
- package/src/app/screens/PinScreen.js +720 -0
- package/src/app/screens/PreviewBill.js +302 -0
- package/src/app/screens/Profile.js +1594 -0
- package/src/app/screens/RateList.js +525 -0
- package/src/app/screens/Report.js +1401 -0
- package/src/app/screens/SaleItemDetail.js +1187 -0
- package/src/app/screens/SaleParent.js +345 -0
- package/src/app/screens/SelectBank.js +220 -0
- package/src/app/screens/SelectBusiness.js +670 -163
- package/src/app/screens/Splash.js +96 -15
- package/src/app/screens/StockChild.js +372 -0
- package/src/app/screens/StockDetail.js +758 -0
- package/src/app/screens/StockParent.js +287 -0
- package/src/app/screens/StockReport.js +1359 -0
- package/src/app/screens/StockValue.js +720 -0
- package/src/app/screens/Suppliers.js +1098 -205
- package/src/app/screens/TransactionDetails.js +1674 -180
- package/src/app/screens/UpdateBusiness.js +837 -0
- package/src/app/screens/VisionCamera.js +54 -0
- package/src/app/screens/index.js +111 -21
- package/src/app/screens/new.html +171 -0
- package/src/app/themes/config.js +431 -114
- package/src/app/utils/city.json +7265 -0
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
import db from './database';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const addItem = (
|
|
5
|
+
name, // 🏷️ Item name
|
|
6
|
+
bId, // 🏢 Business ID
|
|
7
|
+
unit, // ⚖️ Unit of measurement (e.g. pcs, kg)
|
|
8
|
+
qty, // 📦 Quantity in stock
|
|
9
|
+
lowStock, // ⚠️ Minimum stock alert threshold
|
|
10
|
+
costPrice, // 💰 Cost price per unit
|
|
11
|
+
sellingPrice, // 💵 Selling price per unit
|
|
12
|
+
local_path, // 📂 Optional image or file path
|
|
13
|
+
catId, // 🗂️ Category ID
|
|
14
|
+
barcode // 🔢 Barcode number or string
|
|
15
|
+
) => {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
db.transaction(
|
|
18
|
+
(tx) => {
|
|
19
|
+
const query = `
|
|
20
|
+
INSERT INTO Items
|
|
21
|
+
(name, bId, unit, qty, lowStock, costPrice, sellingPrice, local_path, catId, barcode, created_at, updated_at)
|
|
22
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now', 'localtime'), datetime('now', 'localtime'))
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const params = [
|
|
27
|
+
name,
|
|
28
|
+
bId,
|
|
29
|
+
unit,
|
|
30
|
+
qty,
|
|
31
|
+
lowStock,
|
|
32
|
+
costPrice,
|
|
33
|
+
sellingPrice,
|
|
34
|
+
local_path,
|
|
35
|
+
catId,
|
|
36
|
+
barcode,
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
tx.executeSql(
|
|
40
|
+
query,
|
|
41
|
+
params,
|
|
42
|
+
(txObj, resultSet) => {
|
|
43
|
+
console.log("✅ Item added successfully:", resultSet);
|
|
44
|
+
resolve(resultSet);
|
|
45
|
+
},
|
|
46
|
+
(txObj, error) => {
|
|
47
|
+
console.log("❌ SQL Error (Item):", error);
|
|
48
|
+
reject(error);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
(transactionError) => {
|
|
53
|
+
console.log("❌ Transaction Error (Item):", transactionError);
|
|
54
|
+
reject(transactionError);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const editItem = (
|
|
61
|
+
id, // 🆔 Item ID to update
|
|
62
|
+
name, // 🏷️ Item name
|
|
63
|
+
bId, // 🏢 Business ID
|
|
64
|
+
unit, // ⚖️ Unit of measurement (e.g. pcs, kg)
|
|
65
|
+
qty, // 📦 Quantity in stock
|
|
66
|
+
lowStock, // ⚠️ Minimum stock alert threshold
|
|
67
|
+
costPrice, // 💰 Cost price per unit
|
|
68
|
+
sellingPrice, // 💵 Selling price per unit
|
|
69
|
+
local_path, // 📂 Optional image or file path
|
|
70
|
+
catId, // 🗂️ Category ID
|
|
71
|
+
barcode // 🔢 Barcode number or string
|
|
72
|
+
) => {
|
|
73
|
+
return new Promise((resolve, reject) => {
|
|
74
|
+
db.transaction(
|
|
75
|
+
(tx) => {
|
|
76
|
+
const query = `
|
|
77
|
+
UPDATE Items
|
|
78
|
+
SET
|
|
79
|
+
name = ?,
|
|
80
|
+
bId = ?,
|
|
81
|
+
unit = ?,
|
|
82
|
+
qty = ?,
|
|
83
|
+
lowStock = ?,
|
|
84
|
+
costPrice = ?,
|
|
85
|
+
sellingPrice = ?,
|
|
86
|
+
local_path = ?,
|
|
87
|
+
catId = ?,
|
|
88
|
+
barcode = ?,
|
|
89
|
+
updated_at = datetime('now', 'localtime')
|
|
90
|
+
WHERE id = ?;
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
const params = [
|
|
94
|
+
name,
|
|
95
|
+
bId,
|
|
96
|
+
unit,
|
|
97
|
+
qty,
|
|
98
|
+
lowStock,
|
|
99
|
+
costPrice,
|
|
100
|
+
sellingPrice,
|
|
101
|
+
local_path,
|
|
102
|
+
catId,
|
|
103
|
+
barcode,
|
|
104
|
+
id,
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
tx.executeSql(
|
|
108
|
+
query,
|
|
109
|
+
params,
|
|
110
|
+
(txObj, resultSet) => {
|
|
111
|
+
console.log("✅ Item updated successfully:", resultSet);
|
|
112
|
+
resolve(resultSet);
|
|
113
|
+
},
|
|
114
|
+
(txObj, error) => {
|
|
115
|
+
console.log("❌ SQL Error (editItem):", error);
|
|
116
|
+
reject(error);
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
},
|
|
120
|
+
(transactionError) => {
|
|
121
|
+
console.log("❌ Transaction Error (editItem):", transactionError);
|
|
122
|
+
reject(transactionError);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const getItemCategories = () => {
|
|
129
|
+
return new Promise((resolve, reject) => {
|
|
130
|
+
db.transaction(tx => {
|
|
131
|
+
tx.executeSql(
|
|
132
|
+
"SELECT * FROM ItemCategory ORDER BY created_at DESC",
|
|
133
|
+
[],
|
|
134
|
+
(txObj, resultSet) => {
|
|
135
|
+
let results = [];
|
|
136
|
+
for (let i = 0; i < resultSet.rows.length; i++) {
|
|
137
|
+
results.push(resultSet.rows.item(i));
|
|
138
|
+
}
|
|
139
|
+
resolve(results);
|
|
140
|
+
},
|
|
141
|
+
(txObj, error) => {
|
|
142
|
+
console.log("❌ SQL Error (ItemCategory):", error);
|
|
143
|
+
reject(error);
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
},
|
|
147
|
+
(transactionError) => {
|
|
148
|
+
console.log("❌ Transaction Error (ItemCategory):", transactionError);
|
|
149
|
+
reject(transactionError);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const addItemCategory = (name, businessId) => {
|
|
155
|
+
const timestamp = new Date().toISOString();
|
|
156
|
+
|
|
157
|
+
return new Promise((resolve, reject) => {
|
|
158
|
+
db.transaction(
|
|
159
|
+
(tx) => {
|
|
160
|
+
tx.executeSql(
|
|
161
|
+
"INSERT INTO ItemCategory (name, created_at, updated_at,businessId) VALUES (?, ?, ?,?)",
|
|
162
|
+
[name, timestamp, timestamp, Number(businessId)],
|
|
163
|
+
(txObj, resultSet) => {
|
|
164
|
+
console.log("✅ Inserted item category:", resultSet);
|
|
165
|
+
resolve(resultSet);
|
|
166
|
+
},
|
|
167
|
+
(txObj, error) => {
|
|
168
|
+
console.log("❌ SQL Error (ItemCategory):", error);
|
|
169
|
+
reject(error);
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
(transactionError) => {
|
|
174
|
+
console.log("❌ Transaction Error (ItemCategory):", transactionError);
|
|
175
|
+
reject(transactionError);
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const updateItemCategory = (id, newName) => {
|
|
182
|
+
const timestamp = new Date().toISOString(); // 🕒 Current time for updated_at
|
|
183
|
+
|
|
184
|
+
return new Promise((resolve, reject) => {
|
|
185
|
+
db.transaction(
|
|
186
|
+
(tx) => {
|
|
187
|
+
tx.executeSql(
|
|
188
|
+
"UPDATE ItemCategory SET name = ?, updated_at = ? WHERE id = ?",
|
|
189
|
+
[newName, timestamp, id],
|
|
190
|
+
(txObj, resultSet) => {
|
|
191
|
+
console.log("✅ Updated item category:", resultSet);
|
|
192
|
+
resolve(resultSet);
|
|
193
|
+
},
|
|
194
|
+
(txObj, error) => {
|
|
195
|
+
console.log("❌ SQL Error (ItemCategory):", error);
|
|
196
|
+
reject(error);
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
},
|
|
200
|
+
(transactionError) => {
|
|
201
|
+
console.log("❌ Transaction Error (ItemCategory):", transactionError);
|
|
202
|
+
reject(transactionError);
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export const getItemsByBusiness = (
|
|
209
|
+
bId,
|
|
210
|
+
filter = "most_recent",
|
|
211
|
+
lowStock = false,
|
|
212
|
+
catId = null // 🆕 Optional category filter
|
|
213
|
+
) => {
|
|
214
|
+
return new Promise((resolve, reject) => {
|
|
215
|
+
db.transaction(
|
|
216
|
+
(tx) => {
|
|
217
|
+
// Base query
|
|
218
|
+
let query = "SELECT * FROM Items WHERE bId = ? AND isDeleted = 0";
|
|
219
|
+
const params = [bId];
|
|
220
|
+
|
|
221
|
+
// Add category filter if provided
|
|
222
|
+
if (catId !== null && catId !== "") {
|
|
223
|
+
query += " AND catId = ?";
|
|
224
|
+
params.push(catId);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Add low stock condition if true
|
|
228
|
+
if (lowStock) {
|
|
229
|
+
query += " AND qty <= 0";
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Sorting logic
|
|
233
|
+
switch (filter) {
|
|
234
|
+
case "most_recent":
|
|
235
|
+
query += " ORDER BY datetime(created_at) DESC";
|
|
236
|
+
break;
|
|
237
|
+
case "oldest":
|
|
238
|
+
query += " ORDER BY datetime(created_at) ASC";
|
|
239
|
+
break;
|
|
240
|
+
case "high_quantity":
|
|
241
|
+
query += " ORDER BY qty DESC";
|
|
242
|
+
break;
|
|
243
|
+
case "low_quantity":
|
|
244
|
+
query += " ORDER BY qty ASC";
|
|
245
|
+
break;
|
|
246
|
+
case "a-z":
|
|
247
|
+
query += " ORDER BY name COLLATE NOCASE ASC";
|
|
248
|
+
break;
|
|
249
|
+
case "z-a":
|
|
250
|
+
query += " ORDER BY name COLLATE NOCASE DESC";
|
|
251
|
+
break;
|
|
252
|
+
default:
|
|
253
|
+
query += " ORDER BY datetime(created_at) DESC";
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
tx.executeSql(
|
|
257
|
+
query,
|
|
258
|
+
params,
|
|
259
|
+
(txObj, resultSet) => {
|
|
260
|
+
const results = [];
|
|
261
|
+
for (let i = 0; i < resultSet.rows.length; i++) {
|
|
262
|
+
results.push(resultSet.rows.item(i));
|
|
263
|
+
}
|
|
264
|
+
console.log(
|
|
265
|
+
`✅ Fetched items for bId=${bId}${catId ? `, catId=${catId}` : ""} (${filter}${lowStock ? ", lowStock" : ""
|
|
266
|
+
}):`,
|
|
267
|
+
results.length
|
|
268
|
+
);
|
|
269
|
+
resolve(results);
|
|
270
|
+
},
|
|
271
|
+
(txObj, error) => {
|
|
272
|
+
console.log("❌ SQL Error (getItemsByBusiness):", error);
|
|
273
|
+
reject(error);
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
},
|
|
277
|
+
(transactionError) => {
|
|
278
|
+
console.log("❌ Transaction Error (getItemsByBusiness):", transactionError);
|
|
279
|
+
reject(transactionError);
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export const addItemDetails = (
|
|
286
|
+
itemId,
|
|
287
|
+
stockIN,
|
|
288
|
+
stockOUT,
|
|
289
|
+
amount,
|
|
290
|
+
subamount,
|
|
291
|
+
details,
|
|
292
|
+
local_path,
|
|
293
|
+
entryDate,
|
|
294
|
+
fbId,
|
|
295
|
+
bill = "",
|
|
296
|
+
customerId = null
|
|
297
|
+
) => {
|
|
298
|
+
return new Promise((resolve, reject) => {
|
|
299
|
+
db.transaction(
|
|
300
|
+
(tx) => {
|
|
301
|
+
const query = `
|
|
302
|
+
INSERT INTO ItemsDetail
|
|
303
|
+
(itemId, stockIN, stockOUT, amount, subamount, details, local_path, entryDate, fbId, bill, customerId, created_at, updated_at)
|
|
304
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now', 'localtime'), datetime('now', 'localtime'))
|
|
305
|
+
`;
|
|
306
|
+
|
|
307
|
+
const params = [
|
|
308
|
+
itemId,
|
|
309
|
+
stockIN,
|
|
310
|
+
stockOUT,
|
|
311
|
+
amount,
|
|
312
|
+
subamount,
|
|
313
|
+
String(details),
|
|
314
|
+
local_path,
|
|
315
|
+
entryDate,
|
|
316
|
+
fbId,
|
|
317
|
+
bill,
|
|
318
|
+
customerId
|
|
319
|
+
];
|
|
320
|
+
|
|
321
|
+
tx.executeSql(
|
|
322
|
+
query,
|
|
323
|
+
params,
|
|
324
|
+
(txObj, resultSet) => {
|
|
325
|
+
console.log("✅ ItemDetails inserted successfully:", resultSet);
|
|
326
|
+
resolve(resultSet);
|
|
327
|
+
},
|
|
328
|
+
(txObj, error) => {
|
|
329
|
+
console.log("❌ SQL Error (ItemDetails):", error);
|
|
330
|
+
reject(error);
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
},
|
|
334
|
+
(transactionError) => {
|
|
335
|
+
console.log("❌ Transaction Error (ItemDetails):", transactionError);
|
|
336
|
+
reject(transactionError);
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
export const updateItemDetails = (
|
|
343
|
+
id, // 🆔 ID of the record to update
|
|
344
|
+
itemId, // 🆔 Item ID (foreign key)
|
|
345
|
+
stockIN, // 📦 Stock added
|
|
346
|
+
stockOUT, // 📤 Stock removed
|
|
347
|
+
amount, // 💰 Total amount after tax/discount
|
|
348
|
+
subamount, // 💵 Subtotal before tax/discount
|
|
349
|
+
details, // 📝 Notes or description
|
|
350
|
+
local_path, // 📂 Optional file path or attachment
|
|
351
|
+
entryDate, // 📅 Transaction/entry date
|
|
352
|
+
fbId, // 🏢 Business ID
|
|
353
|
+
bill = "" // 🧾 Bill number or reference
|
|
354
|
+
) => {
|
|
355
|
+
return new Promise((resolve, reject) => {
|
|
356
|
+
db.transaction(
|
|
357
|
+
(tx) => {
|
|
358
|
+
const query = `
|
|
359
|
+
UPDATE ItemsDetail
|
|
360
|
+
SET
|
|
361
|
+
itemId = ?,
|
|
362
|
+
stockIN = ?,
|
|
363
|
+
stockOUT = ?,
|
|
364
|
+
amount = ?,
|
|
365
|
+
subamount = ?,
|
|
366
|
+
details = ?,
|
|
367
|
+
local_path = ?,
|
|
368
|
+
entryDate = ?,
|
|
369
|
+
fbId = ?,
|
|
370
|
+
bill = ?,
|
|
371
|
+
updated_at = datetime('now', 'localtime')
|
|
372
|
+
WHERE id = ?;
|
|
373
|
+
`;
|
|
374
|
+
|
|
375
|
+
const params = [
|
|
376
|
+
itemId,
|
|
377
|
+
stockIN,
|
|
378
|
+
stockOUT,
|
|
379
|
+
amount,
|
|
380
|
+
subamount,
|
|
381
|
+
String(details),
|
|
382
|
+
local_path,
|
|
383
|
+
entryDate,
|
|
384
|
+
fbId,
|
|
385
|
+
bill,
|
|
386
|
+
id, // WHERE condition
|
|
387
|
+
];
|
|
388
|
+
|
|
389
|
+
tx.executeSql(
|
|
390
|
+
query,
|
|
391
|
+
params,
|
|
392
|
+
(txObj, resultSet) => {
|
|
393
|
+
console.log("✅ ItemDetails updated successfully:", resultSet);
|
|
394
|
+
resolve(resultSet);
|
|
395
|
+
},
|
|
396
|
+
(txObj, error) => {
|
|
397
|
+
console.log("❌ SQL Error (updateItemDetails):", error);
|
|
398
|
+
reject(error);
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
},
|
|
402
|
+
(transactionError) => {
|
|
403
|
+
console.log("❌ Transaction Error (updateItemDetails):", transactionError);
|
|
404
|
+
reject(transactionError);
|
|
405
|
+
}
|
|
406
|
+
);
|
|
407
|
+
});
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
export const addItemImages = (itemId, local_path) => {
|
|
411
|
+
return new Promise((resolve, reject) => {
|
|
412
|
+
db.transaction((tx) => {
|
|
413
|
+
tx.executeSql(
|
|
414
|
+
`INSERT INTO ItemImages (itemId, local_path, created_at, updated_at)
|
|
415
|
+
VALUES (?, ?, datetime('now', 'localtime'), datetime('now', 'localtime'))`,
|
|
416
|
+
[itemId, local_path],
|
|
417
|
+
(txObj, resultSet) => {
|
|
418
|
+
console.log("✅ Item image inserted:", resultSet);
|
|
419
|
+
resolve(resultSet);
|
|
420
|
+
},
|
|
421
|
+
(txObj, error) => {
|
|
422
|
+
console.log("❌ SQL Error (addItemImages):", error);
|
|
423
|
+
reject(error);
|
|
424
|
+
}
|
|
425
|
+
);
|
|
426
|
+
},
|
|
427
|
+
(transactionError) => {
|
|
428
|
+
console.log("❌ Transaction Error (addItemImages):", transactionError);
|
|
429
|
+
reject(transactionError);
|
|
430
|
+
});
|
|
431
|
+
});
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
export const deleteItemImagesByItemId = (itemId) => {
|
|
435
|
+
return new Promise((resolve, reject) => {
|
|
436
|
+
db.transaction((tx) => {
|
|
437
|
+
tx.executeSql(
|
|
438
|
+
`DELETE FROM ItemImages WHERE itemId = ?`,
|
|
439
|
+
[itemId],
|
|
440
|
+
(txObj, resultSet) => {
|
|
441
|
+
console.log("🗑️ deleteItemImagesByItemId rowsAffected:", resultSet.rowsAffected);
|
|
442
|
+
resolve(resultSet);
|
|
443
|
+
},
|
|
444
|
+
(txObj, error) => {
|
|
445
|
+
console.log("❌ SQL Error (deleteItemImagesByItemId):", error);
|
|
446
|
+
reject(error);
|
|
447
|
+
}
|
|
448
|
+
);
|
|
449
|
+
},
|
|
450
|
+
(transactionError) => {
|
|
451
|
+
console.log("❌ Transaction Error (deleteItemImagesByItemId):", transactionError);
|
|
452
|
+
reject(transactionError);
|
|
453
|
+
});
|
|
454
|
+
});
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
export const updateItemQty = (itemId, newQty) => {
|
|
458
|
+
return new Promise((resolve, reject) => {
|
|
459
|
+
db.transaction(
|
|
460
|
+
(tx) => {
|
|
461
|
+
const query = `
|
|
462
|
+
UPDATE Items
|
|
463
|
+
SET qty = ?, updated_at = datetime('now', 'localtime')
|
|
464
|
+
WHERE id = ?
|
|
465
|
+
`;
|
|
466
|
+
|
|
467
|
+
tx.executeSql(
|
|
468
|
+
query,
|
|
469
|
+
[newQty, itemId],
|
|
470
|
+
(txObj, resultSet) => {
|
|
471
|
+
console.log("✅ Quantity updated successfully:", resultSet);
|
|
472
|
+
resolve(resultSet);
|
|
473
|
+
},
|
|
474
|
+
(txObj, error) => {
|
|
475
|
+
console.log("❌ SQL Error (updateItemQty):", error);
|
|
476
|
+
reject(error);
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
},
|
|
480
|
+
(transactionError) => {
|
|
481
|
+
console.log("❌ Transaction Error (updateItemQty):", transactionError);
|
|
482
|
+
reject(transactionError);
|
|
483
|
+
}
|
|
484
|
+
);
|
|
485
|
+
});
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
export const getItemDetailsByItemId = (itemId) => {
|
|
489
|
+
return new Promise((resolve, reject) => {
|
|
490
|
+
db.transaction((tx) => {
|
|
491
|
+
// Step 1: Fetch item details (these rows have their own id)
|
|
492
|
+
tx.executeSql(
|
|
493
|
+
`SELECT *
|
|
494
|
+
FROM ItemsDetail
|
|
495
|
+
WHERE itemId = ? AND isDeleted = 0
|
|
496
|
+
ORDER BY datetime(created_at) DESC`,
|
|
497
|
+
[itemId],
|
|
498
|
+
(txObj, resultSet) => {
|
|
499
|
+
const details = [];
|
|
500
|
+
for (let i = 0; i < resultSet.rows.length; i++) {
|
|
501
|
+
details.push({
|
|
502
|
+
...resultSet.rows.item(i),
|
|
503
|
+
attachments: [],
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
if (details.length === 0) {
|
|
508
|
+
// nothing to look up images for
|
|
509
|
+
console.log("ℹ️ No ItemsDetail rows found for itemId:", itemId);
|
|
510
|
+
resolve([]);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
// IMPORTANT: images are saved against the ItemsDetail's `id` (detail row id)
|
|
515
|
+
const detailIds = details.map((d) => d.id); // <-- use detail row id
|
|
516
|
+
const placeholders = detailIds.map(() => "?").join(",");
|
|
517
|
+
|
|
518
|
+
// Step 2: Fetch images where ItemImages.itemId is actually the ItemsDetail.id
|
|
519
|
+
tx.executeSql(
|
|
520
|
+
`SELECT * FROM ItemImages WHERE itemId IN (${placeholders})`,
|
|
521
|
+
detailIds,
|
|
522
|
+
(txObj2, resultSet2) => {
|
|
523
|
+
const images = [];
|
|
524
|
+
for (let i = 0; i < resultSet2.rows.length; i++) {
|
|
525
|
+
images.push(resultSet2.rows.item(i));
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// Step 3: merge images into details by matching img.itemId === detail.id
|
|
529
|
+
const detailMap = {};
|
|
530
|
+
details.forEach((d) => {
|
|
531
|
+
detailMap[d.id] = d; // use detail.id as key
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
images.forEach((img) => {
|
|
535
|
+
// safety: ensure the mapping exists
|
|
536
|
+
if (detailMap[img.itemId]) {
|
|
537
|
+
detailMap[img.itemId].attachments.push(img);
|
|
538
|
+
} else {
|
|
539
|
+
// optional: log unexpected image that doesn't match any detail id
|
|
540
|
+
console.warn("⚠️ Image has no matching ItemsDetail row:", img);
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
console.log("✅ ItemDetails with images fetched successfully:", details);
|
|
545
|
+
resolve(details);
|
|
546
|
+
},
|
|
547
|
+
(txObj2, error) => {
|
|
548
|
+
console.log("❌ SQL Error (ItemImages):", error);
|
|
549
|
+
reject(error);
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
},
|
|
553
|
+
(txObj, error) => {
|
|
554
|
+
console.log("❌ SQL Error (ItemsDetail):", error);
|
|
555
|
+
reject(error);
|
|
556
|
+
}
|
|
557
|
+
);
|
|
558
|
+
},
|
|
559
|
+
(transactionError) => {
|
|
560
|
+
console.log("❌ Transaction Error (getItemDetailsByItemId):", transactionError);
|
|
561
|
+
reject(transactionError);
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
export const softDeleteItem = (itemId) => {
|
|
567
|
+
return new Promise((resolve, reject) => {
|
|
568
|
+
db.transaction(
|
|
569
|
+
(tx) => {
|
|
570
|
+
const query = `
|
|
571
|
+
UPDATE Items
|
|
572
|
+
SET isDeleted = 1, updated_at = datetime('now', 'localtime')
|
|
573
|
+
WHERE id = ?
|
|
574
|
+
`;
|
|
575
|
+
|
|
576
|
+
tx.executeSql(
|
|
577
|
+
query,
|
|
578
|
+
[itemId],
|
|
579
|
+
(txObj, resultSet) => {
|
|
580
|
+
if (resultSet.rowsAffected > 0) {
|
|
581
|
+
console.log(`🗑️ Item soft deleted successfully (id: ${itemId})`);
|
|
582
|
+
resolve(resultSet);
|
|
583
|
+
} else {
|
|
584
|
+
console.log(`⚠️ No item found with id: ${itemId}`);
|
|
585
|
+
resolve(null);
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
(txObj, error) => {
|
|
589
|
+
console.log("❌ SQL Error (softDeleteItem):", error);
|
|
590
|
+
reject(error);
|
|
591
|
+
}
|
|
592
|
+
);
|
|
593
|
+
},
|
|
594
|
+
(transactionError) => {
|
|
595
|
+
console.log("❌ Transaction Error (softDeleteItem):", transactionError);
|
|
596
|
+
reject(transactionError);
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
});
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
export const getStockEntries = (
|
|
603
|
+
fbId,
|
|
604
|
+
type = null,
|
|
605
|
+
startDate = null,
|
|
606
|
+
endDate = null,
|
|
607
|
+
lowStockOnly = false,
|
|
608
|
+
itemId = null
|
|
609
|
+
) => {
|
|
610
|
+
return new Promise((resolve, reject) => {
|
|
611
|
+
db.transaction(
|
|
612
|
+
(tx) => {
|
|
613
|
+
let query = `
|
|
614
|
+
SELECT ItemsDetail.*, Items.qty
|
|
615
|
+
FROM ItemsDetail
|
|
616
|
+
JOIN Items ON ItemsDetail.itemId = Items.id
|
|
617
|
+
WHERE ItemsDetail.fbId = ?
|
|
618
|
+
AND ItemsDetail.isDeleted = 0
|
|
619
|
+
AND Items.isDeleted = 0
|
|
620
|
+
`;
|
|
621
|
+
const params = [fbId];
|
|
622
|
+
|
|
623
|
+
// ✅ Filter by itemId
|
|
624
|
+
if (itemId) {
|
|
625
|
+
query += " AND ItemsDetail.itemId = ?";
|
|
626
|
+
params.push(itemId);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// ✅ Filter by type (IN or OUT)
|
|
630
|
+
if (type === "IN") {
|
|
631
|
+
query += " AND ItemsDetail.stockIN > 0";
|
|
632
|
+
} else if (type === "OUT") {
|
|
633
|
+
query += " AND ItemsDetail.stockOUT > 0";
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// ✅ Filter by date range (ignore time)
|
|
637
|
+
if (startDate && endDate) {
|
|
638
|
+
query +=
|
|
639
|
+
" AND date(ItemsDetail.entryDate) BETWEEN date(?) AND date(?)";
|
|
640
|
+
params.push(startDate, endDate);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// ✅ Low Stock check (qty = 0 or less OR qty < lowStock if lowStock exists)
|
|
644
|
+
if (lowStockOnly) {
|
|
645
|
+
query += `
|
|
646
|
+
AND (
|
|
647
|
+
Items.qty < IFNULL(Items.lowStock, 0)
|
|
648
|
+
)
|
|
649
|
+
`;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
// ✅ Sort by latest first
|
|
656
|
+
query += " ORDER BY datetime(ItemsDetail.created_at) DESC";
|
|
657
|
+
|
|
658
|
+
tx.executeSql(
|
|
659
|
+
query,
|
|
660
|
+
params,
|
|
661
|
+
(txObj, resultSet) => {
|
|
662
|
+
const results = [];
|
|
663
|
+
for (let i = 0; i < resultSet.rows.length; i++) {
|
|
664
|
+
results.push(resultSet.rows.item(i));
|
|
665
|
+
}
|
|
666
|
+
console.log(
|
|
667
|
+
`✅ Stock entries fetched for fbId=${fbId} (type=${type || "ALL"}, itemId=${itemId || "ALL"}, lowStockOnly=${lowStockOnly}):`,
|
|
668
|
+
results.length
|
|
669
|
+
);
|
|
670
|
+
resolve(results);
|
|
671
|
+
},
|
|
672
|
+
(txObj, error) => {
|
|
673
|
+
console.log("❌ SQL Error (getStockEntries):", error);
|
|
674
|
+
reject(error);
|
|
675
|
+
}
|
|
676
|
+
);
|
|
677
|
+
},
|
|
678
|
+
(transactionError) => {
|
|
679
|
+
console.log("❌ Transaction Error (getStockEntries):", transactionError);
|
|
680
|
+
reject(transactionError);
|
|
681
|
+
}
|
|
682
|
+
);
|
|
683
|
+
});
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
export const softDeleteItemDetail = (detailId) => {
|
|
687
|
+
return new Promise((resolve, reject) => {
|
|
688
|
+
db.transaction((tx) => {
|
|
689
|
+
tx.executeSql(
|
|
690
|
+
`
|
|
691
|
+
UPDATE ItemsDetail
|
|
692
|
+
SET isDeleted = 1
|
|
693
|
+
WHERE id = ?;
|
|
694
|
+
`,
|
|
695
|
+
[detailId],
|
|
696
|
+
(txObj, resultSet) => {
|
|
697
|
+
console.log("Rows affected (soft delete ItemsDetail):", resultSet.rowsAffected);
|
|
698
|
+
resolve(resultSet);
|
|
699
|
+
},
|
|
700
|
+
(txObj, error) => {
|
|
701
|
+
console.log("❌ Error soft deleting ItemsDetail entry:", error);
|
|
702
|
+
reject(error);
|
|
703
|
+
}
|
|
704
|
+
);
|
|
705
|
+
});
|
|
706
|
+
});
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|