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.
Files changed (718) hide show
  1. package/lib/module/App.js +13 -26
  2. package/lib/module/App.js.map +1 -1
  3. package/lib/module/app/api/api.js +12 -0
  4. package/lib/module/app/api/api.js.map +1 -0
  5. package/lib/module/app/assets/Icons/Bill.png +0 -0
  6. package/lib/module/app/assets/Icons/Bill_Grey.png +0 -0
  7. package/lib/module/app/assets/Icons/Cash.png +0 -0
  8. package/lib/module/app/assets/Icons/Cash_Grey.png +0 -0
  9. package/lib/module/app/assets/Icons/Expense.png +0 -0
  10. package/lib/module/app/assets/Icons/Expense_Grey.png +0 -0
  11. package/lib/module/app/assets/Icons/Staff.png +0 -0
  12. package/lib/module/app/assets/Icons/Stock.png +0 -0
  13. package/lib/module/app/assets/Icons/Stock_Grey.png +0 -0
  14. package/lib/module/app/assets/Icons/abc.png +0 -0
  15. package/lib/module/app/assets/Icons/bank_logo.png +0 -0
  16. package/lib/module/app/assets/Icons/download_sale.png +0 -0
  17. package/lib/module/app/assets/Icons/recycle-bin.png +0 -0
  18. package/lib/module/app/assets/animations/recording.json +1 -0
  19. package/lib/module/app/assets/animations/success.json +1 -0
  20. package/lib/module/app/assets/animations/voice_visualization.json +1 -0
  21. package/lib/module/app/assets/businessCards/card_11.png +0 -0
  22. package/lib/module/app/assets/businessCards/card_12_bg.png +0 -0
  23. package/lib/module/app/assets/businessCards/card_wall_01.jpeg +0 -0
  24. package/lib/module/app/assets/businessCards/card_wall_02.jpeg +0 -0
  25. package/lib/module/app/assets/businessCards/card_wall_03.jpeg +0 -0
  26. package/lib/module/app/assets/businessCards/card_wall_04.jpeg +0 -0
  27. package/lib/module/app/assets/businessCards/card_wall_05.jpeg +0 -0
  28. package/lib/module/app/assets/businessCards/card_wall_06.jpeg +0 -0
  29. package/lib/module/app/assets/businessCards/card_wall_07.jpeg +0 -0
  30. package/lib/module/app/assets/businessCards/card_wall_08.jpeg +0 -0
  31. package/lib/module/app/assets/illustrations/empty.png +0 -0
  32. package/lib/module/app/assets/illustrations/packages.png +0 -0
  33. package/lib/module/app/assets/images/Digikhata_idzarHgH0q_0.png +0 -0
  34. package/lib/module/app/assets/images/bank.png +0 -0
  35. package/lib/module/app/assets/images/digiLogo-main.png +0 -0
  36. package/lib/module/app/assets/images/svgviewer-output.svg +57 -0
  37. package/lib/module/app/assets/images/user.png +0 -0
  38. package/lib/module/app/assets/oldIcons/BILL.svg +3 -0
  39. package/lib/module/app/assets/oldIcons/CASH.svg +4 -0
  40. package/lib/module/app/assets/oldIcons/EXPENSE.svg +6 -0
  41. package/lib/module/app/assets/oldIcons/STAFF.svg +3 -0
  42. package/lib/module/app/assets/oldIcons/Sale Active.svg +14 -0
  43. package/lib/module/app/assets/oldIcons/Stock.svg +5 -0
  44. package/lib/module/app/assets/svg/BILL.svg +4 -0
  45. package/lib/module/app/assets/svg/CASH.svg +6 -0
  46. package/lib/module/app/assets/svg/EXPENSE.svg +5 -0
  47. package/lib/module/app/assets/svg/More Icon.svg +6 -0
  48. package/lib/module/app/assets/svg/Payment Icon.svg +4 -0
  49. package/lib/module/app/assets/svg/Pos.svg +13 -0
  50. package/lib/module/app/assets/svg/STAFF.svg +5 -0
  51. package/lib/module/app/assets/svg/Sale Active.svg +8 -0
  52. package/lib/module/app/assets/svg/Sale Icon.svg +3 -0
  53. package/lib/module/app/assets/svg/Stock.svg +5 -0
  54. package/lib/module/app/components/AccountSetupSteps.js +64 -0
  55. package/lib/module/app/components/AccountSetupSteps.js.map +1 -0
  56. package/lib/module/app/components/AddItemBillParent.js +366 -0
  57. package/lib/module/app/components/AddItemBillParent.js.map +1 -0
  58. package/lib/module/app/components/AdditemBillChild.js +1123 -0
  59. package/lib/module/app/components/AdditemBillChild.js.map +1 -0
  60. package/lib/module/app/components/Balance.js +116 -70
  61. package/lib/module/app/components/Balance.js.map +1 -1
  62. package/lib/module/app/components/BillList.js +428 -0
  63. package/lib/module/app/components/BillList.js.map +1 -0
  64. package/lib/module/app/components/BillSetupSteps.js +64 -0
  65. package/lib/module/app/components/BillSetupSteps.js.map +1 -0
  66. package/lib/module/app/components/BottomView.js +35 -0
  67. package/lib/module/app/components/BottomView.js.map +1 -0
  68. package/lib/module/app/components/BusinessCards/Card1.js +202 -0
  69. package/lib/module/app/components/BusinessCards/Card1.js.map +1 -0
  70. package/lib/module/app/components/BusinessCards/Card10.js +234 -0
  71. package/lib/module/app/components/BusinessCards/Card10.js.map +1 -0
  72. package/lib/module/app/components/BusinessCards/Card2.js +190 -0
  73. package/lib/module/app/components/BusinessCards/Card2.js.map +1 -0
  74. package/lib/module/app/components/BusinessCards/Card3.js +186 -0
  75. package/lib/module/app/components/BusinessCards/Card3.js.map +1 -0
  76. package/lib/module/app/components/BusinessCards/Card4.js +186 -0
  77. package/lib/module/app/components/BusinessCards/Card4.js.map +1 -0
  78. package/lib/module/app/components/BusinessCards/Card5.js +189 -0
  79. package/lib/module/app/components/BusinessCards/Card5.js.map +1 -0
  80. package/lib/module/app/components/BusinessCards/Card6.js +198 -0
  81. package/lib/module/app/components/BusinessCards/Card6.js.map +1 -0
  82. package/lib/module/app/components/BusinessCards/Card7.js +185 -0
  83. package/lib/module/app/components/BusinessCards/Card7.js.map +1 -0
  84. package/lib/module/app/components/BusinessCards/Card8.js +187 -0
  85. package/lib/module/app/components/BusinessCards/Card8.js.map +1 -0
  86. package/lib/module/app/components/BusinessCards/Card9.js +234 -0
  87. package/lib/module/app/components/BusinessCards/Card9.js.map +1 -0
  88. package/lib/module/app/components/BusinessCards/index.js +13 -0
  89. package/lib/module/app/components/BusinessCards/index.js.map +1 -0
  90. package/lib/module/app/components/CashEntryComponent.js +256 -0
  91. package/lib/module/app/components/CashEntryComponent.js.map +1 -0
  92. package/lib/module/app/components/CityModal.js +116 -0
  93. package/lib/module/app/components/CityModal.js.map +1 -0
  94. package/lib/module/app/components/CountryPhoneInput.js +263 -166
  95. package/lib/module/app/components/CountryPhoneInput.js.map +1 -1
  96. package/lib/module/app/components/CreateExpenseAccount.js +139 -0
  97. package/lib/module/app/components/CreateExpenseAccount.js.map +1 -0
  98. package/lib/module/app/components/CustomStatusBar.js +29 -0
  99. package/lib/module/app/components/CustomStatusBar.js.map +1 -0
  100. package/lib/module/app/components/CustomToast.js +135 -0
  101. package/lib/module/app/components/CustomToast.js.map +1 -0
  102. package/lib/module/app/components/DeleteBusinessModal.js +174 -0
  103. package/lib/module/app/components/DeleteBusinessModal.js.map +1 -0
  104. package/lib/module/app/components/DiscountTaxModal.js +242 -0
  105. package/lib/module/app/components/DiscountTaxModal.js.map +1 -0
  106. package/lib/module/app/components/Entries.js +54 -32
  107. package/lib/module/app/components/Entries.js.map +1 -1
  108. package/lib/module/app/components/ExpenseList.js +402 -0
  109. package/lib/module/app/components/ExpenseList.js.map +1 -0
  110. package/lib/module/app/components/ExpenseParent.js +441 -0
  111. package/lib/module/app/components/ExpenseParent.js.map +1 -0
  112. package/lib/module/app/components/FloatingInput.js +159 -0
  113. package/lib/module/app/components/FloatingInput.js.map +1 -0
  114. package/lib/module/app/components/Header.js +107 -0
  115. package/lib/module/app/components/Header.js.map +1 -0
  116. package/lib/module/app/components/Loader.js +45 -0
  117. package/lib/module/app/components/Loader.js.map +1 -0
  118. package/lib/module/app/components/PartyModal.js +230 -0
  119. package/lib/module/app/components/PartyModal.js.map +1 -0
  120. package/lib/module/app/components/PickerModal.js +153 -0
  121. package/lib/module/app/components/PickerModal.js.map +1 -0
  122. package/lib/module/app/components/SalePaymentModal.js +743 -0
  123. package/lib/module/app/components/SalePaymentModal.js.map +1 -0
  124. package/lib/module/app/components/SearchBar.js +179 -42
  125. package/lib/module/app/components/SearchBar.js.map +1 -1
  126. package/lib/module/app/components/StockDetailChild.js +425 -0
  127. package/lib/module/app/components/StockDetailChild.js.map +1 -0
  128. package/lib/module/app/components/StockList.js +448 -0
  129. package/lib/module/app/components/StockList.js.map +1 -0
  130. package/lib/module/app/components/StockReportTransaction.js +182 -0
  131. package/lib/module/app/components/StockReportTransaction.js.map +1 -0
  132. package/lib/module/app/components/Transaction.js +193 -53
  133. package/lib/module/app/components/Transaction.js.map +1 -1
  134. package/lib/module/app/components/User.js +106 -51
  135. package/lib/module/app/components/User.js.map +1 -1
  136. package/lib/module/app/components/index.js +20 -1
  137. package/lib/module/app/components/index.js.map +1 -1
  138. package/lib/module/app/database/bill.js +247 -0
  139. package/lib/module/app/database/bill.js.map +1 -0
  140. package/lib/module/app/database/business.js +262 -0
  141. package/lib/module/app/database/business.js.map +1 -0
  142. package/lib/module/app/database/cash.js +299 -0
  143. package/lib/module/app/database/cash.js.map +1 -0
  144. package/lib/module/app/database/clients.js +1182 -36
  145. package/lib/module/app/database/clients.js.map +1 -1
  146. package/lib/module/app/database/expense.js +299 -0
  147. package/lib/module/app/database/expense.js.map +1 -0
  148. package/lib/module/app/database/schema.js +113 -3
  149. package/lib/module/app/database/schema.js.map +1 -1
  150. package/lib/module/app/database/stock.js +509 -0
  151. package/lib/module/app/database/stock.js.map +1 -0
  152. package/lib/module/app/htmlTemplates/htmlTemplates.js +2504 -0
  153. package/lib/module/app/htmlTemplates/htmlTemplates.js.map +1 -0
  154. package/lib/module/app/navigation/BillStack/BillStack.js +40 -0
  155. package/lib/module/app/navigation/BillStack/BillStack.js.map +1 -0
  156. package/lib/module/app/navigation/BottomTabs/BottomTabs.js +10 -5
  157. package/lib/module/app/navigation/BottomTabs/BottomTabs.js.map +1 -1
  158. package/lib/module/app/navigation/BusinessStack/BusinessStack.js +30 -0
  159. package/lib/module/app/navigation/BusinessStack/BusinessStack.js.map +1 -0
  160. package/lib/module/app/navigation/CashStack/CashStack.js +79 -0
  161. package/lib/module/app/navigation/CashStack/CashStack.js.map +1 -0
  162. package/lib/module/app/navigation/EntriesStack/EntriesStack.js +223 -0
  163. package/lib/module/app/navigation/EntriesStack/EntriesStack.js.map +1 -0
  164. package/lib/module/app/navigation/ExpenseStack.js/ExpenseStack.js +37 -0
  165. package/lib/module/app/navigation/ExpenseStack.js/ExpenseStack.js.map +1 -0
  166. package/lib/module/app/navigation/HomeStack/HomeStack.js +93 -1
  167. package/lib/module/app/navigation/HomeStack/HomeStack.js.map +1 -1
  168. package/lib/module/app/navigation/Root.js +10 -1
  169. package/lib/module/app/navigation/Root.js.map +1 -1
  170. package/lib/module/app/navigation/SaleStack/SaleStack.js +73 -0
  171. package/lib/module/app/navigation/SaleStack/SaleStack.js.map +1 -0
  172. package/lib/module/app/navigation/StockStack/StockStack.js +49 -0
  173. package/lib/module/app/navigation/StockStack/StockStack.js.map +1 -0
  174. package/lib/module/app/navigation/index.js +3 -1
  175. package/lib/module/app/navigation/index.js.map +1 -1
  176. package/lib/module/app/redux/Store.js +3 -1
  177. package/lib/module/app/redux/Store.js.map +1 -1
  178. package/lib/module/app/redux/reducers/client/client_reducers.js +23 -2
  179. package/lib/module/app/redux/reducers/client/client_reducers.js.map +1 -1
  180. package/lib/module/app/redux/reducers/client/client_types.js +5 -0
  181. package/lib/module/app/redux/reducers/client/client_types.js.map +1 -1
  182. package/lib/module/app/redux/reducers/user/user_reducers.js +22 -0
  183. package/lib/module/app/redux/reducers/user/user_reducers.js.map +1 -0
  184. package/lib/module/app/redux/reducers/user/user_types.js +6 -0
  185. package/lib/module/app/redux/reducers/user/user_types.js.map +1 -0
  186. package/lib/module/app/screens/AddBank.js +237 -0
  187. package/lib/module/app/screens/AddBank.js.map +1 -0
  188. package/lib/module/app/screens/AddBusiness.js +905 -0
  189. package/lib/module/app/screens/AddBusiness.js.map +1 -0
  190. package/lib/module/app/screens/AddItems.js +433 -0
  191. package/lib/module/app/screens/AddItems.js.map +1 -0
  192. package/lib/module/app/screens/AddScreen.js +341 -77
  193. package/lib/module/app/screens/AddScreen.js.map +1 -1
  194. package/lib/module/app/screens/All.js +836 -0
  195. package/lib/module/app/screens/All.js.map +1 -0
  196. package/lib/module/app/screens/AllTransactions.js +846 -0
  197. package/lib/module/app/screens/AllTransactions.js.map +1 -0
  198. package/lib/module/app/screens/Banks.js +807 -48
  199. package/lib/module/app/screens/Banks.js.map +1 -1
  200. package/lib/module/app/screens/BillDetails.js +1033 -0
  201. package/lib/module/app/screens/BillDetails.js.map +1 -0
  202. package/lib/module/app/screens/BillHome.js +102 -0
  203. package/lib/module/app/screens/BillHome.js.map +1 -0
  204. package/lib/module/app/screens/BillParent.js +373 -0
  205. package/lib/module/app/screens/BillParent.js.map +1 -0
  206. package/lib/module/app/screens/BusinessDetail.js +787 -0
  207. package/lib/module/app/screens/BusinessDetail.js.map +1 -0
  208. package/lib/module/app/screens/CashEntry.js +2429 -0
  209. package/lib/module/app/screens/CashEntry.js.map +1 -0
  210. package/lib/module/app/screens/CashEntryDetails.js +574 -0
  211. package/lib/module/app/screens/CashEntryDetails.js.map +1 -0
  212. package/lib/module/app/screens/CashHome.js +544 -0
  213. package/lib/module/app/screens/CashHome.js.map +1 -0
  214. package/lib/module/app/screens/CashReport.js +1297 -0
  215. package/lib/module/app/screens/CashReport.js.map +1 -0
  216. package/lib/module/app/screens/CashSummary.js +602 -0
  217. package/lib/module/app/screens/CashSummary.js.map +1 -0
  218. package/lib/module/app/screens/CreateBill.js +2137 -0
  219. package/lib/module/app/screens/CreateBill.js.map +1 -0
  220. package/lib/module/app/screens/CustomerEntries.js +1093 -184
  221. package/lib/module/app/screens/CustomerEntries.js.map +1 -1
  222. package/lib/module/app/screens/Customers.js +727 -96
  223. package/lib/module/app/screens/Customers.js.map +1 -1
  224. package/lib/module/app/screens/EditCategory.js +299 -0
  225. package/lib/module/app/screens/EditCategory.js.map +1 -0
  226. package/lib/module/app/screens/EditCategoryStock.js +302 -0
  227. package/lib/module/app/screens/EditCategoryStock.js.map +1 -0
  228. package/lib/module/app/screens/Entry.js +1838 -275
  229. package/lib/module/app/screens/Entry.js.map +1 -1
  230. package/lib/module/app/screens/ExpenseDetail.js +15 -0
  231. package/lib/module/app/screens/ExpenseDetail.js.map +1 -0
  232. package/lib/module/app/screens/ExpenseEntries.js +713 -0
  233. package/lib/module/app/screens/ExpenseEntries.js.map +1 -0
  234. package/lib/module/app/screens/ExpenseEntry.js +2095 -0
  235. package/lib/module/app/screens/ExpenseEntry.js.map +1 -0
  236. package/lib/module/app/screens/ExpenseEntryDetails.js +508 -0
  237. package/lib/module/app/screens/ExpenseEntryDetails.js.map +1 -0
  238. package/lib/module/app/screens/ExpenseEntryReport.js +792 -0
  239. package/lib/module/app/screens/ExpenseEntryReport.js.map +1 -0
  240. package/lib/module/app/screens/ExpenseReport.js +792 -0
  241. package/lib/module/app/screens/ExpenseReport.js.map +1 -0
  242. package/lib/module/app/screens/Geolocation.js +374 -0
  243. package/lib/module/app/screens/Geolocation.js.map +1 -0
  244. package/lib/module/app/screens/GetStarted.js +213 -0
  245. package/lib/module/app/screens/GetStarted.js.map +1 -0
  246. package/lib/module/app/screens/HomeScreen.js +202 -55
  247. package/lib/module/app/screens/HomeScreen.js.map +1 -1
  248. package/lib/module/app/screens/InBuy.js +854 -0
  249. package/lib/module/app/screens/InBuy.js.map +1 -0
  250. package/lib/module/app/screens/ItemEntryDetails.js +652 -0
  251. package/lib/module/app/screens/ItemEntryDetails.js.map +1 -0
  252. package/lib/module/app/screens/LowStock.js +372 -0
  253. package/lib/module/app/screens/LowStock.js.map +1 -0
  254. package/lib/module/app/screens/NewPin.js +234 -0
  255. package/lib/module/app/screens/NewPin.js.map +1 -0
  256. package/lib/module/app/screens/OutSell.js +1883 -0
  257. package/lib/module/app/screens/OutSell.js.map +1 -0
  258. package/lib/module/app/screens/POSSale.js +637 -0
  259. package/lib/module/app/screens/POSSale.js.map +1 -0
  260. package/lib/module/app/screens/PinScreen.js +663 -0
  261. package/lib/module/app/screens/PinScreen.js.map +1 -0
  262. package/lib/module/app/screens/PreviewBill.js +329 -0
  263. package/lib/module/app/screens/PreviewBill.js.map +1 -0
  264. package/lib/module/app/screens/Profile.js +1160 -0
  265. package/lib/module/app/screens/Profile.js.map +1 -0
  266. package/lib/module/app/screens/RateList.js +432 -0
  267. package/lib/module/app/screens/RateList.js.map +1 -0
  268. package/lib/module/app/screens/Report.js +1105 -0
  269. package/lib/module/app/screens/Report.js.map +1 -0
  270. package/lib/module/app/screens/SaleItemDetail.js +1047 -0
  271. package/lib/module/app/screens/SaleItemDetail.js.map +1 -0
  272. package/lib/module/app/screens/SaleParent.js +289 -0
  273. package/lib/module/app/screens/SaleParent.js.map +1 -0
  274. package/lib/module/app/screens/SelectBank.js +220 -0
  275. package/lib/module/app/screens/SelectBank.js.map +1 -0
  276. package/lib/module/app/screens/SelectBusiness.js +497 -93
  277. package/lib/module/app/screens/SelectBusiness.js.map +1 -1
  278. package/lib/module/app/screens/Splash.js +93 -20
  279. package/lib/module/app/screens/Splash.js.map +1 -1
  280. package/lib/module/app/screens/StockChild.js +362 -0
  281. package/lib/module/app/screens/StockChild.js.map +1 -0
  282. package/lib/module/app/screens/StockDetail.js +705 -0
  283. package/lib/module/app/screens/StockDetail.js.map +1 -0
  284. package/lib/module/app/screens/StockParent.js +260 -0
  285. package/lib/module/app/screens/StockParent.js.map +1 -0
  286. package/lib/module/app/screens/StockReport.js +1031 -0
  287. package/lib/module/app/screens/StockReport.js.map +1 -0
  288. package/lib/module/app/screens/StockValue.js +545 -0
  289. package/lib/module/app/screens/StockValue.js.map +1 -0
  290. package/lib/module/app/screens/Suppliers.js +753 -98
  291. package/lib/module/app/screens/Suppliers.js.map +1 -1
  292. package/lib/module/app/screens/TransactionDetails.js +1169 -81
  293. package/lib/module/app/screens/TransactionDetails.js.map +1 -1
  294. package/lib/module/app/screens/UpdateBusiness.js +707 -0
  295. package/lib/module/app/screens/UpdateBusiness.js.map +1 -0
  296. package/lib/module/app/screens/VisionCamera.js +60 -0
  297. package/lib/module/app/screens/VisionCamera.js.map +1 -0
  298. package/lib/module/app/screens/index.js +46 -1
  299. package/lib/module/app/screens/index.js.map +1 -1
  300. package/lib/module/app/screens/new.html +171 -0
  301. package/lib/module/app/themes/config.js +299 -30
  302. package/lib/module/app/themes/config.js.map +1 -1
  303. package/lib/module/app/utils/city.json +7265 -0
  304. package/lib/typescript/eslint.config.d.mts +1 -1
  305. package/lib/typescript/src/App.d.ts.map +1 -1
  306. package/lib/typescript/src/app/api/api.d.ts +10 -0
  307. package/lib/typescript/src/app/api/api.d.ts.map +1 -0
  308. package/lib/typescript/src/app/components/AccountSetupSteps.d.ts +3 -0
  309. package/lib/typescript/src/app/components/AccountSetupSteps.d.ts.map +1 -0
  310. package/lib/typescript/src/app/components/AddItemBillParent.d.ts +5 -0
  311. package/lib/typescript/src/app/components/AddItemBillParent.d.ts.map +1 -0
  312. package/lib/typescript/src/app/components/AdditemBillChild.d.ts +6 -0
  313. package/lib/typescript/src/app/components/AdditemBillChild.d.ts.map +1 -0
  314. package/lib/typescript/src/app/components/Balance.d.ts +3 -1
  315. package/lib/typescript/src/app/components/Balance.d.ts.map +1 -1
  316. package/lib/typescript/src/app/components/BillList.d.ts +5 -0
  317. package/lib/typescript/src/app/components/BillList.d.ts.map +1 -0
  318. package/lib/typescript/src/app/components/BillSetupSteps.d.ts +3 -0
  319. package/lib/typescript/src/app/components/BillSetupSteps.d.ts.map +1 -0
  320. package/lib/typescript/src/app/components/BottomView.d.ts +6 -0
  321. package/lib/typescript/src/app/components/BottomView.d.ts.map +1 -0
  322. package/lib/typescript/src/app/components/BusinessCards/Card1.d.ts +14 -0
  323. package/lib/typescript/src/app/components/BusinessCards/Card1.d.ts.map +1 -0
  324. package/lib/typescript/src/app/components/BusinessCards/Card10.d.ts +14 -0
  325. package/lib/typescript/src/app/components/BusinessCards/Card10.d.ts.map +1 -0
  326. package/lib/typescript/src/app/components/BusinessCards/Card2.d.ts +14 -0
  327. package/lib/typescript/src/app/components/BusinessCards/Card2.d.ts.map +1 -0
  328. package/lib/typescript/src/app/components/BusinessCards/Card3.d.ts +14 -0
  329. package/lib/typescript/src/app/components/BusinessCards/Card3.d.ts.map +1 -0
  330. package/lib/typescript/src/app/components/BusinessCards/Card4.d.ts +14 -0
  331. package/lib/typescript/src/app/components/BusinessCards/Card4.d.ts.map +1 -0
  332. package/lib/typescript/src/app/components/BusinessCards/Card5.d.ts +14 -0
  333. package/lib/typescript/src/app/components/BusinessCards/Card5.d.ts.map +1 -0
  334. package/lib/typescript/src/app/components/BusinessCards/Card6.d.ts +14 -0
  335. package/lib/typescript/src/app/components/BusinessCards/Card6.d.ts.map +1 -0
  336. package/lib/typescript/src/app/components/BusinessCards/Card7.d.ts +14 -0
  337. package/lib/typescript/src/app/components/BusinessCards/Card7.d.ts.map +1 -0
  338. package/lib/typescript/src/app/components/BusinessCards/Card8.d.ts +14 -0
  339. package/lib/typescript/src/app/components/BusinessCards/Card8.d.ts.map +1 -0
  340. package/lib/typescript/src/app/components/BusinessCards/Card9.d.ts +14 -0
  341. package/lib/typescript/src/app/components/BusinessCards/Card9.d.ts.map +1 -0
  342. package/lib/typescript/src/app/components/BusinessCards/index.d.ts +11 -0
  343. package/lib/typescript/src/app/components/BusinessCards/index.d.ts.map +1 -0
  344. package/lib/typescript/src/app/components/CashEntryComponent.d.ts +8 -0
  345. package/lib/typescript/src/app/components/CashEntryComponent.d.ts.map +1 -0
  346. package/lib/typescript/src/app/components/CityModal.d.ts +7 -0
  347. package/lib/typescript/src/app/components/CityModal.d.ts.map +1 -0
  348. package/lib/typescript/src/app/components/CountryPhoneInput.d.ts +4 -1
  349. package/lib/typescript/src/app/components/CountryPhoneInput.d.ts.map +1 -1
  350. package/lib/typescript/src/app/components/CreateExpenseAccount.d.ts +9 -0
  351. package/lib/typescript/src/app/components/CreateExpenseAccount.d.ts.map +1 -0
  352. package/lib/typescript/src/app/components/CustomStatusBar.d.ts +3 -0
  353. package/lib/typescript/src/app/components/CustomStatusBar.d.ts.map +1 -0
  354. package/lib/typescript/src/app/components/CustomToast.d.ts +10 -0
  355. package/lib/typescript/src/app/components/CustomToast.d.ts.map +1 -0
  356. package/lib/typescript/src/app/components/DeleteBusinessModal.d.ts +8 -0
  357. package/lib/typescript/src/app/components/DeleteBusinessModal.d.ts.map +1 -0
  358. package/lib/typescript/src/app/components/DiscountTaxModal.d.ts +9 -0
  359. package/lib/typescript/src/app/components/DiscountTaxModal.d.ts.map +1 -0
  360. package/lib/typescript/src/app/components/Entries.d.ts.map +1 -1
  361. package/lib/typescript/src/app/components/ExpenseList.d.ts +6 -0
  362. package/lib/typescript/src/app/components/ExpenseList.d.ts.map +1 -0
  363. package/lib/typescript/src/app/components/ExpenseParent.d.ts +4 -0
  364. package/lib/typescript/src/app/components/ExpenseParent.d.ts.map +1 -0
  365. package/lib/typescript/src/app/components/FloatingInput.d.ts +18 -0
  366. package/lib/typescript/src/app/components/FloatingInput.d.ts.map +1 -0
  367. package/lib/typescript/src/app/components/Header.d.ts +11 -0
  368. package/lib/typescript/src/app/components/Header.d.ts.map +1 -0
  369. package/lib/typescript/src/app/components/Loader.d.ts +5 -0
  370. package/lib/typescript/src/app/components/Loader.d.ts.map +1 -0
  371. package/lib/typescript/src/app/components/PartyModal.d.ts +7 -0
  372. package/lib/typescript/src/app/components/PartyModal.d.ts.map +1 -0
  373. package/lib/typescript/src/app/components/PickerModal.d.ts +8 -0
  374. package/lib/typescript/src/app/components/PickerModal.d.ts.map +1 -0
  375. package/lib/typescript/src/app/components/SalePaymentModal.d.ts +15 -0
  376. package/lib/typescript/src/app/components/SalePaymentModal.d.ts.map +1 -0
  377. package/lib/typescript/src/app/components/SearchBar.d.ts +2 -4
  378. package/lib/typescript/src/app/components/SearchBar.d.ts.map +1 -1
  379. package/lib/typescript/src/app/components/StockDetailChild.d.ts +5 -0
  380. package/lib/typescript/src/app/components/StockDetailChild.d.ts.map +1 -0
  381. package/lib/typescript/src/app/components/StockList.d.ts +6 -0
  382. package/lib/typescript/src/app/components/StockList.d.ts.map +1 -0
  383. package/lib/typescript/src/app/components/StockReportTransaction.d.ts +18 -0
  384. package/lib/typescript/src/app/components/StockReportTransaction.d.ts.map +1 -0
  385. package/lib/typescript/src/app/components/Transaction.d.ts +9 -2
  386. package/lib/typescript/src/app/components/Transaction.d.ts.map +1 -1
  387. package/lib/typescript/src/app/components/User.d.ts +3 -1
  388. package/lib/typescript/src/app/components/User.d.ts.map +1 -1
  389. package/lib/typescript/src/app/components/index.d.ts +26 -7
  390. package/lib/typescript/src/app/components/index.d.ts.map +1 -1
  391. package/lib/typescript/src/app/database/bill.d.ts +7 -0
  392. package/lib/typescript/src/app/database/bill.d.ts.map +1 -0
  393. package/lib/typescript/src/app/database/business.d.ts +9 -0
  394. package/lib/typescript/src/app/database/business.d.ts.map +1 -0
  395. package/lib/typescript/src/app/database/cash.d.ts +14 -0
  396. package/lib/typescript/src/app/database/cash.d.ts.map +1 -0
  397. package/lib/typescript/src/app/database/clients.d.ts +36 -5
  398. package/lib/typescript/src/app/database/clients.d.ts.map +1 -1
  399. package/lib/typescript/src/app/database/expense.d.ts +12 -0
  400. package/lib/typescript/src/app/database/expense.d.ts.map +1 -0
  401. package/lib/typescript/src/app/database/schema.d.ts.map +1 -1
  402. package/lib/typescript/src/app/database/stock.d.ts +16 -0
  403. package/lib/typescript/src/app/database/stock.d.ts.map +1 -0
  404. package/lib/typescript/src/app/htmlTemplates/htmlTemplates.d.ts +29 -0
  405. package/lib/typescript/src/app/htmlTemplates/htmlTemplates.d.ts.map +1 -0
  406. package/lib/typescript/src/app/navigation/BillStack/BillStack.d.ts +2 -0
  407. package/lib/typescript/src/app/navigation/BillStack/BillStack.d.ts.map +1 -0
  408. package/lib/typescript/src/app/navigation/BottomTabs/BottomTabs.d.ts.map +1 -1
  409. package/lib/typescript/src/app/navigation/BusinessStack/BusinessStack.d.ts +2 -0
  410. package/lib/typescript/src/app/navigation/BusinessStack/BusinessStack.d.ts.map +1 -0
  411. package/lib/typescript/src/app/navigation/CashStack/CashStack.d.ts +2 -0
  412. package/lib/typescript/src/app/navigation/CashStack/CashStack.d.ts.map +1 -0
  413. package/lib/typescript/src/app/navigation/EntriesStack/EntriesStack.d.ts +2 -0
  414. package/lib/typescript/src/app/navigation/EntriesStack/EntriesStack.d.ts.map +1 -0
  415. package/lib/typescript/src/app/navigation/ExpenseStack.js/ExpenseStack.d.ts +2 -0
  416. package/lib/typescript/src/app/navigation/ExpenseStack.js/ExpenseStack.d.ts.map +1 -0
  417. package/lib/typescript/src/app/navigation/HomeStack/HomeStack.d.ts.map +1 -1
  418. package/lib/typescript/src/app/navigation/Root.d.ts.map +1 -1
  419. package/lib/typescript/src/app/navigation/SaleStack/SaleStack.d.ts +2 -0
  420. package/lib/typescript/src/app/navigation/SaleStack/SaleStack.d.ts.map +1 -0
  421. package/lib/typescript/src/app/navigation/StockStack/StockStack.d.ts +2 -0
  422. package/lib/typescript/src/app/navigation/StockStack/StockStack.d.ts.map +1 -0
  423. package/lib/typescript/src/app/navigation/index.d.ts +3 -1
  424. package/lib/typescript/src/app/navigation/index.d.ts.map +1 -1
  425. package/lib/typescript/src/app/redux/Store.d.ts.map +1 -1
  426. package/lib/typescript/src/app/redux/reducers/client/client_reducers.d.ts.map +1 -1
  427. package/lib/typescript/src/app/redux/reducers/client/client_types.d.ts +5 -0
  428. package/lib/typescript/src/app/redux/reducers/client/client_types.d.ts.map +1 -1
  429. package/lib/typescript/src/app/redux/reducers/user/user_reducers.d.ts +3 -0
  430. package/lib/typescript/src/app/redux/reducers/user/user_reducers.d.ts.map +1 -0
  431. package/lib/typescript/src/app/redux/reducers/user/user_types.d.ts +4 -0
  432. package/lib/typescript/src/app/redux/reducers/user/user_types.d.ts.map +1 -0
  433. package/lib/typescript/src/app/screens/AddBank.d.ts +5 -0
  434. package/lib/typescript/src/app/screens/AddBank.d.ts.map +1 -0
  435. package/lib/typescript/src/app/screens/AddBusiness.d.ts +4 -0
  436. package/lib/typescript/src/app/screens/AddBusiness.d.ts.map +1 -0
  437. package/lib/typescript/src/app/screens/AddItems.d.ts +5 -0
  438. package/lib/typescript/src/app/screens/AddItems.d.ts.map +1 -0
  439. package/lib/typescript/src/app/screens/AddScreen.d.ts.map +1 -1
  440. package/lib/typescript/src/app/screens/All.d.ts +2 -0
  441. package/lib/typescript/src/app/screens/All.d.ts.map +1 -0
  442. package/lib/typescript/src/app/screens/AllTransactions.d.ts +5 -0
  443. package/lib/typescript/src/app/screens/AllTransactions.d.ts.map +1 -0
  444. package/lib/typescript/src/app/screens/Banks.d.ts.map +1 -1
  445. package/lib/typescript/src/app/screens/BillDetails.d.ts +6 -0
  446. package/lib/typescript/src/app/screens/BillDetails.d.ts.map +1 -0
  447. package/lib/typescript/src/app/screens/BillHome.d.ts +5 -0
  448. package/lib/typescript/src/app/screens/BillHome.d.ts.map +1 -0
  449. package/lib/typescript/src/app/screens/BillParent.d.ts +5 -0
  450. package/lib/typescript/src/app/screens/BillParent.d.ts.map +1 -0
  451. package/lib/typescript/src/app/screens/BusinessDetail.d.ts +4 -0
  452. package/lib/typescript/src/app/screens/BusinessDetail.d.ts.map +1 -0
  453. package/lib/typescript/src/app/screens/CashEntry.d.ts +5 -0
  454. package/lib/typescript/src/app/screens/CashEntry.d.ts.map +1 -0
  455. package/lib/typescript/src/app/screens/CashEntryDetails.d.ts +5 -0
  456. package/lib/typescript/src/app/screens/CashEntryDetails.d.ts.map +1 -0
  457. package/lib/typescript/src/app/screens/CashHome.d.ts +4 -0
  458. package/lib/typescript/src/app/screens/CashHome.d.ts.map +1 -0
  459. package/lib/typescript/src/app/screens/CashReport.d.ts +4 -0
  460. package/lib/typescript/src/app/screens/CashReport.d.ts.map +1 -0
  461. package/lib/typescript/src/app/screens/CashSummary.d.ts +5 -0
  462. package/lib/typescript/src/app/screens/CashSummary.d.ts.map +1 -0
  463. package/lib/typescript/src/app/screens/CreateBill.d.ts +5 -0
  464. package/lib/typescript/src/app/screens/CreateBill.d.ts.map +1 -0
  465. package/lib/typescript/src/app/screens/CustomerEntries.d.ts.map +1 -1
  466. package/lib/typescript/src/app/screens/Customers.d.ts +1 -3
  467. package/lib/typescript/src/app/screens/Customers.d.ts.map +1 -1
  468. package/lib/typescript/src/app/screens/EditCategory.d.ts +4 -0
  469. package/lib/typescript/src/app/screens/EditCategory.d.ts.map +1 -0
  470. package/lib/typescript/src/app/screens/EditCategoryStock.d.ts +4 -0
  471. package/lib/typescript/src/app/screens/EditCategoryStock.d.ts.map +1 -0
  472. package/lib/typescript/src/app/screens/Entry.d.ts.map +1 -1
  473. package/lib/typescript/src/app/screens/ExpenseDetail.d.ts +3 -0
  474. package/lib/typescript/src/app/screens/ExpenseDetail.d.ts.map +1 -0
  475. package/lib/typescript/src/app/screens/ExpenseEntries.d.ts +5 -0
  476. package/lib/typescript/src/app/screens/ExpenseEntries.d.ts.map +1 -0
  477. package/lib/typescript/src/app/screens/ExpenseEntry.d.ts +5 -0
  478. package/lib/typescript/src/app/screens/ExpenseEntry.d.ts.map +1 -0
  479. package/lib/typescript/src/app/screens/ExpenseEntryDetails.d.ts +5 -0
  480. package/lib/typescript/src/app/screens/ExpenseEntryDetails.d.ts.map +1 -0
  481. package/lib/typescript/src/app/screens/ExpenseEntryReport.d.ts +5 -0
  482. package/lib/typescript/src/app/screens/ExpenseEntryReport.d.ts.map +1 -0
  483. package/lib/typescript/src/app/screens/ExpenseReport.d.ts +5 -0
  484. package/lib/typescript/src/app/screens/ExpenseReport.d.ts.map +1 -0
  485. package/lib/typescript/src/app/screens/Geolocation.d.ts +5 -0
  486. package/lib/typescript/src/app/screens/Geolocation.d.ts.map +1 -0
  487. package/lib/typescript/src/app/screens/GetStarted.d.ts +4 -0
  488. package/lib/typescript/src/app/screens/GetStarted.d.ts.map +1 -0
  489. package/lib/typescript/src/app/screens/HomeScreen.d.ts.map +1 -1
  490. package/lib/typescript/src/app/screens/InBuy.d.ts +5 -0
  491. package/lib/typescript/src/app/screens/InBuy.d.ts.map +1 -0
  492. package/lib/typescript/src/app/screens/ItemEntryDetails.d.ts +5 -0
  493. package/lib/typescript/src/app/screens/ItemEntryDetails.d.ts.map +1 -0
  494. package/lib/typescript/src/app/screens/LowStock.d.ts +4 -0
  495. package/lib/typescript/src/app/screens/LowStock.d.ts.map +1 -0
  496. package/lib/typescript/src/app/screens/NewPin.d.ts +5 -0
  497. package/lib/typescript/src/app/screens/NewPin.d.ts.map +1 -0
  498. package/lib/typescript/src/app/screens/OutSell.d.ts +6 -0
  499. package/lib/typescript/src/app/screens/OutSell.d.ts.map +1 -0
  500. package/lib/typescript/src/app/screens/POSSale.d.ts +9 -0
  501. package/lib/typescript/src/app/screens/POSSale.d.ts.map +1 -0
  502. package/lib/typescript/src/app/screens/PinScreen.d.ts +5 -0
  503. package/lib/typescript/src/app/screens/PinScreen.d.ts.map +1 -0
  504. package/lib/typescript/src/app/screens/PreviewBill.d.ts +5 -0
  505. package/lib/typescript/src/app/screens/PreviewBill.d.ts.map +1 -0
  506. package/lib/typescript/src/app/screens/Profile.d.ts +5 -0
  507. package/lib/typescript/src/app/screens/Profile.d.ts.map +1 -0
  508. package/lib/typescript/src/app/screens/RateList.d.ts +5 -0
  509. package/lib/typescript/src/app/screens/RateList.d.ts.map +1 -0
  510. package/lib/typescript/src/app/screens/Report.d.ts +5 -0
  511. package/lib/typescript/src/app/screens/Report.d.ts.map +1 -0
  512. package/lib/typescript/src/app/screens/SaleItemDetail.d.ts +6 -0
  513. package/lib/typescript/src/app/screens/SaleItemDetail.d.ts.map +1 -0
  514. package/lib/typescript/src/app/screens/SaleParent.d.ts +2 -0
  515. package/lib/typescript/src/app/screens/SaleParent.d.ts.map +1 -0
  516. package/lib/typescript/src/app/screens/SelectBank.d.ts +4 -0
  517. package/lib/typescript/src/app/screens/SelectBank.d.ts.map +1 -0
  518. package/lib/typescript/src/app/screens/SelectBusiness.d.ts.map +1 -1
  519. package/lib/typescript/src/app/screens/Splash.d.ts.map +1 -1
  520. package/lib/typescript/src/app/screens/StockChild.d.ts +7 -0
  521. package/lib/typescript/src/app/screens/StockChild.d.ts.map +1 -0
  522. package/lib/typescript/src/app/screens/StockDetail.d.ts +5 -0
  523. package/lib/typescript/src/app/screens/StockDetail.d.ts.map +1 -0
  524. package/lib/typescript/src/app/screens/StockParent.d.ts +2 -0
  525. package/lib/typescript/src/app/screens/StockParent.d.ts.map +1 -0
  526. package/lib/typescript/src/app/screens/StockReport.d.ts +5 -0
  527. package/lib/typescript/src/app/screens/StockReport.d.ts.map +1 -0
  528. package/lib/typescript/src/app/screens/StockValue.d.ts +5 -0
  529. package/lib/typescript/src/app/screens/StockValue.d.ts.map +1 -0
  530. package/lib/typescript/src/app/screens/Suppliers.d.ts +1 -3
  531. package/lib/typescript/src/app/screens/Suppliers.d.ts.map +1 -1
  532. package/lib/typescript/src/app/screens/TransactionDetails.d.ts.map +1 -1
  533. package/lib/typescript/src/app/screens/UpdateBusiness.d.ts +5 -0
  534. package/lib/typescript/src/app/screens/UpdateBusiness.d.ts.map +1 -0
  535. package/lib/typescript/src/app/screens/VisionCamera.d.ts +2 -0
  536. package/lib/typescript/src/app/screens/VisionCamera.d.ts.map +1 -0
  537. package/lib/typescript/src/app/screens/index.d.ts +56 -11
  538. package/lib/typescript/src/app/screens/index.d.ts.map +1 -1
  539. package/lib/typescript/src/app/themes/config.d.ts +60 -8
  540. package/lib/typescript/src/app/themes/config.d.ts.map +1 -1
  541. package/package.json +6 -2
  542. package/src/App.js +30 -34
  543. package/src/app/api/api.js +11 -0
  544. package/src/app/assets/Icons/Bill.png +0 -0
  545. package/src/app/assets/Icons/Bill_Grey.png +0 -0
  546. package/src/app/assets/Icons/Cash.png +0 -0
  547. package/src/app/assets/Icons/Cash_Grey.png +0 -0
  548. package/src/app/assets/Icons/Expense.png +0 -0
  549. package/src/app/assets/Icons/Expense_Grey.png +0 -0
  550. package/src/app/assets/Icons/Staff.png +0 -0
  551. package/src/app/assets/Icons/Stock.png +0 -0
  552. package/src/app/assets/Icons/Stock_Grey.png +0 -0
  553. package/src/app/assets/Icons/abc.png +0 -0
  554. package/src/app/assets/Icons/bank_logo.png +0 -0
  555. package/src/app/assets/Icons/download_sale.png +0 -0
  556. package/src/app/assets/Icons/recycle-bin.png +0 -0
  557. package/src/app/assets/animations/recording.json +1 -0
  558. package/src/app/assets/animations/success.json +1 -0
  559. package/src/app/assets/animations/voice_visualization.json +1 -0
  560. package/src/app/assets/businessCards/card_11.png +0 -0
  561. package/src/app/assets/businessCards/card_12_bg.png +0 -0
  562. package/src/app/assets/businessCards/card_wall_01.jpeg +0 -0
  563. package/src/app/assets/businessCards/card_wall_02.jpeg +0 -0
  564. package/src/app/assets/businessCards/card_wall_03.jpeg +0 -0
  565. package/src/app/assets/businessCards/card_wall_04.jpeg +0 -0
  566. package/src/app/assets/businessCards/card_wall_05.jpeg +0 -0
  567. package/src/app/assets/businessCards/card_wall_06.jpeg +0 -0
  568. package/src/app/assets/businessCards/card_wall_07.jpeg +0 -0
  569. package/src/app/assets/businessCards/card_wall_08.jpeg +0 -0
  570. package/src/app/assets/illustrations/empty.png +0 -0
  571. package/src/app/assets/illustrations/packages.png +0 -0
  572. package/src/app/assets/images/Digikhata_idzarHgH0q_0.png +0 -0
  573. package/src/app/assets/images/bank.png +0 -0
  574. package/src/app/assets/images/digiLogo-main.png +0 -0
  575. package/src/app/assets/images/svgviewer-output.svg +57 -0
  576. package/src/app/assets/images/user.png +0 -0
  577. package/src/app/assets/oldIcons/BILL.svg +3 -0
  578. package/src/app/assets/oldIcons/CASH.svg +4 -0
  579. package/src/app/assets/oldIcons/EXPENSE.svg +6 -0
  580. package/src/app/assets/oldIcons/STAFF.svg +3 -0
  581. package/src/app/assets/oldIcons/Sale Active.svg +14 -0
  582. package/src/app/assets/oldIcons/Stock.svg +5 -0
  583. package/src/app/assets/svg/BILL.svg +4 -0
  584. package/src/app/assets/svg/CASH.svg +6 -0
  585. package/src/app/assets/svg/EXPENSE.svg +5 -0
  586. package/src/app/assets/svg/More Icon.svg +6 -0
  587. package/src/app/assets/svg/Payment Icon.svg +4 -0
  588. package/src/app/assets/svg/Pos.svg +13 -0
  589. package/src/app/assets/svg/STAFF.svg +5 -0
  590. package/src/app/assets/svg/Sale Active.svg +8 -0
  591. package/src/app/assets/svg/Sale Icon.svg +3 -0
  592. package/src/app/assets/svg/Stock.svg +5 -0
  593. package/src/app/components/AccountSetupSteps.js +58 -0
  594. package/src/app/components/AddItemBillParent.js +373 -0
  595. package/src/app/components/AdditemBillChild.js +1257 -0
  596. package/src/app/components/Balance.js +211 -114
  597. package/src/app/components/BillList.js +548 -0
  598. package/src/app/components/BillSetupSteps.js +56 -0
  599. package/src/app/components/BottomView.js +39 -0
  600. package/src/app/components/BusinessCards/Card1.js +160 -0
  601. package/src/app/components/BusinessCards/Card10.js +209 -0
  602. package/src/app/components/BusinessCards/Card2.js +148 -0
  603. package/src/app/components/BusinessCards/Card3.js +147 -0
  604. package/src/app/components/BusinessCards/Card4.js +147 -0
  605. package/src/app/components/BusinessCards/Card5.js +151 -0
  606. package/src/app/components/BusinessCards/Card6.js +157 -0
  607. package/src/app/components/BusinessCards/Card7.js +146 -0
  608. package/src/app/components/BusinessCards/Card8.js +170 -0
  609. package/src/app/components/BusinessCards/Card9.js +209 -0
  610. package/src/app/components/BusinessCards/index.js +10 -0
  611. package/src/app/components/CashEntryComponent.js +297 -0
  612. package/src/app/components/CityModal.js +117 -0
  613. package/src/app/components/CountryPhoneInput.js +373 -267
  614. package/src/app/components/CreateExpenseAccount.js +141 -0
  615. package/src/app/components/CustomStatusBar.js +33 -0
  616. package/src/app/components/CustomToast.js +143 -0
  617. package/src/app/components/DeleteBusinessModal.js +196 -0
  618. package/src/app/components/DiscountTaxModal.js +256 -0
  619. package/src/app/components/Entries.js +87 -67
  620. package/src/app/components/ExpenseList.js +507 -0
  621. package/src/app/components/ExpenseParent.js +446 -0
  622. package/src/app/components/FloatingInput.js +188 -0
  623. package/src/app/components/Header.js +121 -0
  624. package/src/app/components/Loader.js +35 -0
  625. package/src/app/components/PartyModal.js +213 -0
  626. package/src/app/components/PickerModal.js +176 -0
  627. package/src/app/components/SalePaymentModal.js +822 -0
  628. package/src/app/components/SearchBar.js +225 -47
  629. package/src/app/components/StockDetailChild.js +461 -0
  630. package/src/app/components/StockList.js +582 -0
  631. package/src/app/components/StockReportTransaction.js +192 -0
  632. package/src/app/components/Transaction.js +277 -86
  633. package/src/app/components/User.js +188 -80
  634. package/src/app/components/index.js +51 -13
  635. package/src/app/database/bill.js +305 -0
  636. package/src/app/database/business.js +499 -0
  637. package/src/app/database/cash.js +451 -0
  638. package/src/app/database/clients.js +1536 -43
  639. package/src/app/database/expense.js +439 -0
  640. package/src/app/database/schema.js +115 -4
  641. package/src/app/database/stock.js +724 -0
  642. package/src/app/htmlTemplates/htmlTemplates.js +2603 -0
  643. package/src/app/navigation/BillStack/BillStack.js +38 -0
  644. package/src/app/navigation/BottomTabs/BottomTabs.js +24 -19
  645. package/src/app/navigation/BusinessStack/BusinessStack.js +27 -0
  646. package/src/app/navigation/CashStack/CashStack.js +59 -0
  647. package/src/app/navigation/EntriesStack/EntriesStack.js +186 -0
  648. package/src/app/navigation/ExpenseStack.js/ExpenseStack.js +50 -0
  649. package/src/app/navigation/HomeStack/HomeStack.js +106 -39
  650. package/src/app/navigation/Root.js +16 -1
  651. package/src/app/navigation/SaleStack/SaleStack.js +62 -0
  652. package/src/app/navigation/StockStack/StockStack.js +48 -0
  653. package/src/app/navigation/index.js +5 -1
  654. package/src/app/redux/Store.js +2 -0
  655. package/src/app/redux/reducers/client/client_reducers.js +31 -2
  656. package/src/app/redux/reducers/client/client_types.js +8 -1
  657. package/src/app/redux/reducers/user/user_reducers.js +24 -0
  658. package/src/app/redux/reducers/user/user_types.js +3 -0
  659. package/src/app/screens/AddBank.js +353 -0
  660. package/src/app/screens/AddBusiness.js +1161 -0
  661. package/src/app/screens/AddItems.js +515 -0
  662. package/src/app/screens/AddScreen.js +525 -165
  663. package/src/app/screens/All.js +1074 -0
  664. package/src/app/screens/AllTransactions.js +1138 -0
  665. package/src/app/screens/Banks.js +1134 -133
  666. package/src/app/screens/BillDetails.js +989 -0
  667. package/src/app/screens/BillHome.js +97 -0
  668. package/src/app/screens/BillParent.js +419 -0
  669. package/src/app/screens/BusinessDetail.js +939 -0
  670. package/src/app/screens/CashEntry.js +2913 -0
  671. package/src/app/screens/CashEntryDetails.js +650 -0
  672. package/src/app/screens/CashHome.js +594 -0
  673. package/src/app/screens/CashReport.js +1658 -0
  674. package/src/app/screens/CashSummary.js +607 -0
  675. package/src/app/screens/CreateBill.js +2504 -0
  676. package/src/app/screens/CustomerEntries.js +1578 -350
  677. package/src/app/screens/Customers.js +1066 -213
  678. package/src/app/screens/EditCategory.js +316 -0
  679. package/src/app/screens/EditCategoryStock.js +320 -0
  680. package/src/app/screens/Entry.js +2555 -585
  681. package/src/app/screens/ExpenseDetail.js +14 -0
  682. package/src/app/screens/ExpenseEntries.js +837 -0
  683. package/src/app/screens/ExpenseEntry.js +2478 -0
  684. package/src/app/screens/ExpenseEntryDetails.js +612 -0
  685. package/src/app/screens/ExpenseEntryReport.js +1059 -0
  686. package/src/app/screens/ExpenseReport.js +1071 -0
  687. package/src/app/screens/Geolocation.js +435 -0
  688. package/src/app/screens/GetStarted.js +201 -0
  689. package/src/app/screens/HomeScreen.js +368 -132
  690. package/src/app/screens/InBuy.js +918 -0
  691. package/src/app/screens/ItemEntryDetails.js +582 -0
  692. package/src/app/screens/LowStock.js +417 -0
  693. package/src/app/screens/NewPin.js +225 -0
  694. package/src/app/screens/OutSell.js +2153 -0
  695. package/src/app/screens/POSSale.js +639 -0
  696. package/src/app/screens/PinScreen.js +720 -0
  697. package/src/app/screens/PreviewBill.js +302 -0
  698. package/src/app/screens/Profile.js +1594 -0
  699. package/src/app/screens/RateList.js +525 -0
  700. package/src/app/screens/Report.js +1401 -0
  701. package/src/app/screens/SaleItemDetail.js +1187 -0
  702. package/src/app/screens/SaleParent.js +345 -0
  703. package/src/app/screens/SelectBank.js +220 -0
  704. package/src/app/screens/SelectBusiness.js +670 -163
  705. package/src/app/screens/Splash.js +96 -15
  706. package/src/app/screens/StockChild.js +372 -0
  707. package/src/app/screens/StockDetail.js +758 -0
  708. package/src/app/screens/StockParent.js +287 -0
  709. package/src/app/screens/StockReport.js +1359 -0
  710. package/src/app/screens/StockValue.js +720 -0
  711. package/src/app/screens/Suppliers.js +1098 -205
  712. package/src/app/screens/TransactionDetails.js +1674 -180
  713. package/src/app/screens/UpdateBusiness.js +837 -0
  714. package/src/app/screens/VisionCamera.js +54 -0
  715. package/src/app/screens/index.js +111 -21
  716. package/src/app/screens/new.html +171 -0
  717. package/src/app/themes/config.js +431 -114
  718. package/src/app/utils/city.json +7265 -0
@@ -0,0 +1,2478 @@
1
+ import {
2
+ View,
3
+ Text,
4
+ StyleSheet,
5
+ TouchableOpacity,
6
+ TextInput,
7
+ Keyboard,
8
+ ScrollView,
9
+ Platform,
10
+ PermissionsAndroid,
11
+ Image,
12
+ Dimensions,
13
+ ActivityIndicator,
14
+ Alert,
15
+ StatusBar,
16
+ FlatList,
17
+ } from 'react-native';
18
+ import React, { useState, useEffect, useRef } from 'react';
19
+ import {
20
+ addCommas,
21
+ COLORS,
22
+ FONT_BOLD,
23
+ FONT_MEDIUM,
24
+ FONT_NORMAL,
25
+ HP,
26
+ isPdfFile,
27
+ mergeDateTime,
28
+ TEXT_SIZES,
29
+ toISOStringUTC,
30
+ WP,
31
+ formatDateTime,
32
+ formatMyDate,
33
+ fromJsDateToSql,
34
+ formatPhoneNumber,
35
+ Input_Field_SIZES,
36
+ getAvatar,
37
+ } from '../themes/config';
38
+ import LinearGradient from 'react-native-linear-gradient';
39
+ import Ionicons from 'react-native-vector-icons/Ionicons';
40
+ import DateTimePicker, {
41
+ DateTimePickerAndroid,
42
+ } from '@react-native-community/datetimepicker';
43
+ import {
44
+ addClient,
45
+ addTransaction,
46
+ addTransactionImages,
47
+ deleteTransactionImage,
48
+ deleteTransactionImagesByTrxId,
49
+ getClientDetails,
50
+ getClientsByType,
51
+ getClientTransactions,
52
+ updateTransaction,
53
+ updateTransactionImage,
54
+ } from '../database/clients';
55
+ import { useSelector } from 'react-redux';
56
+ import Modal from 'react-native-modal';
57
+ import { launchCamera, launchImageLibrary } from 'react-native-image-picker';
58
+ import { pick } from '@react-native-documents/picker';
59
+ import Sound, {
60
+ AudioEncoderAndroidType,
61
+ AudioSourceAndroidType,
62
+ AVEncoderAudioQualityIOSType,
63
+ AVEncodingOption,
64
+ RecordBackType,
65
+ PlayBackType,
66
+ createSound,
67
+ } from 'react-native-nitro-sound';
68
+ import LottieView from 'lottie-react-native';
69
+ import {
70
+ SafeAreaView,
71
+ SafeAreaProvider,
72
+ useSafeAreaInsets,
73
+ } from 'react-native-safe-area-context';
74
+ import { useDispatch } from 'react-redux';
75
+ import {
76
+ CLIENT_DETAILS,
77
+ STATUS_BAR_COLOR,
78
+ } from '../redux/reducers/client/client_types';
79
+ import { CountryPhoneInput, FloatingInput, Header, User } from '../components';
80
+ import Contacts from 'react-native-contacts';
81
+ import {
82
+ addCashCategory,
83
+ addCashEntry,
84
+ addCashImages,
85
+ deleteCashImagesByTrxId,
86
+ getCashCategories,
87
+ getCashCategoryById,
88
+ getCashRegisterEntries,
89
+ updateCashEntry,
90
+ } from '../database/cash';
91
+ import {
92
+ addExpenseImages,
93
+ addExpenseTransaction,
94
+ deleteExpenseImagesByExpenseId,
95
+ getExpenseCategoriesWithTotals,
96
+ getExpenseTransactions,
97
+ updateExpenseTransaction,
98
+ updateExpenseTransactionIsCash,
99
+ } from '../database/expense';
100
+
101
+ export default function ExpenseEntry({ navigation, route }) {
102
+ const animationRef = useRef(null);
103
+ const keyboardRef = useRef(null);
104
+ const insets = useSafeAreaInsets();
105
+ const dispatch = useDispatch();
106
+
107
+ const ClientDetails = useSelector((state) => state.client.client_details);
108
+ const selectBusiness = useSelector((state) => state.client.selected_business);
109
+ const clients = useSelector((state) => state.client.home_customers);
110
+ const suppliers = useSelector((state) => state.client.home_suppliers);
111
+
112
+ const eId = route?.params?.eId;
113
+ const entryId = route?.params?.entryId;
114
+
115
+ const type = route?.params?.type;
116
+ const id = route?.params?.id;
117
+ const previousDate = route?.params?.date;
118
+ const pay_type = route?.params?.pay_type;
119
+ const amount = route?.params?.amount;
120
+ const mainColor = type;
121
+
122
+ const [input, setInput] = useState('');
123
+ const [history, setHistory] = useState('');
124
+ const [result, setResult] = useState('0');
125
+ const [CalculatorErr, setCalculatorErr] = useState('');
126
+ const [HeaderValue, setHeaderValue] = useState('0');
127
+ const [memory, setMemory] = useState([]);
128
+ const [Notes, setNotes] = useState('');
129
+ const [date, setDate] = useState(new Date());
130
+ const [showPicker, setShowPicker] = useState(false);
131
+ const [showTimePicker, setShowTimePicker] = useState(false);
132
+ const [time, setTime] = useState(new Date());
133
+ const [MergedDate, setMergedDate] = useState('');
134
+ const [SuccessModal, setSuccessModal] = useState(false);
135
+ const [item, setItem] = useState(null);
136
+
137
+ const [isModalVisible, setIsModalVisible] = useState(false);
138
+ const [ChangeModal, setChangeModal] = useState(false);
139
+ const [SelectedParty, setSelectedParty] = useState(null);
140
+ const [Clients, setClients] = useState([]);
141
+ const [ShowNewBtn, setShowNewBtn] = useState(false);
142
+ const [contacts, setContacts] = useState([]);
143
+ const [Name, setName] = useState('');
144
+ const [clientPhoneSet, setClientPhoneSet] = useState(new Set());
145
+ const [clientPhoneMap, setClientPhoneMap] = useState(new Map());
146
+ const [searchText, setSearchText] = useState('');
147
+ const [PhoneNum, setPhoneNum] = useState('');
148
+ const [attachments, setAttachments] = useState([]);
149
+ const [keyboardVisible, setKeyboardVisible] = useState(false);
150
+ const [IsSoundModal, setIsSoundModal] = useState(false);
151
+ const [RecordingTime, setRecordingTime] = useState('');
152
+ const [IsPlaying, setIsPlaying] = useState(false);
153
+ const [AudioFile, setAudioFile] = useState('');
154
+ const [PlayLoading, setPlayLoading] = useState(false);
155
+ const [BillNo, setBillNo] = useState('');
156
+ const [ExpenseCategoryDetails, setExpenseCategoryDetails] = useState(null);
157
+ const [IsCash, setIsCash] = useState(false);
158
+
159
+ const addAttachment = (file) => {
160
+ if (attachments.length >= 3) {
161
+ alert('You can only attach up to 3 files.');
162
+ return;
163
+ }
164
+ setAttachments([...attachments, file]);
165
+ };
166
+
167
+ const handleGallery = async () => {
168
+ try {
169
+ const result = await launchImageLibrary({ mediaType: 'photo' });
170
+ if (result.assets && result.assets.length > 0) {
171
+ addAttachment({
172
+ type: 'image',
173
+ uri: result.assets[0].uri,
174
+ name: result.assets[0].fileName || 'gallery_image.jpg',
175
+ });
176
+ }
177
+ } catch (err) {
178
+ console.log('Gallery Error:', err);
179
+ }
180
+ setIsModalVisible(false);
181
+ };
182
+
183
+ const handleCamera = async () => {
184
+ try {
185
+ const granted = await PermissionsAndroid.request(
186
+ PermissionsAndroid.PERMISSIONS.CAMERA,
187
+ {
188
+ title: 'Camera Permission',
189
+ message: 'This app needs camera access to take photos',
190
+ buttonNeutral: 'Ask Me Later',
191
+ buttonNegative: 'Cancel',
192
+ buttonPositive: 'OK',
193
+ }
194
+ );
195
+
196
+ if (granted === PermissionsAndroid.RESULTS.GRANTED) {
197
+ const result = await launchCamera({ mediaType: 'photo' });
198
+ if (result.assets && result.assets.length > 0) {
199
+ addAttachment({
200
+ type: 'image',
201
+ uri: result.assets[0].uri,
202
+ name: result.assets[0].fileName || 'camera_image.jpg',
203
+ });
204
+ }
205
+ } else {
206
+ alert('Camera permission denied');
207
+ }
208
+ } catch (err) {
209
+ console.log('Camera Error:', err);
210
+ }
211
+ setIsModalVisible(false);
212
+ };
213
+
214
+ const handlePDF = async () => {
215
+ try {
216
+ const res = await pick({ type: ['application/pdf'] });
217
+ if (res && res.length > 0) {
218
+ addAttachment({
219
+ type: 'pdf',
220
+ uri: res[0].uri,
221
+ name: res[0].name || 'document.pdf',
222
+ });
223
+ }
224
+ } catch (err) {
225
+ if (err.message !== 'DOCUMENT_PICKER_CANCELED') {
226
+ console.log('PDF Error:', err);
227
+ }
228
+ }
229
+ setIsModalVisible(false);
230
+ };
231
+
232
+ const removeAttachment = (index) => {
233
+ setAttachments(attachments.filter((_, i) => i !== index));
234
+ };
235
+
236
+ const buttons = [
237
+ ['AC', 'M+', 'M-', 'MR'],
238
+ ['%', '÷', 'x', '-'],
239
+ ['7', '8', '9', '+'],
240
+ ['4', '5', '6', '='],
241
+ ['1', '2', '3', '⌫'],
242
+ ['0', '.'],
243
+ ];
244
+
245
+ const operators = ['+', '-', '*', '/', 'x', '÷', '%'];
246
+
247
+ const handlePress = (key) => {
248
+ const limit = 9;
249
+ const currHist = history || '';
250
+ const currInput = input || '';
251
+
252
+ // --- helpers ---
253
+ const roundTo3 = (num) => Math.round(num * 1000) / 1000;
254
+
255
+ const evaluateLeftToRight = (expr) => {
256
+ if (!expr) return 0;
257
+ expr = expr.replace(/x/g, '*').replace(/÷/g, '/').replace(/%/g, '/100');
258
+ const tokens = expr.match(/(\d+(\.\d+)?|[+\-*/])/g);
259
+ if (!tokens) return 0;
260
+
261
+ let result = parseFloat(tokens[0]);
262
+ for (let i = 1; i < tokens.length; i += 2) {
263
+ const op = tokens[i];
264
+ const num = parseFloat(tokens[i + 1]);
265
+ if (isNaN(num)) return null;
266
+ if (op === '+') result += num;
267
+ else if (op === '-') result -= num;
268
+ else if (op === '*') result *= num;
269
+ else if (op === '/') result /= num;
270
+ }
271
+ return roundTo3(result);
272
+ };
273
+
274
+ const isOperator = (ch) => operators.includes(ch);
275
+
276
+ const getLastNumber = (hist) => {
277
+ if (!hist) return '';
278
+ const parts = hist.split(/[\+\-\*\/x÷]/);
279
+ return parts[parts.length - 1] || '';
280
+ };
281
+
282
+ const setSafeValues = (resValue, newHist = null, inputVal = null) => {
283
+ if (resValue < 0) {
284
+ setCalculatorErr && setCalculatorErr('Invalid Amount');
285
+ return;
286
+ }
287
+ setResult(resValue.toString());
288
+ if (newHist !== null) setHistory(newHist);
289
+ if (inputVal !== null) setInput(inputVal);
290
+ setCalculatorErr && setCalculatorErr('');
291
+ };
292
+
293
+ // --- AC ---
294
+ if (key === 'AC') {
295
+ setInput('');
296
+ setHistory('');
297
+ setResult('0');
298
+ setMemory([])
299
+ setCalculatorErr && setCalculatorErr('');
300
+ return;
301
+ }
302
+
303
+ // --- BACKSPACE ---
304
+ if (key === '⌫') {
305
+ if (!currHist) return;
306
+ const newHist = currHist.slice(0, -1);
307
+ setHistory(newHist);
308
+
309
+ if (newHist && isOperator(newHist.slice(-1))) {
310
+ const beforeOp = newHist.slice(0, -1);
311
+ const res = evaluateLeftToRight(beforeOp);
312
+ const displayNum = !isNaN(res) ? res.toString() : getLastNumber(newHist) || '';
313
+ setSafeValues(res, newHist, displayNum + newHist.slice(-1));
314
+ } else {
315
+ const last = getLastNumber(newHist);
316
+ const res = newHist && !isOperator(newHist.slice(-1)) ? evaluateLeftToRight(newHist) : 0;
317
+ setSafeValues(res, newHist, last);
318
+ }
319
+ return;
320
+ }
321
+
322
+ // --- EQUAL ---
323
+ if (key === '=') {
324
+ if (!currHist) return;
325
+ let exprToEval = currHist.endsWith('=') ? currHist.slice(0, -1) : currHist;
326
+ if (exprToEval && isOperator(exprToEval.slice(-1))) {
327
+ exprToEval = exprToEval.slice(0, -1);
328
+ }
329
+ if (!exprToEval) return;
330
+ const res = evaluateLeftToRight(exprToEval);
331
+ if (res === null || isNaN(res)) {
332
+ setInput('');
333
+ setHistory('');
334
+ setResult('Error');
335
+ } else {
336
+ setSafeValues(res, exprToEval + '=', res.toString());
337
+ }
338
+ return;
339
+ }
340
+
341
+ // --- OPERATOR ---
342
+ if (isOperator(key)) {
343
+ if (!currHist && !currInput) return;
344
+
345
+ // --- Handle after '=' ---
346
+ if (currHist.endsWith('=')) {
347
+ const base = currInput || currHist.slice(0, -1);
348
+ if (typeof checkMaxValue === 'function' && checkMaxValue(base)) return;
349
+
350
+ const newHist = base + key;
351
+ const res = evaluateLeftToRight(base);
352
+ setSafeValues(res, newHist, base + key);
353
+ return;
354
+ }
355
+
356
+ // --- Replace operator ---
357
+ if (currHist && isOperator(currHist.slice(-1))) {
358
+ const newHist = currHist.slice(0, -1) + key;
359
+ const exprForRes = newHist.slice(0, -1);
360
+ const res = evaluateLeftToRight(exprForRes);
361
+ setSafeValues(res, newHist, (currInput && isOperator(currInput.slice(-1)) ? currInput.slice(0, -1) : res.toString()) + key);
362
+ return;
363
+ }
364
+
365
+ // --- Percentage ---
366
+ if (key === '%') {
367
+ const lastNum = getLastNumber(currHist);
368
+ if (!lastNum) return;
369
+ if (parseFloat(lastNum) < 1 && lastNum.includes('.')) return;
370
+
371
+ const percentValue = parseFloat(lastNum) / 100;
372
+ const newHist = currHist.slice(0, currHist.length - lastNum.length) + percentValue;
373
+ const res = evaluateLeftToRight(newHist);
374
+ setSafeValues(res, newHist, percentValue.toString());
375
+ return;
376
+ }
377
+
378
+ // --- Normal operator handling ---
379
+ const newHist = currHist + key;
380
+ const res = evaluateLeftToRight(currHist);
381
+ setSafeValues(res, newHist, res.toString() + key);
382
+ return;
383
+ }
384
+
385
+ // --- NUMBER / DOT ---
386
+ if (key === '.') {
387
+ const lastNum = getLastNumber(currHist);
388
+ if (!lastNum) return;
389
+ if (lastNum.includes('.')) return;
390
+ }
391
+
392
+ if (key === '0') {
393
+ const lastNum = getLastNumber(currHist);
394
+ if (!lastNum) return;
395
+ if (lastNum === '0') return;
396
+ }
397
+
398
+ if (key === 'M+' || key === 'M-') {
399
+
400
+ if (!currInput && (!result || result === '0')) return;
401
+
402
+ let exprToEval = currHist.endsWith('=') ? currHist.slice(0, -1) : currHist;
403
+
404
+ if (!exprToEval && currInput) {
405
+ exprToEval = currInput;
406
+ } else if (!exprToEval && result && result !== '0') {
407
+ exprToEval = result;
408
+ }
409
+
410
+ if (!exprToEval) return;
411
+
412
+ if (exprToEval && isOperator(exprToEval.slice(-1))) {
413
+ exprToEval = exprToEval.slice(0, -1);
414
+ }
415
+
416
+ const res = evaluateLeftToRight(exprToEval);
417
+ if (res === null || isNaN(res)) return;
418
+
419
+ const valueToStore = key === 'M+' ? res : -res;
420
+ setMemory(prev => [...prev, valueToStore]);
421
+ return;
422
+ }
423
+
424
+
425
+ const lastNum = getLastNumber(currHist);
426
+ if (lastNum.length >= limit) return;
427
+
428
+ const newHist = currHist + key;
429
+ const newLastNum = getLastNumber(newHist);
430
+ const res = evaluateLeftToRight(newHist);
431
+ setSafeValues(res, newHist, newLastNum.slice(0, limit));
432
+ };
433
+
434
+ const handleBackspace = () => {
435
+ const maxValue = 999999999;
436
+ const limit = 9;
437
+
438
+ const roundTo3 = (num) => Math.round(num * 1000) / 1000;
439
+
440
+ const evaluateLeftToRight = (expr) => {
441
+ expr = expr.replace(/x/g, '*').replace(/÷/g, '/').replace(/%/g, '/100');
442
+ const tokens = expr.match(/(\d+(\.\d+)?|[+\-*/])/g);
443
+ if (!tokens) return 0;
444
+
445
+ let result = parseFloat(tokens[0]);
446
+ for (let i = 1; i < tokens.length; i += 2) {
447
+ const op = tokens[i];
448
+ const num = parseFloat(tokens[i + 1]);
449
+ if (op === '+') result += num;
450
+ else if (op === '-') result -= num;
451
+ else if (op === '*') result *= num;
452
+ else if (op === '/') result /= num;
453
+ }
454
+
455
+ result = roundTo3(result);
456
+
457
+ if (result > maxValue) {
458
+ setCalculatorErr('Invalid Amount');
459
+ return null;
460
+ }
461
+ return result;
462
+ };
463
+
464
+ // current state
465
+ const currHist = history || '';
466
+ if (!currHist) return;
467
+
468
+ // 🔹 remove the last char from history
469
+ const newHist = currHist.slice(0, -1);
470
+
471
+ // 🔹 find last operator and rebuild current input segment
472
+ const lastOpIndex = Math.max(
473
+ newHist.lastIndexOf('+'),
474
+ newHist.lastIndexOf('-'),
475
+ newHist.lastIndexOf('*'),
476
+ newHist.lastIndexOf('/'),
477
+ newHist.lastIndexOf('x'),
478
+ newHist.lastIndexOf('÷'),
479
+ newHist.lastIndexOf('%')
480
+ );
481
+
482
+ // 🔹 new input segment (after the last operator)
483
+ const newInputSegment =
484
+ lastOpIndex === -1 ? newHist : newHist.slice(lastOpIndex + 1);
485
+
486
+ setHistory(newHist);
487
+ setInput(newInputSegment);
488
+
489
+ // ✅ prepare expression for evaluation:
490
+ // if last char is operator, drop it before evaluating
491
+ let exprForEval = newHist;
492
+ if (exprForEval && operators.includes(exprForEval.slice(-1))) {
493
+ exprForEval = exprForEval.slice(0, -1);
494
+ }
495
+
496
+ // 🔹 update live result
497
+ if (exprForEval) {
498
+ const res = evaluateLeftToRight(exprForEval);
499
+
500
+ // ✅ set result and also update input to evaluated result
501
+ setResult(res !== null ? res.toString().slice(0, limit) : '0');
502
+ setInput(res !== null ? res.toString().slice(0, limit) : '0');
503
+ } else {
504
+ setResult('0');
505
+ }
506
+
507
+ setCalculatorErr('');
508
+ };
509
+
510
+ const onChangeDate = (event, selectedDate) => {
511
+ const currentDate = selectedDate || date;
512
+ setShowPicker(Platform.OS === 'ios'); // for iOS
513
+ setDate(currentDate);
514
+ };
515
+
516
+ const onChangeTime = (event, selectedDate) => {
517
+ const currentDate = selectedDate;
518
+ setShowTimePicker(Platform.OS === 'ios');
519
+ setTime(currentDate);
520
+ };
521
+
522
+ const showDate = () => {
523
+ if (Platform.OS === 'android') {
524
+ // Android dialog
525
+ DateTimePickerAndroid.open({
526
+ value: date,
527
+ onChange: onChangeDate,
528
+ mode: 'date',
529
+ is24Hour: false,
530
+ });
531
+ } else {
532
+ // iOS: just show inline picker
533
+ setShowPicker(true);
534
+ }
535
+ };
536
+
537
+ const showTime = () => {
538
+ if (Platform.OS === 'android') {
539
+ // Android dialog
540
+ DateTimePickerAndroid.open({
541
+ value: time,
542
+ onChange: onChangeTime,
543
+ mode: 'time',
544
+ is24Hour: false,
545
+ });
546
+ } else {
547
+ // iOS: show inline picker
548
+ setShowTimePicker(true);
549
+ }
550
+ };
551
+
552
+ const onSave = () => {
553
+ try {
554
+ const finalValue = Number(result);
555
+
556
+ // ✅ Validate number
557
+ if (
558
+ !finalValue ||
559
+ !isFinite(finalValue) ||
560
+ finalValue <= 0 ||
561
+ finalValue > 999999999 ||
562
+ CalculatorErr ||
563
+ CalculatorErr != ''
564
+ ) {
565
+ console.log('Invalid or non-positive result, not saving');
566
+ return;
567
+ }
568
+
569
+ const amountToSave = finalValue;
570
+ saveTransaction(amountToSave);
571
+ } catch (err) {
572
+ console.log('Calculation Error:', err);
573
+ }
574
+ };
575
+
576
+ const saveTransaction = (finalValue) => {
577
+ addExpenseTransaction(
578
+ selectBusiness?.id,
579
+ eId,
580
+ mergeDateTime({ date, time }),
581
+ finalValue,
582
+ Notes + `_bill_${BillNo}`,
583
+ AudioFile
584
+ )
585
+ .then(async (res) => {
586
+ console.log(res, 'Transaction Success');
587
+ const trxId = res.insertId; // ✅ new transaction ID
588
+
589
+ if (IsCash) {
590
+ const res = await createCashEntry(finalValue, trxId, eId);
591
+ const cashId = res.insertId;
592
+ await updateExpenseTransactionIsCash(trxId, cashId);
593
+ }
594
+
595
+ // If there are attachments, insert them
596
+ if (attachments && attachments.length > 0) {
597
+ for (const file of attachments) {
598
+ try {
599
+ await addExpenseImages(trxId, file.uri);
600
+ console.log(`Attachment added: ${file.name}`);
601
+ } catch (err) {
602
+ console.log('Attachment insert error:', err);
603
+ }
604
+ }
605
+ }
606
+
607
+ // SelectedParty && (await addPartyTransaction(finalValue, trxId));
608
+
609
+ // ✅ Reset form
610
+ setInput('');
611
+ setMemory('');
612
+ setNotes('');
613
+ setDate(new Date());
614
+ setTime(new Date());
615
+ setMergedDate('');
616
+ setAttachments([]);
617
+
618
+ setSuccessModal(true);
619
+
620
+ setTimeout(() => {
621
+ setSuccessModal(false);
622
+ navigation.goBack();
623
+ }, 2000);
624
+ })
625
+ .catch((err) => {
626
+ console.log(err, 'Transaction Error');
627
+ });
628
+ };
629
+
630
+ useEffect(() => {
631
+ const showSubscription = Keyboard.addListener('keyboardDidShow', () => {
632
+ setKeyboardVisible(true);
633
+ });
634
+ const hideSubscription = Keyboard.addListener('keyboardDidHide', () => {
635
+ setKeyboardVisible(false);
636
+ });
637
+
638
+ dispatch({
639
+ type:STATUS_BAR_COLOR,
640
+ color:COLORS.redColor
641
+ })
642
+
643
+ return () => {
644
+ showSubscription.remove();
645
+ hideSubscription.remove();
646
+ };
647
+ }, []);
648
+
649
+ const askAudioPermission = async () => {
650
+ if (Platform.OS === 'android') {
651
+ try {
652
+ const granted = await PermissionsAndroid.request(
653
+ PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
654
+ {
655
+ title: 'Audio Recording Permission',
656
+ message:
657
+ 'DigiKhata needs access to your microphone to record audio.',
658
+ buttonNeutral: 'Ask Me Later',
659
+ buttonNegative: 'Cancel',
660
+ buttonPositive: 'OK',
661
+ }
662
+ );
663
+
664
+ if (granted === PermissionsAndroid.RESULTS.GRANTED) {
665
+ console.log('Recording permission granted');
666
+ onStartRecord();
667
+ } else {
668
+ console.log('Recording permission denied');
669
+ return;
670
+ }
671
+ } catch (err) {
672
+ console.warn(err);
673
+ return;
674
+ }
675
+ } else {
676
+ onStartRecord();
677
+ }
678
+ };
679
+
680
+ const onStartRecord = async () => {
681
+ setIsSoundModal(true);
682
+ Sound.addRecordBackListener((e) => {
683
+ console.log('Recording progress:', e.currentPosition, e.currentMetering);
684
+ console.log(e.currentPosition);
685
+ console.log(Sound.mmssss(Math.floor(e.currentPosition)));
686
+ setRecordingTime(Sound.mmssss(Math.floor(e.currentPosition)));
687
+ });
688
+
689
+ const result = await Sound.startRecorder();
690
+ console.log('Recording started:', result);
691
+ };
692
+
693
+ const onStopRecord = async (flag) => {
694
+ try {
695
+ const result = await Sound.stopRecorder();
696
+ Sound.removeRecordBackListener();
697
+ console.log('Recording stopped:', result);
698
+
699
+ setAudioFile(flag ? '' : result);
700
+
701
+ setTimeout(() => {
702
+ setIsSoundModal(false);
703
+ }, 350);
704
+ } catch (err) {
705
+ console.error('Error stopping recorder:', err);
706
+ }
707
+ };
708
+
709
+ const onStartPlay = async (fileUrl) => {
710
+ setPlayLoading(true);
711
+ // Set up playback progress listener
712
+ Sound.addPlayBackListener((e) => {
713
+ console.log('Playback progress:', e.currentPosition, e.duration);
714
+ setIsPlaying(true);
715
+ animationRef.current?.play();
716
+ // setCurrentPosition(e.currentPosition);
717
+ // setTotalDuration(e.duration);
718
+ // setPlayTime(Sound.mmssss(Math.floor(e.currentPosition)));
719
+ // setDuration(Sound.mmssss(Math.floor(e.duration)));
720
+ });
721
+
722
+ // Set up playback end listener
723
+ Sound.addPlaybackEndListener((e) => {
724
+ console.log('Playback completed:', e);
725
+ // Handle playback completion
726
+ setIsPlaying(false);
727
+ animationRef.current?.pause();
728
+ // setCurrentPosition(0);
729
+ });
730
+
731
+ const result = await Sound.startPlayer(fileUrl);
732
+ setPlayLoading(false);
733
+ console.log('Playback started:', result);
734
+ };
735
+
736
+ const onPauseRecord = async () => {
737
+ Sound.stopPlayer();
738
+ Sound.removePlayBackListener();
739
+ Sound.removePlaybackEndListener();
740
+ };
741
+
742
+ useEffect(() => {
743
+ if (!entryId) return;
744
+
745
+ const fetchData = async () => {
746
+ const res = await getExpenseTransactions(selectBusiness?.id, eId);
747
+ const filtered = res?.find((item) => item?.id == entryId);
748
+ if (!filtered) return;
749
+
750
+ setItem(filtered);
751
+
752
+ const arr =
753
+ filtered?.attachments?.map((i, index) => ({
754
+ name: `pdf-test-${index + 1}.pdf`,
755
+ type: isPdfFile(i?.local_path) ? 'pdf' : 'image',
756
+ uri: i?.local_path,
757
+ attachment_id: i?.id,
758
+ })) || [];
759
+
760
+ const value = String(filtered?.amount);
761
+
762
+ if (filtered?.customerId) {
763
+ let details = await getClientDetails(filtered?.customerId);
764
+ setSelectedParty(details);
765
+ }
766
+
767
+ setInput(value);
768
+ setResult(value);
769
+ setHistory(value);
770
+
771
+ setIsCash(filtered?.isCash ? true : false);
772
+ setAudioFile(filtered?.local_path);
773
+ setTime(new Date(toISOStringUTC(filtered?.entryDate)));
774
+ setDate(new Date(toISOStringUTC(filtered?.entryDate)));
775
+ setNotes(filtered?.details?.split('_')[0]);
776
+ setBillNo(filtered?.details?.split('_')[2]);
777
+ setAttachments(arr);
778
+ };
779
+
780
+ fetchData();
781
+ }, [entryId]);
782
+
783
+ const onUpdate = () => {
784
+ try {
785
+ const finalValue = Number(result);
786
+
787
+ // ✅ Validate number
788
+ if (
789
+ !finalValue ||
790
+ !isFinite(finalValue) ||
791
+ finalValue <= 0 ||
792
+ finalValue > 999999999 ||
793
+ CalculatorErr ||
794
+ CalculatorErr !== ''
795
+ ) {
796
+ console.log('Invalid or non-positive result, not updating');
797
+ return;
798
+ }
799
+
800
+ const amountToSave = finalValue;
801
+
802
+ const proceedUpdate = () => {
803
+ updateExpenseTransaction(
804
+ item?.id,
805
+ selectBusiness?.id,
806
+ eId,
807
+ mergeDateTime({ date, time }),
808
+ finalValue,
809
+ Notes + `_bill_${BillNo}`,
810
+ AudioFile
811
+ )
812
+ .then(async (res) => {
813
+ console.log(res, 'Transaction Update Success');
814
+ const trxId = item?.id;
815
+
816
+ // ✅ Handle attachments
817
+ if (attachments?.length > 0) {
818
+ try {
819
+ await deleteExpenseImagesByExpenseId(trxId);
820
+ console.log(`Previous attachments deleted for trxId: ${trxId}`);
821
+ } catch (err) {
822
+ console.log('Error deleting attachments:', err);
823
+ }
824
+
825
+ for (const file of attachments) {
826
+ if (file?.uri) {
827
+ try {
828
+ await addExpenseImages(trxId, file.uri);
829
+ console.log(`Attachment added: ${file.name || file.uri}`);
830
+ } catch (err) {
831
+ console.log('Attachment insert error:', err);
832
+ }
833
+ }
834
+ }
835
+ } else {
836
+ try {
837
+ await deleteExpenseImagesByExpenseId(trxId);
838
+ console.log(`No attachments — all deleted for trxId: ${trxId}`);
839
+ } catch (err) {
840
+ console.log('Error deleting attachments:', err);
841
+ }
842
+ }
843
+
844
+ // ✅ Reset form
845
+ setInput('');
846
+ setMemory('');
847
+ setNotes('');
848
+ setDate(new Date());
849
+ setTime(new Date());
850
+ setMergedDate('');
851
+ setAttachments([]);
852
+
853
+ setSuccessModal(true);
854
+
855
+ setTimeout(() => {
856
+ setSuccessModal(false);
857
+ navigation.goBack();
858
+ }, 2000);
859
+ })
860
+ .catch((err) => console.log(err, 'Transaction Error'));
861
+ };
862
+
863
+ // ✅ Proceed without old credit limit checks (removed)
864
+ proceedUpdate();
865
+ } catch (err) {
866
+ console.log('Calculation Error:', err);
867
+ }
868
+ };
869
+
870
+ useEffect(() => {
871
+ const maxValue = 999999999;
872
+
873
+ const numResult = Number(result);
874
+
875
+ // ✅ Only treat input as a number if it’s purely numeric (or decimal)
876
+ const isInputNumeric = /^-?\d*\.?\d+$/.test(input); // matches numbers like 123, -45.6
877
+ const numInput = isInputNumeric ? Number(input) : null;
878
+
879
+ // ✅ check for invalid conditions:
880
+ // 1. result > maxValue or Infinity
881
+ // 2. input > maxValue or Infinity (only if numeric)
882
+ if (
883
+ !isFinite(numResult) || // catches Infinity & NaN in result
884
+ numResult > maxValue ||
885
+ (numInput !== null && (!isFinite(numInput) || numInput > maxValue))
886
+ ) {
887
+ setCalculatorErr('Invalid Amount');
888
+ } else {
889
+ // clear error if values go back to normal
890
+ setCalculatorErr('');
891
+ }
892
+ }, [input, result, history]);
893
+
894
+ useEffect(() => {
895
+ const unsubscribe = navigation.addListener('focus', async () => {
896
+ await getExpenseCategoryDetails();
897
+ });
898
+ return () => unsubscribe();
899
+ }, [navigation]);
900
+
901
+ const getExpenseCategoryDetails = async () => {
902
+ let all = await getExpenseCategoriesWithTotals(selectBusiness?.id);
903
+ let filtered = all?.find((item) => item?.id == eId);
904
+
905
+ setExpenseCategoryDetails(filtered);
906
+ };
907
+
908
+ const getAllClientTypes = async () => {
909
+ try {
910
+ const [customers, suppliers, banks] = await Promise.all([
911
+ getClientsByType(0, null, null, selectBusiness?.id),
912
+ getClientsByType(1, null, null, selectBusiness?.id),
913
+ getClientsByType(2, null, null, selectBusiness?.id),
914
+ ]);
915
+
916
+ const allClients = [...customers, ...suppliers, ...banks];
917
+
918
+ // sort
919
+ const sortedClients = allClients.sort((a, b) => a.type - b.type);
920
+ setClients(sortedClients);
921
+
922
+ // Map phone -> full client info
923
+ const phoneMap = new Map();
924
+ allClients.forEach((c) => {
925
+ const formatted = formatPhoneNumber(c.phone || '')?.toLowerCase();
926
+ if (formatted) {
927
+ phoneMap.set(formatted, {
928
+ id: c.id,
929
+ type: c.type,
930
+ name: c.name,
931
+ phone: c.phone,
932
+ });
933
+ }
934
+ });
935
+ setClientPhoneMap(phoneMap);
936
+ } catch (error) {
937
+ console.error(error);
938
+ }
939
+ };
940
+
941
+ const getAllContacts = async () => {
942
+ if (Platform.OS === 'android') {
943
+ try {
944
+ const granted = await PermissionsAndroid.request(
945
+ PermissionsAndroid.PERMISSIONS.READ_CONTACTS,
946
+ {
947
+ title: 'Contacts',
948
+ message: 'This app would like to view your contacts.',
949
+ buttonPositive: 'Please accept bare mortal',
950
+ }
951
+ );
952
+
953
+ if (granted === PermissionsAndroid.RESULTS.GRANTED) {
954
+ console.log('Contacts permission granted');
955
+ Contacts.getAll().then((contacts) => {
956
+ setContacts(contacts);
957
+ });
958
+ } else {
959
+ console.log('Contacts permission denied');
960
+ return;
961
+ }
962
+ } catch (err) {
963
+ console.warn(err);
964
+ return;
965
+ }
966
+ }
967
+ };
968
+
969
+ const filteredContacts = contacts.filter((item) => {
970
+ const name = item?.displayName?.toLowerCase() || '';
971
+ const rawNumber = item?.phoneNumbers[0]?.number || '';
972
+ const formattedNumber = formatPhoneNumber(rawNumber)?.toLowerCase() || '';
973
+
974
+ // 🔹 use your searchText state (from TextInput)
975
+ const searchLower = searchText.toLowerCase();
976
+
977
+ // (optional) client type
978
+ const clientType = clientPhoneMap.get(formattedNumber);
979
+
980
+ return name.includes(searchLower) || formattedNumber.includes(searchLower);
981
+ });
982
+
983
+ const filteredClients = Clients.filter((c) => {
984
+ const name = c.name?.toLowerCase() || '';
985
+ const phone = c.phone?.toLowerCase() || '';
986
+ const searchLower = searchText.toLowerCase();
987
+
988
+ return name.includes(searchLower) || phone.includes(searchLower);
989
+ });
990
+
991
+ const onPartyPress = async () => {
992
+ await getAllContacts();
993
+ await getAllClientTypes();
994
+ setChangeModal(true);
995
+ };
996
+
997
+ const addPartyTransaction = async (finalValue, oldId) => {
998
+ try {
999
+ const res = await addTransaction(
1000
+ SelectedParty.id,
1001
+ mainColor === 'red' ? String(finalValue) : '0', // red = debit
1002
+ mainColor === 'green' ? String(finalValue) : '0', // green = credit
1003
+ Notes + `_bill_${BillNo}`,
1004
+ mergeDateTime({ date: previousDate ? previousDate : date, time }),
1005
+ AudioFile,
1006
+ mainColor == 'green'
1007
+ ? `IN_trxId${String(oldId)}`
1008
+ : `OUT_trxId${String(oldId)}`
1009
+ );
1010
+
1011
+ console.log(res, 'Transaction Success');
1012
+ const trxId = res.insertId; // ✅ new transaction ID
1013
+
1014
+ if (attachments && attachments.length > 0) {
1015
+ for (const file of attachments) {
1016
+ try {
1017
+ await addTransactionImages(trxId, file.uri);
1018
+ console.log(`Attachment added: ${file.name}`);
1019
+ } catch (err) {
1020
+ console.log('Attachment insert error:', err);
1021
+ }
1022
+ }
1023
+ }
1024
+ } catch (err) {
1025
+ console.log(err, 'Transaction Error');
1026
+ }
1027
+ };
1028
+
1029
+ const handleDeleteAudio = () => {
1030
+ Alert.alert(
1031
+ 'Delete Recording',
1032
+ 'Do you want to delete?',
1033
+ [
1034
+ {
1035
+ text: 'No',
1036
+ style: 'cancel',
1037
+ },
1038
+ {
1039
+ text: 'Yes',
1040
+ onPress: async () => {
1041
+ try {
1042
+ if (item) {
1043
+ await onPauseRecord();
1044
+ setAudioFile('');
1045
+ setIsPlaying(false);
1046
+ }
1047
+ } catch (err) {
1048
+ console.error('Error stopping audio before clearing:', err);
1049
+ }
1050
+ },
1051
+ style: 'destructive',
1052
+ },
1053
+ ],
1054
+ { cancelable: true }
1055
+ );
1056
+ };
1057
+
1058
+ const onContinue = async (name, phoneNUmer) => {
1059
+ // normalize phone
1060
+ const normalizedPhone = phoneNUmer ? String(phoneNUmer).trim() : '';
1061
+ let data = [...clients, ...suppliers];
1062
+
1063
+ try {
1064
+ let clientId;
1065
+ let homeDetails = null;
1066
+
1067
+ // If phone exists → check if already in clients array
1068
+ const isExist =
1069
+ normalizedPhone !== ''
1070
+ ? data?.find((item) => {
1071
+ const itemPhone = item?.phone ? String(item.phone).trim() : '';
1072
+ return itemPhone === normalizedPhone && itemPhone !== '';
1073
+ })
1074
+ : undefined; // no phone → force new client
1075
+
1076
+ if (isExist) {
1077
+ // Existing client found
1078
+ clientId = isExist.id;
1079
+ homeDetails = isExist;
1080
+ } else {
1081
+ console.log('else');
1082
+ // No existing client or no phone given → always create new
1083
+ const res = await addClient(
1084
+ name,
1085
+ normalizedPhone,
1086
+ 0,
1087
+ selectBusiness?.id
1088
+ );
1089
+ setName('');
1090
+ setPhoneNum('');
1091
+ clientId = res?.insertId;
1092
+ }
1093
+
1094
+ const resp = await getClientDetails(clientId);
1095
+ dispatch({ type: CLIENT_DETAILS, payload: resp });
1096
+
1097
+ setSelectedParty(resp);
1098
+ setChangeModal(false);
1099
+
1100
+ // navigation.replace('CustomerEntries', homeDetails ? { homeDetails } : {});
1101
+ } catch (err) {
1102
+ console.log('Error:', err);
1103
+ }
1104
+ };
1105
+
1106
+ const toggleCash = () => {
1107
+ setIsCash(!IsCash);
1108
+ };
1109
+
1110
+ const createCashEntry = async (finalAmount, expenseId, expenseCategoryId) => {
1111
+ try {
1112
+ const fromExpenseData = {
1113
+ expenseId,
1114
+ expenseCategoryId,
1115
+ };
1116
+
1117
+ const res = await addCashEntry(
1118
+ String(finalAmount), // cashOUT
1119
+ '0', // cashIN
1120
+ Notes + `_bill_${BillNo}`, // details
1121
+ mergeDateTime({ date, time }), // entryDate
1122
+ AudioFile, // local_path
1123
+ null, // catId
1124
+ fromJsDateToSql(new Date()), // createdAt
1125
+ null, // customerId
1126
+ selectBusiness?.id, // businessId
1127
+ JSON.stringify(fromExpenseData) // ✅ fromExpense (JSON string)
1128
+ );
1129
+
1130
+ console.log(res, 'Transaction Success');
1131
+ const trxId = res.insertId;
1132
+
1133
+ if (attachments && attachments.length > 0) {
1134
+ for (const file of attachments) {
1135
+ if (file?.uri) {
1136
+ try {
1137
+ await addCashImages(trxId, file.uri);
1138
+ console.log(`Attachment added: ${file.name || file.uri}`);
1139
+ } catch (err) {
1140
+ console.log('Attachment insert error:', err);
1141
+ }
1142
+ }
1143
+ }
1144
+ }
1145
+
1146
+ // ✅ Return the result so caller can access insertId
1147
+ return res;
1148
+ } catch (err) {
1149
+ console.log(err, 'Transaction Error');
1150
+ throw err; // ✅ rethrow for better error handling
1151
+ }
1152
+ };
1153
+
1154
+ const memorySum = (Array.isArray(memory) ? memory : []).reduce((acc, val) => acc + val, 0);
1155
+
1156
+
1157
+ return (
1158
+ <View style={Styles._mainContainer}>
1159
+ <Header
1160
+ navigation={navigation}
1161
+ firstColor={
1162
+ mainColor == 'red' ? COLORS.redColor : COLORS.redColor
1163
+ }
1164
+ secondColor={
1165
+ mainColor == 'red' ? COLORS.redColor : COLORS.redColor
1166
+ }
1167
+ title={'Expense' + ' - ' + ` ${ExpenseCategoryDetails?.name}`}
1168
+ showPopup={item}
1169
+ />
1170
+ <LinearGradient
1171
+ style={[Styles._headerMain, { height: 40 }]}
1172
+ start={{ x: 0, y: 0 }}
1173
+ end={{ x: 1, y: 0 }}
1174
+ colors={[
1175
+ mainColor == 'red' ? COLORS.redColor : COLORS.redColor,
1176
+ mainColor == 'red' ? COLORS.redColor : COLORS.redColor,
1177
+ ]}
1178
+ />
1179
+ <View style={Styles._contentMain}>
1180
+ <View style={{ width: '100%', alignItems: 'center', gap: 12 }}>
1181
+ <ScrollView
1182
+ contentContainerStyle={Styles._scrollMain}
1183
+ keyboardShouldPersistTaps={'always'}
1184
+ >
1185
+ <TouchableOpacity
1186
+ style={Styles._inputMain}
1187
+ activeOpacity={0.8}
1188
+ onPress={() => Keyboard.dismiss()}
1189
+ >
1190
+ <Text
1191
+ style={{
1192
+ color: COLORS.blackColor,
1193
+ fontFamily: FONT_NORMAL,
1194
+ fontSize: 14,
1195
+ opacity: 0.6,
1196
+ }}
1197
+ >
1198
+ Rs
1199
+ </Text>
1200
+ <TextInput
1201
+ placeholder=""
1202
+ style={[
1203
+ Styles._input,
1204
+ {
1205
+ color:
1206
+ mainColor == 'red'
1207
+ ? COLORS.redColor
1208
+ : COLORS.redColor,
1209
+ },
1210
+ ]}
1211
+ placeholderTextColor={COLORS.grey}
1212
+ cursorColor={COLORS.redColor}
1213
+ value={input}
1214
+ editable={false}
1215
+ onFocus={() => Keyboard.dismiss()}
1216
+ maxLength={9}
1217
+ />
1218
+ <TouchableOpacity onPress={handleBackspace}>
1219
+ <Text
1220
+ style={{ fontSize: 18, color: '#555', paddingHorizontal: 8 }}
1221
+ >
1222
+
1223
+ </Text>
1224
+ </TouchableOpacity>
1225
+ </TouchableOpacity>
1226
+
1227
+ {(
1228
+ (result && result !== null && result != 0 && history && (() => {
1229
+ const lastOpIndex = Math.max(
1230
+ history.lastIndexOf('+'),
1231
+ history.lastIndexOf('-'),
1232
+ history.lastIndexOf('*'),
1233
+ history.lastIndexOf('/'),
1234
+ history.lastIndexOf('x'),
1235
+ history.lastIndexOf('÷'),
1236
+ history.lastIndexOf('%')
1237
+ );
1238
+ return lastOpIndex !== -1; // show if there's at least one operator
1239
+ })()) || (memory && memory.length > 0)
1240
+ ) && (
1241
+ <View
1242
+ style={[
1243
+ Styles._memoryDisplay,
1244
+ {
1245
+ paddingRight: 15,
1246
+ paddingLeft: 15,
1247
+ minHeight: 60,
1248
+ height: "auto"
1249
+ },
1250
+ ]}
1251
+ >
1252
+ <View
1253
+ style={{
1254
+ flexDirection: 'row',
1255
+ justifyContent: 'space-between',
1256
+ alignItems: 'center',
1257
+ width: "100%",
1258
+ paddingVertical: 5,
1259
+ borderColor: COLORS.darkGrey,
1260
+ borderBottomWidth: 0.7
1261
+ }}
1262
+ >
1263
+ <Text
1264
+ style={{
1265
+ color: COLORS.darkGrey,
1266
+ fontFamily: FONT_NORMAL,
1267
+ fontSize: 11,
1268
+ width: '60%',
1269
+ }}
1270
+ >
1271
+ {history}
1272
+ </Text>
1273
+ <Text
1274
+ style={{
1275
+ color: COLORS.darkGrey,
1276
+ fontFamily: FONT_NORMAL,
1277
+ fontSize: 11,
1278
+ }}
1279
+ >
1280
+ ={result}
1281
+ </Text>
1282
+ </View>
1283
+
1284
+ {memory?.map((mem, index) => (
1285
+ <Text
1286
+ style={{
1287
+ color: COLORS.darkGrey,
1288
+ fontFamily: FONT_NORMAL,
1289
+ fontSize: 11,
1290
+ width: '60%',
1291
+ marginTop: 5
1292
+ }}
1293
+ key={index}
1294
+ >
1295
+ (M) = {mem}
1296
+ </Text>
1297
+ ))}
1298
+ </View>
1299
+ )}
1300
+
1301
+ {CalculatorErr && CalculatorErr !== null && (
1302
+ <View
1303
+ style={[
1304
+ Styles._memoryDisplay,
1305
+ { borderColor: COLORS.redColor, width: WP(90) },
1306
+ ]}
1307
+ >
1308
+ <Text
1309
+ style={[
1310
+ Styles._memoryText,
1311
+ {
1312
+ fontFamily: FONT_MEDIUM,
1313
+ color: COLORS.redColor,
1314
+ fontSize: 13,
1315
+ },
1316
+ ]}
1317
+ >
1318
+ {CalculatorErr}
1319
+ </Text>
1320
+ </View>
1321
+ )}
1322
+
1323
+ {/* Attach Voice Note */}
1324
+ <TouchableOpacity
1325
+ style={[Styles._inputMain, { paddingHorizontal: 12 }]}
1326
+ activeOpacity={0.8}
1327
+ onPress={() => {
1328
+ !AudioFile && askAudioPermission();
1329
+ }}
1330
+ >
1331
+ {AudioFile ? (
1332
+ <>
1333
+ {PlayLoading ? (
1334
+ <ActivityIndicator
1335
+ color={COLORS.redColor}
1336
+ size={'small'}
1337
+ animating
1338
+ />
1339
+ ) : (
1340
+ <TouchableOpacity
1341
+ activeOpacity={0.8}
1342
+ onPress={() => {
1343
+ if (IsPlaying) {
1344
+ Sound.stopPlayer();
1345
+ Sound.removePlayBackListener();
1346
+ Sound.removePlaybackEndListener();
1347
+ setIsPlaying(false);
1348
+ animationRef.current?.pause();
1349
+ } else {
1350
+ onStartPlay(AudioFile);
1351
+ }
1352
+ }}
1353
+ >
1354
+ <Ionicons
1355
+ color={COLORS.redColor}
1356
+ size={22}
1357
+ name={IsPlaying ? 'pause' : 'play'}
1358
+ />
1359
+ </TouchableOpacity>
1360
+ )}
1361
+
1362
+ <LottieView
1363
+ source={require('../assets/animations/voice_visualization.json')}
1364
+ autoPlay={false}
1365
+ loop
1366
+ style={{ width: '80%', height: 42 }}
1367
+ ref={animationRef}
1368
+ />
1369
+
1370
+ <TouchableOpacity
1371
+ activeOpacity={0.8}
1372
+ onPress={handleDeleteAudio}
1373
+ >
1374
+ <Ionicons
1375
+ color={COLORS.redColor}
1376
+ size={22}
1377
+ name={'close'}
1378
+ />
1379
+ </TouchableOpacity>
1380
+ </>
1381
+ ) : (
1382
+ <>
1383
+ <Text
1384
+ style={{
1385
+ color:
1386
+ mainColor == 'red'
1387
+ ? COLORS.redColor
1388
+ : COLORS.redColor,
1389
+ fontSize: Input_Field_SIZES.Input_Font_Size,
1390
+ fontFamily: FONT_MEDIUM,
1391
+ }}
1392
+ >
1393
+ Attach Voice Note
1394
+ </Text>
1395
+ <Ionicons
1396
+ name={'mic-outline'}
1397
+ color={
1398
+ mainColor == 'red'
1399
+ ? COLORS.redColor
1400
+ : COLORS.redColor
1401
+ }
1402
+ size={22}
1403
+ />
1404
+ </>
1405
+ )}
1406
+ </TouchableOpacity>
1407
+
1408
+ {input && (
1409
+ <View style={Styles._hidableMain}>
1410
+ <FloatingInput
1411
+ label="Enter details."
1412
+ // iconName="list-outline"
1413
+ iconPosition="right"
1414
+ value={Notes}
1415
+ onChangeText={(text) => setNotes(text)}
1416
+ allowedChars={/[^A-Za-z0-9\s]/g}
1417
+ maxLength={200}
1418
+ containerStyle={{ width: '95%' }}
1419
+ />
1420
+
1421
+ <TouchableOpacity
1422
+ style={[Styles._cellMain, { width: '95%' }]}
1423
+ activeOpacity={0.8}
1424
+ onPress={onPartyPress}
1425
+ >
1426
+ {SelectedParty ? (
1427
+ <View
1428
+ style={{
1429
+ marginLeft: 0,
1430
+ alignItems: 'center',
1431
+ flexDirection: 'row',
1432
+ gap: 5,
1433
+ }}
1434
+ >
1435
+ <Text
1436
+ numberOfLines={2}
1437
+ style={[Styles._cellText, { width: '92%' }]}
1438
+ >
1439
+ {SelectedParty?.name}
1440
+ </Text>
1441
+
1442
+ <TouchableOpacity
1443
+ activeOpacity={0.8}
1444
+ onPress={() => setSelectedParty(null)}
1445
+ >
1446
+ <Ionicons
1447
+ name={'close'}
1448
+ color={COLORS.darkGrey}
1449
+ size={20}
1450
+ />
1451
+ </TouchableOpacity>
1452
+ </View>
1453
+ ) : (
1454
+ <Text style={Styles._cellText}>Select Party/ Bank</Text>
1455
+ )}
1456
+ </TouchableOpacity>
1457
+
1458
+ <View style={Styles._hidableRow}>
1459
+ <FloatingInput
1460
+ label="Date"
1461
+ iconName="calendar-outline"
1462
+ iconPosition="left"
1463
+ onPress={showDate}
1464
+ editable={false}
1465
+ value={formatMyDate(fromJsDateToSql(date))}
1466
+ // onChangeText={(text) => setForm({ ...form, amount: text })}
1467
+ containerStyle={{ width: '47.5%' }}
1468
+ inputStyle={{ fontSize: 13 }}
1469
+ iconColor={COLORS.redColor}
1470
+ />
1471
+
1472
+ <FloatingInput
1473
+ label="Time"
1474
+ iconName="time-outline"
1475
+ iconPosition="left"
1476
+ onPress={showTime}
1477
+ editable={false}
1478
+ value={time.toLocaleTimeString()}
1479
+ // onChangeText={(text) => setForm({ ...form, amount: text })}
1480
+ containerStyle={{ width: '47.5%' }}
1481
+ inputStyle={{ fontSize: 13 }}
1482
+ iconColor={COLORS.redColor}
1483
+ />
1484
+ </View>
1485
+
1486
+ {/* Bill No & Party */}
1487
+ <View style={Styles._hidableRow}>
1488
+ <FloatingInput
1489
+ label="Add Bill No"
1490
+ // iconName="receipt-outline"
1491
+ keyboardType="number-pad"
1492
+ iconPosition="right"
1493
+ value={BillNo}
1494
+ onChangeText={(text) => {
1495
+ const emojiRegex =
1496
+ /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g;
1497
+ const filteredText = text.replace(emojiRegex, '');
1498
+ setBillNo(filteredText);
1499
+ }}
1500
+ // allowedChars={/[^0-9]/g}
1501
+ maxLength={20}
1502
+ containerStyle={{ width: '47.5%' }}
1503
+ />
1504
+
1505
+ {/* Attachments */}
1506
+
1507
+ {/* <TouchableOpacity
1508
+ style={Styles._cellMain}
1509
+ activeOpacity={0.8}
1510
+ onPress={() => setIsModalVisible(true)}
1511
+ >
1512
+ <Ionicons
1513
+ name={'attach'}
1514
+ color={
1515
+ mainColor == 'red'
1516
+ ? COLORS.redColor
1517
+ : COLORS.redColor
1518
+ }
1519
+ size={23}
1520
+ />
1521
+ <Text style={Styles._cellText}>PDF/Photos</Text>
1522
+ </TouchableOpacity> */}
1523
+
1524
+ <FloatingInput
1525
+ label="PDF/Photos"
1526
+ iconName="attach"
1527
+ iconPosition="right"
1528
+ onPress={() => setIsModalVisible(true)}
1529
+ editable={false}
1530
+ // allowedChars={/[^0-9]/g}
1531
+ // maxLength={20}
1532
+ containerStyle={{ width: '47.5%' }}
1533
+ />
1534
+ </View>
1535
+ <View style={[Styles._hidableRow]}>
1536
+ <View>
1537
+ <TouchableOpacity
1538
+ activeOpacity={0.8}
1539
+ style={{
1540
+ flexDirection: 'row',
1541
+ alignItems: 'center',
1542
+ gap: 8,
1543
+ }}
1544
+ onPress={toggleCash}
1545
+ >
1546
+ <Ionicons
1547
+ name={IsCash ? 'checkbox-outline' : 'square-outline'}
1548
+ color={IsCash ? COLORS.redColor : COLORS.blackColor}
1549
+ size={28}
1550
+ />
1551
+
1552
+ <Text style={Styles._cellText}>Cash</Text>
1553
+ </TouchableOpacity>
1554
+ </View>
1555
+
1556
+ {attachments.map((file, index) => (
1557
+ <View
1558
+ key={index}
1559
+ style={{ marginLeft: 8, alignItems: 'center' }}
1560
+ >
1561
+ {file.type === 'image' ? (
1562
+ <Image
1563
+ source={{ uri: file.uri }}
1564
+ style={{ width: 40, height: 40, borderRadius: 5 }}
1565
+ />
1566
+ ) : (
1567
+ <Ionicons
1568
+ name="document-text-outline"
1569
+ size={40}
1570
+ // color={mainColor}
1571
+ color={COLORS.redColor}
1572
+ />
1573
+ )}
1574
+ {/* delete cross */}
1575
+ <TouchableOpacity
1576
+ onPress={() => removeAttachment(index)}
1577
+ style={{
1578
+ position: 'absolute',
1579
+ top: -5,
1580
+ right: -5,
1581
+ backgroundColor: 'white',
1582
+ borderRadius: 10,
1583
+ padding: 2,
1584
+ }}
1585
+ >
1586
+ <Ionicons
1587
+ name="close-circle"
1588
+ size={18}
1589
+ // color={mainColor}
1590
+ color={COLORS.redColor}
1591
+ />
1592
+ </TouchableOpacity>
1593
+ </View>
1594
+ ))}
1595
+ </View>
1596
+ </View>
1597
+ )}
1598
+ </ScrollView>
1599
+ </View>
1600
+ </View>
1601
+
1602
+ <View
1603
+ style={{
1604
+ width: '92%',
1605
+ alignItems: 'center',
1606
+ gap: 20,
1607
+ position: 'absolute',
1608
+ bottom: insets.bottom,
1609
+ paddingBottom: 10,
1610
+ backgroundColor: COLORS.whiteColor,
1611
+ }}
1612
+ >
1613
+ {
1614
+ memory?.length > 0 ?
1615
+ <TouchableOpacity
1616
+ activeOpacity={0.8}
1617
+ style={[
1618
+ Styles._continueBtn,
1619
+ {
1620
+ backgroundColor: COLORS.redColor,
1621
+ },
1622
+ ]}
1623
+ onPress={() => {
1624
+ setInput(String(Math.abs(memorySum)))
1625
+ setResult(String(Math.abs(memorySum)))
1626
+ setHistory('')
1627
+ setMemory([])
1628
+ }}
1629
+ >
1630
+ <Text style={Styles._continueBtnTxt}>MR = {memorySum}</Text>
1631
+ </TouchableOpacity>
1632
+ :
1633
+ <TouchableOpacity
1634
+ activeOpacity={0.8}
1635
+ style={[
1636
+ Styles._continueBtn,
1637
+ {
1638
+ backgroundColor:
1639
+ mainColor == 'red' ? COLORS.redColor : COLORS.redColor,
1640
+ },
1641
+ ]}
1642
+ onPress={entryId ? onUpdate : onSave}
1643
+ >
1644
+ <Text style={Styles._continueBtnTxt}>
1645
+ {entryId ? 'UPDATE' : 'SAVE'}
1646
+ </Text>
1647
+ </TouchableOpacity>
1648
+ }
1649
+
1650
+ {!keyboardVisible && (
1651
+ <View style={Styles._calculatorMain}>
1652
+ {buttons.map((row, rowIndex) => (
1653
+ <View style={Styles._calculatorRow} key={rowIndex}>
1654
+ {row.map((key) => (
1655
+ <TouchableOpacity
1656
+ key={key}
1657
+ activeOpacity={0.8}
1658
+ style={[
1659
+ Styles._key,
1660
+ key === '0' && { flex: 2 },
1661
+ ['AC', 'M+', 'M-', 'MR'].includes(key) && {
1662
+ backgroundColor: '#ccc',
1663
+ },
1664
+ ['=', '⌫'].includes(key) && {
1665
+ backgroundColor: COLORS.gray,
1666
+ },
1667
+ ['÷', 'x', '-', '+', '%'].includes(key) && {
1668
+ backgroundColor: '#ccc',
1669
+ },
1670
+ ]}
1671
+ onPress={() => handlePress(key)}
1672
+ >
1673
+ <Text style={Styles._keyText}>{key}</Text>
1674
+ </TouchableOpacity>
1675
+ ))}
1676
+ </View>
1677
+ ))}
1678
+ </View>
1679
+ )}
1680
+ </View>
1681
+
1682
+ {/* Modal */}
1683
+ <Modal
1684
+ isVisible={isModalVisible}
1685
+ onBackdropPress={() => setIsModalVisible(false)}
1686
+ onBackButtonPress={() => setIsModalVisible(false)}
1687
+ >
1688
+ <View
1689
+ style={{ backgroundColor: 'white', padding: 20, borderRadius: 12 }}
1690
+ >
1691
+ <Text
1692
+ style={{ fontSize: 16, fontFamily: FONT_MEDIUM, marginBottom: 12 }}
1693
+ >
1694
+ Choose Option
1695
+ </Text>
1696
+
1697
+ <TouchableOpacity style={Styles._modalBtn} onPress={handleGallery}>
1698
+ <Ionicons name="image-outline" size={20} color="red" />
1699
+ <Text style={Styles._modalText}>Gallery</Text>
1700
+ </TouchableOpacity>
1701
+
1702
+ <TouchableOpacity style={Styles._modalBtn} onPress={handleCamera}>
1703
+ <Ionicons name="camera-outline" size={20} color="red" />
1704
+ <Text style={Styles._modalText}>Camera</Text>
1705
+ </TouchableOpacity>
1706
+
1707
+ <TouchableOpacity style={Styles._modalBtn} onPress={handlePDF}>
1708
+ <Ionicons name="document-outline" size={20} color="red" />
1709
+ <Text style={Styles._modalText}>PDF</Text>
1710
+ </TouchableOpacity>
1711
+ </View>
1712
+ </Modal>
1713
+
1714
+ {/* Sound Modal */}
1715
+ <Modal
1716
+ isVisible={IsSoundModal}
1717
+ // onBackdropPress={() => setIsSoundModal(false)}
1718
+ // onBackButtonPress={() => setIsSoundModal(false)}
1719
+ >
1720
+ <View style={Styles._voiceModalMain}>
1721
+ <Text
1722
+ style={{
1723
+ color: COLORS.blackColor,
1724
+ fontFamily: FONT_MEDIUM,
1725
+ fontSize: 18,
1726
+ }}
1727
+ >
1728
+ DigiKhata
1729
+ </Text>
1730
+
1731
+ <LottieView
1732
+ style={{ width: 130, height: 130 }}
1733
+ source={require('../assets/animations/recording.json')}
1734
+ autoPlay
1735
+ loop
1736
+ />
1737
+
1738
+ <Text
1739
+ style={{
1740
+ color: COLORS.blackColor,
1741
+ fontFamily: FONT_NORMAL,
1742
+ fontSize: 13,
1743
+ opacity: 0.6,
1744
+ }}
1745
+ >
1746
+ Recording
1747
+ </Text>
1748
+
1749
+ <View
1750
+ style={{
1751
+ flexDirection: 'row',
1752
+ width: '50%',
1753
+ justifyContent: 'space-between',
1754
+ alignItems: 'center',
1755
+ }}
1756
+ >
1757
+ <TouchableOpacity
1758
+ style={Styles._voiceBtn}
1759
+ activeOpacity={0.8}
1760
+ onPress={() => {
1761
+ onStopRecord(true);
1762
+ }}
1763
+ >
1764
+ <Ionicons
1765
+ name={'trash-outline'}
1766
+ color={COLORS.blackColor}
1767
+ size={22}
1768
+ />
1769
+ </TouchableOpacity>
1770
+
1771
+ <Text>{RecordingTime}</Text>
1772
+
1773
+ <TouchableOpacity
1774
+ style={Styles._voiceBtn}
1775
+ activeOpacity={0.8}
1776
+ onPress={() => {
1777
+ onStopRecord(false);
1778
+ }}
1779
+ >
1780
+ <Ionicons name={'stop'} color={COLORS.blackColor} size={22} />
1781
+ </TouchableOpacity>
1782
+ </View>
1783
+ </View>
1784
+ </Modal>
1785
+
1786
+ {/* Success Modal */}
1787
+ <Modal
1788
+ isVisible={SuccessModal}
1789
+ coverScreen
1790
+ style={{ margin: 0, padding: 0 }}
1791
+ animationInTiming={100}
1792
+ animationOutTiming={100}
1793
+ >
1794
+ <View
1795
+ style={{
1796
+ width: WP(100),
1797
+ height: HP(100),
1798
+ backgroundColor: COLORS.whiteColor,
1799
+ justifyContent: 'center',
1800
+ alignItems: 'center',
1801
+ }}
1802
+ >
1803
+ <LottieView
1804
+ source={require('../assets/animations/success.json')}
1805
+ style={{ width: 120, height: 120 }}
1806
+ autoPlay
1807
+ loop={false}
1808
+ />
1809
+
1810
+ <Text
1811
+ style={{ color: '#00C985', fontFamily: FONT_MEDIUM, fontSize: 15 }}
1812
+ >
1813
+ Transaction Saved
1814
+ </Text>
1815
+ </View>
1816
+ </Modal>
1817
+
1818
+ {/* Bank and Parties */}
1819
+ <Modal
1820
+ isVisible={ChangeModal}
1821
+ onBackButtonPress={() => {
1822
+ setShowNewBtn(false);
1823
+ setChangeModal(false);
1824
+ }}
1825
+ onBackdropPress={() => {
1826
+ setShowNewBtn(false);
1827
+ setChangeModal(false);
1828
+ }}
1829
+ avoidKeyboard={false}
1830
+ >
1831
+ <View style={Styles._changeModalMain}>
1832
+ <View style={Styles._changeModalHeader}>
1833
+ <Text style={Styles._changeModalHeaderTxt}>Select Party</Text>
1834
+ </View>
1835
+ <View style={Styles._modalSearchMain}>
1836
+ <TextInput
1837
+ style={Styles._modalSearch}
1838
+ cursorColor={COLORS.redColor}
1839
+ placeholder={
1840
+ ShowNewBtn
1841
+ ? filteredContacts?.length && filteredContacts.length != 0
1842
+ ? 'Search Contacts'
1843
+ : 'Type Customer Names'
1844
+ : 'Search Clients'
1845
+ }
1846
+ value={searchText}
1847
+ onChangeText={setSearchText}
1848
+ placeholderTextColor={COLORS.gray}
1849
+ />
1850
+ </View>
1851
+
1852
+ <View style={Styles._modalSearchMain}>
1853
+ {!ShowNewBtn ? (
1854
+ <TouchableOpacity
1855
+ style={Styles._addContactBtn}
1856
+ activeOpacity={0.8}
1857
+ onPress={() => setShowNewBtn(true)}
1858
+ >
1859
+ <View style={Styles._avatarMain}>
1860
+ <Ionicons
1861
+ name="person-add-outline"
1862
+ color={COLORS.redColor}
1863
+ size={22}
1864
+ />
1865
+ </View>
1866
+
1867
+ <View style={{ width: '70%' }}>
1868
+ <Text
1869
+ style={{
1870
+ color: COLORS.redColor,
1871
+ fontFamily: FONT_NORMAL,
1872
+ fontSize: 12,
1873
+ }}
1874
+ >
1875
+ Add New Customer
1876
+ </Text>
1877
+ </View>
1878
+
1879
+ <Ionicons
1880
+ name="chevron-forward"
1881
+ color={COLORS.redColor}
1882
+ size={22}
1883
+ />
1884
+ </TouchableOpacity>
1885
+ ) : (
1886
+ <View style={Styles._phoneInputMain}>
1887
+ <CountryPhoneInput
1888
+ contentContainerStyle={{ width: '100%' }}
1889
+ onChange={(text) => {
1890
+ setPhoneNum(text?.fullNumber);
1891
+ }}
1892
+ />
1893
+
1894
+ <TouchableOpacity
1895
+ activeOpacity={0.8}
1896
+ onPress={() => {
1897
+ if (searchText.trim()) {
1898
+ onContinue(searchText, PhoneNum);
1899
+ }
1900
+ }}
1901
+ style={[
1902
+ Styles._modalBtn,
1903
+ {
1904
+ backgroundColor: searchText?.trim()
1905
+ ? COLORS.redColor
1906
+ : COLORS.gray,
1907
+ width: '100%',
1908
+ justifyContent: 'center',
1909
+ paddingVertical: 15,
1910
+ },
1911
+ ]}
1912
+ >
1913
+ <Text
1914
+ style={{
1915
+ color: COLORS.whiteColor,
1916
+ fontFamily: FONT_NORMAL,
1917
+ fontSize: 12,
1918
+ }}
1919
+ >
1920
+ CONTINUE
1921
+ </Text>
1922
+ </TouchableOpacity>
1923
+ </View>
1924
+ )}
1925
+ </View>
1926
+ {!ShowNewBtn ? (
1927
+ <ScrollView
1928
+ contentContainerStyle={{
1929
+ alignItems: 'center',
1930
+ }}
1931
+ >
1932
+ {filteredClients?.length === 0 ? (
1933
+ <View
1934
+ style={{
1935
+ height: 300,
1936
+ justifyContent: 'center',
1937
+ alignItems: 'center',
1938
+ }}
1939
+ >
1940
+ <Text
1941
+ style={{
1942
+ textAlign: 'center',
1943
+ color: COLORS.blackColor,
1944
+ fontFamily: FONT_MEDIUM,
1945
+ fontSize: 13,
1946
+ }}
1947
+ >
1948
+ No Records Found
1949
+ </Text>
1950
+ </View>
1951
+ ) : (
1952
+ filteredClients.map((item, index) => {
1953
+ let amount = item?.total_subamount - item?.total_amount;
1954
+
1955
+ let type = 'none';
1956
+ if (amount > 0) {
1957
+ type = 'receivable';
1958
+ } else if (amount < 0) {
1959
+ type = 'payable';
1960
+ }
1961
+
1962
+ amount = Math.abs(amount);
1963
+
1964
+ return (
1965
+ <User
1966
+ key={index}
1967
+ name={item?.name}
1968
+ addedAt={formatDateTime(
1969
+ item?.latest_transaction_date || item?.created_at
1970
+ )}
1971
+ amount={amount}
1972
+ type={type}
1973
+ avatarColor={item?.type == 0 ? 'red' : 'green'}
1974
+ clientType={item?.type}
1975
+ icon={item?.local_path}
1976
+ mainContainer={{ width: '90%' }}
1977
+ onPress={() => {
1978
+ setShowNewBtn(false);
1979
+ setChangeModal(false);
1980
+ setSelectedParty(item);
1981
+ }}
1982
+ />
1983
+ );
1984
+ })
1985
+ )}
1986
+ </ScrollView>
1987
+ ) : (
1988
+ <FlatList
1989
+ data={filteredContacts} // 🔹 now using filtered contacts
1990
+ keyExtractor={(item, index) => index.toString()}
1991
+ contentContainerStyle={{ paddingBottom: HP(20) }}
1992
+ renderItem={({ item }) => {
1993
+ const rawNumber = item?.phoneNumbers[0]?.number;
1994
+ const formattedNumber =
1995
+ formatPhoneNumber(rawNumber)?.toLowerCase();
1996
+
1997
+ const clientInfo = clientPhoneMap.get(formattedNumber);
1998
+
1999
+ const clientId = clientInfo?.id;
2000
+ const clientType = clientInfo?.type;
2001
+
2002
+ let typeLabel = '';
2003
+ if (clientType === 0) typeLabel = 'Customer';
2004
+ else if (clientType === 1) typeLabel = 'Supplier';
2005
+ const highlight = clientType === 0 || clientType === 1;
2006
+
2007
+ return (
2008
+ <TouchableOpacity
2009
+ style={[Styles._contactsCardMain]}
2010
+ activeOpacity={0.8}
2011
+ onPress={async () => {
2012
+ if (highlight) {
2013
+ setChangeModal(false);
2014
+
2015
+ let fromClientName = ClientDetails?.name;
2016
+ let fromClientId = ClientDetails?.id;
2017
+ let toClientName = item?.displayName;
2018
+ let toClientId = clientId;
2019
+
2020
+ await moveTransaction(
2021
+ fromClientName,
2022
+ fromClientId,
2023
+ toClientName,
2024
+ toClientId
2025
+ );
2026
+ } else {
2027
+ await onContinue(item?.displayName, formattedNumber);
2028
+ }
2029
+ }}
2030
+ >
2031
+ <View style={Styles._avatarMain}>
2032
+ <Text style={Styles._avatarText}>
2033
+ {getAvatar(item?.displayName)}
2034
+ </Text>
2035
+ </View>
2036
+ <View style={{ width: '55%' }}>
2037
+ <Text
2038
+ style={{
2039
+ color: COLORS.blackColor,
2040
+ fontFamily: FONT_NORMAL,
2041
+ fontSize: 13,
2042
+ }}
2043
+ >
2044
+ {item?.displayName}
2045
+ </Text>
2046
+ <Text
2047
+ style={{
2048
+ color: COLORS.blackColor,
2049
+ fontFamily: FONT_NORMAL,
2050
+ fontSize: 12,
2051
+ opacity: 0.6,
2052
+ }}
2053
+ >
2054
+ {formattedNumber}
2055
+ </Text>
2056
+ </View>
2057
+
2058
+ <View
2059
+ style={{
2060
+ width: '27%',
2061
+ height: '100%',
2062
+ justifyContent: 'center',
2063
+ alignItems: 'flex-end',
2064
+ }}
2065
+ >
2066
+ <Text
2067
+ style={{
2068
+ color: COLORS.darkGrey,
2069
+ fontFamily: FONT_NORMAL,
2070
+ fontSize: 11,
2071
+ }}
2072
+ >
2073
+ {typeLabel}
2074
+ </Text>
2075
+ </View>
2076
+ </TouchableOpacity>
2077
+ );
2078
+ }}
2079
+ />
2080
+ )}
2081
+ </View>
2082
+ </Modal>
2083
+
2084
+ {Platform.OS === 'ios' && showTimePicker && (
2085
+ <DateTimePicker
2086
+ value={time}
2087
+ mode="time"
2088
+ is24Hour={false}
2089
+ onChange={onChangeTime}
2090
+ />
2091
+ )}
2092
+ </View>
2093
+ );
2094
+ }
2095
+
2096
+ const Styles = StyleSheet.create({
2097
+ _mainContainer: {
2098
+ flex: 1,
2099
+ alignItems: 'center',
2100
+ backgroundColor: COLORS.backgroundColor,
2101
+ },
2102
+ _contentMain: {
2103
+ width: '95%',
2104
+ height: '95%',
2105
+ backgroundColor: COLORS.whiteColor,
2106
+ position: 'absolute',
2107
+ top: 50,
2108
+ shadowColor: '#000',
2109
+ shadowOffset: { width: 0, height: 2 },
2110
+ shadowOpacity: 0.2,
2111
+ shadowRadius: 3.84,
2112
+ elevation: 5,
2113
+ borderRadius: 10,
2114
+ alignItems: 'center',
2115
+ justifyContent: 'space-between',
2116
+ paddingVertical: 12,
2117
+ },
2118
+ _headerMain: {
2119
+ width: WP(100),
2120
+ height: 60,
2121
+ flexDirection: 'row',
2122
+ alignItems: 'center',
2123
+ // justifyContent: "space-between",
2124
+ paddingHorizontal: Platform.OS == 'android' && 10,
2125
+ gap: 15,
2126
+ },
2127
+ _input: {
2128
+ flex: 1,
2129
+ height: '100%',
2130
+ fontFamily: FONT_MEDIUM,
2131
+ fontSize: 15,
2132
+ color: 'red',
2133
+ paddingLeft: 13,
2134
+ fontSize: Input_Field_SIZES.Input_Font_Size,
2135
+ fontFamily: FONT_MEDIUM,
2136
+ },
2137
+ _inputMain: {
2138
+ width: '100%',
2139
+ height: 60,
2140
+ flexDirection: 'row',
2141
+ borderColor: COLORS.grey,
2142
+ borderWidth: 1,
2143
+ borderRadius: TEXT_SIZES.BORDER_RADIUS,
2144
+ justifyContent: 'space-between',
2145
+ alignItems: 'center',
2146
+ paddingHorizontal: 12,
2147
+ backgroundColor: COLORS.whiteColor,
2148
+ },
2149
+ _memoryDisplay: {
2150
+ width: '100%',
2151
+ height: 60,
2152
+ alignItems: 'flex-start',
2153
+ justifyContent: 'center',
2154
+ paddingLeft: 12,
2155
+ // paddingVertical: 4,
2156
+ borderColor: COLORS.grey,
2157
+ borderWidth: 1,
2158
+ borderRadius: TEXT_SIZES.BORDER_RADIUS,
2159
+ },
2160
+ _chooseCategory: {
2161
+ width: '95%',
2162
+ height: 60,
2163
+ paddingHorizontal: 12,
2164
+ borderColor: COLORS.grey,
2165
+ borderWidth: 1,
2166
+ borderRadius: TEXT_SIZES.BORDER_RADIUS,
2167
+ flexDirection: 'row',
2168
+ justifyContent: 'space-between',
2169
+ alignItems: 'center',
2170
+ },
2171
+ _memoryText: {
2172
+ fontSize: 12,
2173
+ fontFamily: FONT_NORMAL,
2174
+ color: '#333',
2175
+ },
2176
+ _continueBtn: {
2177
+ width: '95%',
2178
+ height: TEXT_SIZES.BUTTON_HEIGHT,
2179
+ backgroundColor: COLORS.redColor,
2180
+ borderRadius: 100,
2181
+ justifyContent: 'center',
2182
+ alignItems: 'center',
2183
+ },
2184
+ _continueBtnTxt: {
2185
+ color: COLORS.whiteColor,
2186
+ fontFamily: FONT_MEDIUM,
2187
+ fontSize: TEXT_SIZES.BUTTON_TEXT,
2188
+ },
2189
+ _calculatorMain: {
2190
+ width: '95%',
2191
+ // height: 350,
2192
+ // backgroundColor: "red"
2193
+ },
2194
+ _calculatorRow: {
2195
+ flexDirection: 'row',
2196
+ justifyContent: 'space-between',
2197
+ // marginBottom: 3
2198
+ },
2199
+ _key: {
2200
+ flex: 1,
2201
+ margin: 5,
2202
+ backgroundColor: COLORS.whiteColor,
2203
+ paddingVertical: 10,
2204
+ alignItems: 'center',
2205
+ justifyContent: 'center',
2206
+ borderRadius: 8,
2207
+ marginHorizontal: 10,
2208
+ shadowColor: '#000',
2209
+ shadowOffset: {
2210
+ width: 0,
2211
+ height: 2,
2212
+ },
2213
+ shadowOpacity: 0.2,
2214
+ shadowRadius: 3.84,
2215
+ elevation: 2,
2216
+ },
2217
+ _keyText: {
2218
+ fontSize: 15,
2219
+ color: COLORS.blackColor,
2220
+ fontFamily: FONT_MEDIUM,
2221
+ },
2222
+ _scrollMain: {
2223
+ width: '95%',
2224
+ alignItems: 'center',
2225
+ gap: 12,
2226
+ paddingBottom: HP(70),
2227
+ // backgroundColor: "green",
2228
+ // maxHeight: Platform.OS == "ios" ? 200 : 250,
2229
+ },
2230
+ _hidableMain: {
2231
+ width: WP(94),
2232
+ height: 300,
2233
+ // backgroundColor: "green",
2234
+ alignItems: 'center',
2235
+ gap: 12,
2236
+ },
2237
+ _hidableRow: {
2238
+ width: '100%',
2239
+ // height:30,
2240
+ // backgroundColor: "red",
2241
+ flexDirection: 'row',
2242
+ justifyContent: 'space-between',
2243
+ alignItems: 'center',
2244
+ paddingHorizontal: 9,
2245
+ },
2246
+ _cellMain: {
2247
+ width: '52%',
2248
+ height: 60,
2249
+ // backgroundColor: "pink",
2250
+ borderColor: COLORS.grey,
2251
+ borderWidth: 1,
2252
+ borderRadius: TEXT_SIZES.BORDER_RADIUS,
2253
+ flexDirection: 'row',
2254
+ justifyContent: 'space-between',
2255
+ alignItems: 'center',
2256
+ paddingHorizontal: WP(3),
2257
+ },
2258
+ _cellText: {
2259
+ color: COLORS.blackColor,
2260
+ // fontFamily: FONT_NORMAL,
2261
+ fontSize: 13,
2262
+ fontFamily: FONT_MEDIUM,
2263
+ },
2264
+ _detailMain: {
2265
+ minHeight: 60,
2266
+ maxHeight: 150,
2267
+ width: '91%',
2268
+ borderColor: COLORS.grey,
2269
+ borderWidth: 1,
2270
+ borderRadius: TEXT_SIZES.BORDER_RADIUS,
2271
+ paddingHorizontal: 15,
2272
+ color: COLORS.blackColor,
2273
+ fontSize: 13,
2274
+ fontFamily: FONT_MEDIUM,
2275
+ },
2276
+ _modalBtn: {
2277
+ flexDirection: 'row',
2278
+ alignItems: 'center',
2279
+ paddingVertical: 12,
2280
+ borderBottomColor: '#eee',
2281
+ borderBottomWidth: 1,
2282
+ },
2283
+ _modalText: {
2284
+ marginLeft: 10,
2285
+ fontSize: 14,
2286
+ fontFamily: FONT_NORMAL,
2287
+ color: COLORS.blackColor,
2288
+ },
2289
+ _voiceModalMain: {
2290
+ width: WP(90),
2291
+ height: HP(30),
2292
+ backgroundColor: COLORS.whiteColor,
2293
+ justifyContent: 'center',
2294
+ alignItems: 'center',
2295
+ borderRadius: 15,
2296
+ },
2297
+ _voiceBtn: {
2298
+ width: 35,
2299
+ height: 35,
2300
+ borderColor: COLORS.blackColor,
2301
+ borderWidth: 1,
2302
+ borderRadius: 100,
2303
+ justifyContent: 'center',
2304
+ alignItems: 'center',
2305
+ },
2306
+ _billNoMain: {
2307
+ width: '91%',
2308
+ height: 60,
2309
+ borderColor: COLORS.grey,
2310
+ borderWidth: 1,
2311
+ borderRadius: TEXT_SIZES.BORDER_RADIUS,
2312
+ paddingHorizontal: 15,
2313
+ color: COLORS.blackColor,
2314
+ fontSize: Input_Field_SIZES.Input_Font_Size,
2315
+ fontFamily: FONT_MEDIUM,
2316
+ },
2317
+ _categoryModal: {
2318
+ justifyContent: 'flex-end',
2319
+ margin: 0,
2320
+ padding: 0,
2321
+ },
2322
+ _categoryModalMain: {
2323
+ width: WP(100),
2324
+ height: HP(50),
2325
+ backgroundColor: COLORS.whiteColor,
2326
+ borderTopRightRadius: TEXT_SIZES.BORDER_RADIUS,
2327
+ borderTopLeftRadius: TEXT_SIZES.BORDER_RADIUS,
2328
+ },
2329
+ _categoryModalHeader: {
2330
+ width: '100%',
2331
+ height: 50,
2332
+ flexDirection: 'row',
2333
+ justifyContent: 'space-between',
2334
+ alignItems: 'center',
2335
+ marginTop: 5,
2336
+ borderBottomColor: COLORS.darkGrey,
2337
+ borderBottomWidth: 0.7,
2338
+ paddingHorizontal: 20,
2339
+ },
2340
+ _categoryModalHeaderTitle: {
2341
+ fontFamily: FONT_MEDIUM,
2342
+ color: COLORS.redColor,
2343
+ fontSize: 15,
2344
+ },
2345
+ _categoryModalFooter: {
2346
+ width: '100%',
2347
+ height: 60,
2348
+ // backgroundColor:"green",
2349
+ flexDirection: 'row',
2350
+ justifyContent: 'space-between',
2351
+ alignItems: 'center',
2352
+ paddingHorizontal: 20,
2353
+ },
2354
+ _categoryModalBtn: {
2355
+ height: 45,
2356
+ width: '70%',
2357
+ backgroundColor: COLORS.redColor,
2358
+ justifyContent: 'center',
2359
+ alignItems: 'center',
2360
+ borderRadius: TEXT_SIZES.BORDER_RADIUS,
2361
+ flexDirection: 'row',
2362
+ justifyContent: 'center',
2363
+ alignSelf: 'center',
2364
+ gap: 20,
2365
+ },
2366
+ _categoryModalBtnTxt: {
2367
+ color: COLORS.whiteColor,
2368
+ fontFamily: FONT_MEDIUM,
2369
+ fontSize: 14,
2370
+ },
2371
+ _categoryCard: {
2372
+ width: '100%',
2373
+ height: 60,
2374
+ // backgroundColor: "red",
2375
+ flexDirection: 'row',
2376
+ // justifyContent:"center",
2377
+ alignItems: 'center',
2378
+ gap: 10,
2379
+ paddingHorizontal: 20,
2380
+ borderBottomColor: COLORS.gray,
2381
+ borderBottomWidth: 0.7,
2382
+ },
2383
+ _categoryCardText: {
2384
+ fontFamily: FONT_NORMAL,
2385
+ color: COLORS.darkGrey,
2386
+ fontSize: 15,
2387
+ },
2388
+ _categoryChip: {
2389
+ backgroundColor: COLORS.gray,
2390
+ paddingHorizontal: 10,
2391
+ height: '60%',
2392
+ flexDirection: 'row',
2393
+ justifyContent: 'center',
2394
+ alignItems: 'center',
2395
+ borderRadius: 100,
2396
+ borderColor: COLORS.darkGrey,
2397
+ borderWidth: 1,
2398
+ gap: 5,
2399
+ },
2400
+ _chipText: {
2401
+ color: COLORS.blackColor,
2402
+ fontFamily: FONT_NORMAL,
2403
+ fontSize: 13,
2404
+ },
2405
+ _addCategoryMain: {
2406
+ width: WP(100),
2407
+ // height: HP(25),
2408
+ backgroundColor: COLORS.whiteColor,
2409
+ borderTopRightRadius: TEXT_SIZES.BORDER_RADIUS,
2410
+ borderTopLeftRadius: TEXT_SIZES.BORDER_RADIUS,
2411
+ alignItems: 'center',
2412
+ gap: 20,
2413
+ },
2414
+ _changeModalMain: {
2415
+ width: WP(90),
2416
+ maxHeight: HP(75),
2417
+ backgroundColor: COLORS.whiteColor,
2418
+ },
2419
+ _changeModalHeader: {
2420
+ width: '100%',
2421
+ height: HP(6),
2422
+ backgroundColor: COLORS.redColor,
2423
+ justifyContent: 'center',
2424
+ alignItems: 'center',
2425
+ },
2426
+ _changeModalHeaderTxt: {
2427
+ color: COLORS.whiteColor,
2428
+ fontFamily: FONT_MEDIUM,
2429
+ fontSize: 14,
2430
+ },
2431
+ _modalSearchMain: {
2432
+ width: '100%',
2433
+ justifyContent: 'center',
2434
+ alignItems: 'center',
2435
+ marginVertical: 7.5,
2436
+ },
2437
+ _modalSearch: {
2438
+ width: '92%',
2439
+ height: 45,
2440
+ borderWidth: 1,
2441
+ borderColor: COLORS.gray,
2442
+ borderRadius: TEXT_SIZES.BORDER_RADIUS,
2443
+ paddingLeft: 10,
2444
+ fontFamily: FONT_NORMAL,
2445
+ fontSize: 13,
2446
+ color: COLORS.blackColor,
2447
+ },
2448
+ _avatarText: {
2449
+ fontFamily: FONT_NORMAL,
2450
+ fontSize: 16,
2451
+ color: COLORS.redColor,
2452
+ },
2453
+ _addContactBtn: {
2454
+ width: '92%',
2455
+ height: 50,
2456
+ // backgroundColor: "red",
2457
+ flexDirection: 'row',
2458
+ justifyContent: 'space-between',
2459
+ alignItems: 'center',
2460
+ },
2461
+ _contactsCardMain: {
2462
+ width: '92%',
2463
+ height: 50,
2464
+ // backgroundColor: "red",
2465
+ marginVertical: 10,
2466
+ flexDirection: 'row',
2467
+ justifyContent: 'space-between',
2468
+ alignItems: 'center',
2469
+ alignSelf: 'center',
2470
+ },
2471
+ _phoneInputMain: {
2472
+ width: '92%',
2473
+ // height:60,
2474
+ // backgroundColor:"red",
2475
+ alignItems: 'center',
2476
+ gap: 15,
2477
+ },
2478
+ });