digikhata-mashreq-sdk 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +37 -0
  3. package/lib/module/App.js +41 -0
  4. package/lib/module/App.js.map +1 -0
  5. package/lib/module/app/assets/Icons/Bill.png +0 -0
  6. package/lib/module/app/assets/Icons/Cash.png +0 -0
  7. package/lib/module/app/assets/Icons/Expense.png +0 -0
  8. package/lib/module/app/assets/Icons/Staff.png +0 -0
  9. package/lib/module/app/assets/Icons/Stock.png +0 -0
  10. package/lib/module/app/assets/images/bill.png +0 -0
  11. package/lib/module/app/assets/images/book.png +0 -0
  12. package/lib/module/app/assets/images/digiKhataSolo256.png +0 -0
  13. package/lib/module/app/assets/images/money.png +0 -0
  14. package/lib/module/app/assets/images/staff.png +0 -0
  15. package/lib/module/app/assets/images/stock.png +0 -0
  16. package/lib/module/app/assets/images/svgviewer-png-output-white.png +0 -0
  17. package/lib/module/app/components/Balance.js +153 -0
  18. package/lib/module/app/components/Balance.js.map +1 -0
  19. package/lib/module/app/components/CountryPhoneInput.js +271 -0
  20. package/lib/module/app/components/CountryPhoneInput.js.map +1 -0
  21. package/lib/module/app/components/Entries.js +89 -0
  22. package/lib/module/app/components/Entries.js.map +1 -0
  23. package/lib/module/app/components/SearchBar.js +70 -0
  24. package/lib/module/app/components/SearchBar.js.map +1 -0
  25. package/lib/module/app/components/Transaction.js +108 -0
  26. package/lib/module/app/components/Transaction.js.map +1 -0
  27. package/lib/module/app/components/User.js +109 -0
  28. package/lib/module/app/components/User.js.map +1 -0
  29. package/lib/module/app/components/index.js +10 -0
  30. package/lib/module/app/components/index.js.map +1 -0
  31. package/lib/module/app/database/clients.js +149 -0
  32. package/lib/module/app/database/clients.js.map +1 -0
  33. package/lib/module/app/database/database.js +9 -0
  34. package/lib/module/app/database/database.js.map +1 -0
  35. package/lib/module/app/database/schema.js +525 -0
  36. package/lib/module/app/database/schema.js.map +1 -0
  37. package/lib/module/app/navigation/BottomTabs/BottomTabs.js +29 -0
  38. package/lib/module/app/navigation/BottomTabs/BottomTabs.js.map +1 -0
  39. package/lib/module/app/navigation/Drawer/Drawer.js +13 -0
  40. package/lib/module/app/navigation/Drawer/Drawer.js.map +1 -0
  41. package/lib/module/app/navigation/HomeStack/HomeStack.js +36 -0
  42. package/lib/module/app/navigation/HomeStack/HomeStack.js.map +1 -0
  43. package/lib/module/app/navigation/Root.js +26 -0
  44. package/lib/module/app/navigation/Root.js.map +1 -0
  45. package/lib/module/app/navigation/index.js +7 -0
  46. package/lib/module/app/navigation/index.js.map +1 -0
  47. package/lib/module/app/redux/Store.js +10 -0
  48. package/lib/module/app/redux/Store.js.map +1 -0
  49. package/lib/module/app/redux/reducers/client/client_actions.js +2 -0
  50. package/lib/module/app/redux/reducers/client/client_actions.js.map +1 -0
  51. package/lib/module/app/redux/reducers/client/client_reducers.js +26 -0
  52. package/lib/module/app/redux/reducers/client/client_reducers.js.map +1 -0
  53. package/lib/module/app/redux/reducers/client/client_types.js +7 -0
  54. package/lib/module/app/redux/reducers/client/client_types.js.map +1 -0
  55. package/lib/module/app/screens/AddScreen.js +200 -0
  56. package/lib/module/app/screens/AddScreen.js.map +1 -0
  57. package/lib/module/app/screens/Banks.js +126 -0
  58. package/lib/module/app/screens/Banks.js.map +1 -0
  59. package/lib/module/app/screens/CustomerEntries.js +475 -0
  60. package/lib/module/app/screens/CustomerEntries.js.map +1 -0
  61. package/lib/module/app/screens/Customers.js +233 -0
  62. package/lib/module/app/screens/Customers.js.map +1 -0
  63. package/lib/module/app/screens/Entry.js +696 -0
  64. package/lib/module/app/screens/Entry.js.map +1 -0
  65. package/lib/module/app/screens/HomeScreen.js +176 -0
  66. package/lib/module/app/screens/HomeScreen.js.map +1 -0
  67. package/lib/module/app/screens/SelectBusiness.js +201 -0
  68. package/lib/module/app/screens/SelectBusiness.js.map +1 -0
  69. package/lib/module/app/screens/Splash.js +51 -0
  70. package/lib/module/app/screens/Splash.js.map +1 -0
  71. package/lib/module/app/screens/Suppliers.js +222 -0
  72. package/lib/module/app/screens/Suppliers.js.map +1 -0
  73. package/lib/module/app/screens/TransactionDetails.js +301 -0
  74. package/lib/module/app/screens/TransactionDetails.js.map +1 -0
  75. package/lib/module/app/screens/index.js +14 -0
  76. package/lib/module/app/screens/index.js.map +1 -0
  77. package/lib/module/app/themes/config.js +156 -0
  78. package/lib/module/app/themes/config.js.map +1 -0
  79. package/lib/module/app/utils/countries.json +1930 -0
  80. package/lib/module/declarations.d.js +2 -0
  81. package/lib/module/declarations.d.js.map +1 -0
  82. package/lib/module/index.js +5 -0
  83. package/lib/module/index.js.map +1 -0
  84. package/lib/module/package.json +1 -0
  85. package/lib/typescript/babel.config.d.ts +10 -0
  86. package/lib/typescript/babel.config.d.ts.map +1 -0
  87. package/lib/typescript/eslint.config.d.mts +3 -0
  88. package/lib/typescript/eslint.config.d.mts.map +1 -0
  89. package/lib/typescript/package.json +1 -0
  90. package/lib/typescript/src/App.d.ts +2 -0
  91. package/lib/typescript/src/App.d.ts.map +1 -0
  92. package/lib/typescript/src/app/components/Balance.d.ts +8 -0
  93. package/lib/typescript/src/app/components/Balance.d.ts.map +1 -0
  94. package/lib/typescript/src/app/components/CountryPhoneInput.d.ts +6 -0
  95. package/lib/typescript/src/app/components/CountryPhoneInput.d.ts.map +1 -0
  96. package/lib/typescript/src/app/components/Entries.d.ts +4 -0
  97. package/lib/typescript/src/app/components/Entries.d.ts.map +1 -0
  98. package/lib/typescript/src/app/components/SearchBar.d.ts +6 -0
  99. package/lib/typescript/src/app/components/SearchBar.d.ts.map +1 -0
  100. package/lib/typescript/src/app/components/Transaction.d.ts +11 -0
  101. package/lib/typescript/src/app/components/Transaction.d.ts.map +1 -0
  102. package/lib/typescript/src/app/components/User.d.ts +10 -0
  103. package/lib/typescript/src/app/components/User.d.ts.map +1 -0
  104. package/lib/typescript/src/app/components/index.d.ts +8 -0
  105. package/lib/typescript/src/app/components/index.d.ts.map +1 -0
  106. package/lib/typescript/src/app/database/clients.d.ts +9 -0
  107. package/lib/typescript/src/app/database/clients.d.ts.map +1 -0
  108. package/lib/typescript/src/app/database/database.d.ts +3 -0
  109. package/lib/typescript/src/app/database/database.d.ts.map +1 -0
  110. package/lib/typescript/src/app/database/schema.d.ts +2 -0
  111. package/lib/typescript/src/app/database/schema.d.ts.map +1 -0
  112. package/lib/typescript/src/app/navigation/BottomTabs/BottomTabs.d.ts +2 -0
  113. package/lib/typescript/src/app/navigation/BottomTabs/BottomTabs.d.ts.map +1 -0
  114. package/lib/typescript/src/app/navigation/Drawer/Drawer.d.ts +2 -0
  115. package/lib/typescript/src/app/navigation/Drawer/Drawer.d.ts.map +1 -0
  116. package/lib/typescript/src/app/navigation/HomeStack/HomeStack.d.ts +2 -0
  117. package/lib/typescript/src/app/navigation/HomeStack/HomeStack.d.ts.map +1 -0
  118. package/lib/typescript/src/app/navigation/Root.d.ts +2 -0
  119. package/lib/typescript/src/app/navigation/Root.d.ts.map +1 -0
  120. package/lib/typescript/src/app/navigation/index.d.ts +5 -0
  121. package/lib/typescript/src/app/navigation/index.d.ts.map +1 -0
  122. package/lib/typescript/src/app/redux/Store.d.ts +2 -0
  123. package/lib/typescript/src/app/redux/Store.d.ts.map +1 -0
  124. package/lib/typescript/src/app/redux/reducers/client/client_actions.d.ts +1 -0
  125. package/lib/typescript/src/app/redux/reducers/client/client_actions.d.ts.map +1 -0
  126. package/lib/typescript/src/app/redux/reducers/client/client_reducers.d.ts +3 -0
  127. package/lib/typescript/src/app/redux/reducers/client/client_reducers.d.ts.map +1 -0
  128. package/lib/typescript/src/app/redux/reducers/client/client_types.d.ts +5 -0
  129. package/lib/typescript/src/app/redux/reducers/client/client_types.d.ts.map +1 -0
  130. package/lib/typescript/src/app/screens/AddScreen.d.ts +5 -0
  131. package/lib/typescript/src/app/screens/AddScreen.d.ts.map +1 -0
  132. package/lib/typescript/src/app/screens/Banks.d.ts +2 -0
  133. package/lib/typescript/src/app/screens/Banks.d.ts.map +1 -0
  134. package/lib/typescript/src/app/screens/CustomerEntries.d.ts +5 -0
  135. package/lib/typescript/src/app/screens/CustomerEntries.d.ts.map +1 -0
  136. package/lib/typescript/src/app/screens/Customers.d.ts +4 -0
  137. package/lib/typescript/src/app/screens/Customers.d.ts.map +1 -0
  138. package/lib/typescript/src/app/screens/Entry.d.ts +5 -0
  139. package/lib/typescript/src/app/screens/Entry.d.ts.map +1 -0
  140. package/lib/typescript/src/app/screens/HomeScreen.d.ts +4 -0
  141. package/lib/typescript/src/app/screens/HomeScreen.d.ts.map +1 -0
  142. package/lib/typescript/src/app/screens/SelectBusiness.d.ts +4 -0
  143. package/lib/typescript/src/app/screens/SelectBusiness.d.ts.map +1 -0
  144. package/lib/typescript/src/app/screens/Splash.d.ts +4 -0
  145. package/lib/typescript/src/app/screens/Splash.d.ts.map +1 -0
  146. package/lib/typescript/src/app/screens/Suppliers.d.ts +4 -0
  147. package/lib/typescript/src/app/screens/Suppliers.d.ts.map +1 -0
  148. package/lib/typescript/src/app/screens/TransactionDetails.d.ts +5 -0
  149. package/lib/typescript/src/app/screens/TransactionDetails.d.ts.map +1 -0
  150. package/lib/typescript/src/app/screens/index.d.ts +12 -0
  151. package/lib/typescript/src/app/screens/index.d.ts.map +1 -0
  152. package/lib/typescript/src/app/themes/config.d.ts +63 -0
  153. package/lib/typescript/src/app/themes/config.d.ts.map +1 -0
  154. package/lib/typescript/src/index.d.ts +3 -0
  155. package/lib/typescript/src/index.d.ts.map +1 -0
  156. package/package.json +154 -0
  157. package/src/App.js +41 -0
  158. package/src/app/assets/Icons/Bill.png +0 -0
  159. package/src/app/assets/Icons/Cash.png +0 -0
  160. package/src/app/assets/Icons/Expense.png +0 -0
  161. package/src/app/assets/Icons/Staff.png +0 -0
  162. package/src/app/assets/Icons/Stock.png +0 -0
  163. package/src/app/assets/images/bill.png +0 -0
  164. package/src/app/assets/images/book.png +0 -0
  165. package/src/app/assets/images/digiKhataSolo256.png +0 -0
  166. package/src/app/assets/images/money.png +0 -0
  167. package/src/app/assets/images/staff.png +0 -0
  168. package/src/app/assets/images/stock.png +0 -0
  169. package/src/app/assets/images/svgviewer-png-output-white.png +0 -0
  170. package/src/app/components/Balance.js +122 -0
  171. package/src/app/components/CountryPhoneInput.js +286 -0
  172. package/src/app/components/Entries.js +75 -0
  173. package/src/app/components/SearchBar.js +64 -0
  174. package/src/app/components/Transaction.js +91 -0
  175. package/src/app/components/User.js +85 -0
  176. package/src/app/components/index.js +15 -0
  177. package/src/app/database/clients.js +207 -0
  178. package/src/app/database/database.js +9 -0
  179. package/src/app/database/schema.js +525 -0
  180. package/src/app/navigation/BottomTabs/BottomTabs.js +27 -0
  181. package/src/app/navigation/Drawer/Drawer.js +10 -0
  182. package/src/app/navigation/HomeStack/HomeStack.js +43 -0
  183. package/src/app/navigation/Root.js +32 -0
  184. package/src/app/navigation/index.js +9 -0
  185. package/src/app/redux/Store.js +9 -0
  186. package/src/app/redux/reducers/client/client_actions.js +0 -0
  187. package/src/app/redux/reducers/client/client_reducers.js +30 -0
  188. package/src/app/redux/reducers/client/client_types.js +5 -0
  189. package/src/app/screens/AddScreen.js +185 -0
  190. package/src/app/screens/Banks.js +151 -0
  191. package/src/app/screens/CustomerEntries.js +402 -0
  192. package/src/app/screens/Customers.js +240 -0
  193. package/src/app/screens/Entry.js +658 -0
  194. package/src/app/screens/HomeScreen.js +146 -0
  195. package/src/app/screens/SelectBusiness.js +177 -0
  196. package/src/app/screens/Splash.js +43 -0
  197. package/src/app/screens/Suppliers.js +228 -0
  198. package/src/app/screens/TransactionDetails.js +199 -0
  199. package/src/app/screens/index.js +23 -0
  200. package/src/app/themes/config.js +185 -0
  201. package/src/app/utils/countries.json +1930 -0
  202. package/src/declarations.d.ts +1 -0
  203. package/src/index.tsx +3 -0
@@ -0,0 +1,146 @@
1
+ import { View, Text, SafeAreaView, TouchableOpacity, StyleSheet } from 'react-native'
2
+ import React from 'react'
3
+ import LinearGradient from 'react-native-linear-gradient';
4
+ import { COLORS, FONT_MEDIUM, FONT_NORMAL, HP, WP } from '../themes/config';
5
+ import Ionicons from 'react-native-vector-icons/Ionicons';
6
+ import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
7
+ import { Banks, Customers, Suppliers } from "../screens";
8
+ import { TabView, SceneMap } from 'react-native-tab-view';
9
+ import { useSelector, useDispatch } from "react-redux";
10
+
11
+
12
+ const Tab = createMaterialTopTabNavigator();
13
+
14
+ export default function HomeScreen({ navigation }) {
15
+
16
+ const [index, setIndex] = React.useState(0);
17
+ const clients = useSelector(state => state.client.home_customers);
18
+
19
+ return (
20
+ <SafeAreaView style={Styles._mainContainer}>
21
+ <LinearGradient
22
+ colors={[COLORS.primaryColor, COLORS.secondaryColor]}
23
+ style={Styles._headerMain}
24
+ start={{ x: 0, y: 0 }}
25
+ end={{ x: 1, y: 0 }}
26
+ >
27
+ <View style={Styles._headerTop}>
28
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 15 }}>
29
+ <Ionicons
30
+ name={"menu"}
31
+ color={COLORS.whiteColor}
32
+ size={30}
33
+ />
34
+ <TouchableOpacity
35
+ style={{ flexDirection: "row", alignItems: "center" }}
36
+ activeOpacity={0.8}
37
+ onPress={() => { navigation.navigate("SelectBusiness") }}
38
+ >
39
+ <Text style={Styles._headerTitle}>Saud Rehan</Text>
40
+ <Ionicons
41
+ name={"chevron-down"}
42
+ color={COLORS.whiteColor}
43
+ size={20}
44
+ />
45
+ </TouchableOpacity>
46
+ </View>
47
+
48
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 15 }}>
49
+ <TouchableOpacity style={Styles._collectionBtn} activeOpacity={0.8}>
50
+ <Ionicons
51
+ name={"notifications"}
52
+ color={COLORS.yellowColor}
53
+ size={18}
54
+ />
55
+ <Text style={{ color: COLORS.blackColor, fontSize: 8, fontFamily: FONT_MEDIUM }}>COLLECTION</Text>
56
+ </TouchableOpacity>
57
+
58
+ <Ionicons
59
+ name={"help-circle-outline"}
60
+ color={COLORS.whiteColor}
61
+ size={30}
62
+ />
63
+ </View>
64
+ </View>
65
+
66
+
67
+
68
+ </LinearGradient>
69
+ <View style={{ height: "100%", marginTop: 10, position: "absolute", marginTop: HP(5), width: WP(100) }}>
70
+ <Tab.Navigator
71
+ screenOptions={{
72
+ tabBarIndicatorStyle: {
73
+ backgroundColor: COLORS.whiteColor,
74
+ height: 5,
75
+ borderRadius: 200,
76
+ marginLeft: 10,
77
+ },
78
+ tabBarLabelStyle: {
79
+ fontSize: 13,
80
+ color: "#fff",
81
+ },
82
+ tabBarStyle: {
83
+ backgroundColor: "transparent",
84
+ },
85
+ tabBarItemStyle: {
86
+ width: 80,
87
+ padding: 0,
88
+ },
89
+ tabBarContentContainerStyle: {
90
+ marginLeft: 10,
91
+ marginBottom: 0
92
+
93
+ },
94
+ }}
95
+ >
96
+ <Tab.Screen name="Customers" component={Customers} />
97
+ <Tab.Screen name="Suppliers" component={Suppliers} />
98
+ {/* <Tab.Screen name="Banks" component={Banks} /> */}
99
+ <Tab.Screen name="All" component={Banks} />
100
+ </Tab.Navigator>
101
+ </View>
102
+ </SafeAreaView>
103
+
104
+ )
105
+ }
106
+
107
+ const Styles = StyleSheet.create({
108
+ _mainContainer: {
109
+ flex: 1,
110
+ backgroundColor: COLORS.backgroundColor,
111
+ },
112
+ _headerMain: {
113
+ width: WP(100),
114
+ height: 100,
115
+ // backgroundColor:COLORS.primaryColor,
116
+ // justifyContent: 'center',
117
+ alignItems: 'center',
118
+ // position: "absolute",
119
+ },
120
+ _headerTop: {
121
+ width: WP(100),
122
+ // height: "35%",
123
+ // backgroundColor: "red",
124
+ flexDirection: "row",
125
+ justifyContent: "space-between",
126
+ alignItems: "center",
127
+ paddingHorizontal: 15,
128
+ marginVertical: 10,
129
+ // marginTop: 10
130
+ },
131
+ _headerTitle: {
132
+ color: COLORS.whiteColor,
133
+ fontSize: 14,
134
+ fontFamily: FONT_MEDIUM
135
+ },
136
+ _collectionBtn: {
137
+ width: 95,
138
+ height: 30,
139
+ backgroundColor: COLORS.whiteColor,
140
+ borderRadius: 5,
141
+ flexDirection: "row",
142
+ justifyContent: "space-between",
143
+ alignItems: "center",
144
+ paddingHorizontal: 8,
145
+ },
146
+ })
@@ -0,0 +1,177 @@
1
+ import { View, Text, StyleSheet, TouchableOpacity, TextInput, Image } from 'react-native'
2
+ import React from 'react'
3
+ import { COLORS, FONT_MEDIUM, FONT_NORMAL, WP } from '../themes/config'
4
+ import LinearGradient from 'react-native-linear-gradient'
5
+ import Ionicons from "react-native-vector-icons/Ionicons"
6
+ import { CountryPhoneInput } from '../components'
7
+
8
+ export default function SelectBusiness({ navigation }) {
9
+ return (
10
+ <View style={Styles._mainContainers}>
11
+ <LinearGradient
12
+ start={{ x: 0, y: 0 }}
13
+ end={{ x: 1, y: 0 }}
14
+ colors={[COLORS.primaryColor, COLORS.secondaryColor]}
15
+ style={Styles._linearGradient}
16
+ >
17
+ <View style={Styles._titleMain}>
18
+ <TouchableOpacity
19
+ activeOpacity={0.8}
20
+ onPress={() => { navigation.goBack() }}
21
+ >
22
+ <Ionicons
23
+ name={"chevron-back"}
24
+ color={COLORS.whiteColor}
25
+ size={20}
26
+ />
27
+ </TouchableOpacity>
28
+
29
+ <Text style={Styles._title}>Select Business</Text>
30
+ </View>
31
+ </LinearGradient>
32
+
33
+ <View style={Styles._contentMain}>
34
+ <View style={{ width: "100%", alignItems: "center", gap: 12 }}>
35
+ <View style={Styles.businessMain}>
36
+ <View style={{ flexDirection: "row", gap: 10 }}>
37
+ <Image
38
+ source={require("../assets/images/digiKhataSolo256.png")}
39
+ resizeMode='contain'
40
+ style={Styles._logo}
41
+ />
42
+ <View>
43
+ <Text style={Styles._txt}>Saud Rehan</Text>
44
+ <Text style={Styles._txt2}>12 Customers</Text>
45
+ </View>
46
+ </View>
47
+
48
+ <View style={{ flexDirection: "row", gap: 10 }}>
49
+ <Ionicons
50
+ name={"checkmark"}
51
+ color={COLORS.primaryColor}
52
+ size={20}
53
+ />
54
+
55
+ <Ionicons
56
+ name={"ellipsis-vertical"}
57
+ color={COLORS.grey}
58
+ size={20}
59
+ />
60
+ </View>
61
+ </View>
62
+ </View>
63
+
64
+ <TouchableOpacity
65
+ activeOpacity={0.8}
66
+ style={Styles._continueBtn}
67
+ >
68
+ <Text style={Styles._continueBtnTxt}>Add New Business</Text>
69
+ </TouchableOpacity>
70
+ </View>
71
+ </View>
72
+ )
73
+ }
74
+
75
+ const Styles = StyleSheet.create({
76
+ _mainContainers: {
77
+ flex: 1,
78
+ backgroundColor: COLORS.backgroundColor,
79
+ alignItems: "center"
80
+ },
81
+ _linearGradient: {
82
+ width: WP(100),
83
+ height: 80,
84
+ alignItems: "center",
85
+ },
86
+ _titleMain: {
87
+ width: WP(94),
88
+ height: 30,
89
+ // backgroundColor: "red",
90
+ flexDirection: "row",
91
+ alignItems: "center",
92
+ marginTop: 10
93
+ },
94
+ _title: {
95
+ color: COLORS.whiteColor,
96
+ fontFamily: FONT_NORMAL,
97
+ fontSize: 15,
98
+ marginLeft: 15
99
+ },
100
+ _contentMain: {
101
+ width: WP(94),
102
+ height: "90%",
103
+ backgroundColor: COLORS.whiteColor,
104
+ position: "absolute",
105
+ top: 50,
106
+ shadowColor: "#000",
107
+ shadowOffset: {
108
+ width: 0,
109
+ height: 2,
110
+ },
111
+ shadowOpacity: 0.2,
112
+ shadowRadius: 3.84,
113
+ elevation: 5,
114
+ borderRadius: 10,
115
+ alignItems: "center",
116
+ justifyContent: "space-between",
117
+ paddingVertical: 12,
118
+ },
119
+ _input: {
120
+ width: "95%",
121
+ height: 50,
122
+ backgroundColor: COLORS.whiteColor,
123
+ borderRadius: 15,
124
+ paddingLeft: 12,
125
+ borderColor: COLORS.grey,
126
+ borderWidth: 1,
127
+ color: COLORS.blackColor,
128
+ fontFamily: FONT_NORMAL,
129
+ fontSize: 13
130
+ },
131
+ _continueBtn: {
132
+ width: "95%",
133
+ height: 50,
134
+ backgroundColor: COLORS.primaryColor,
135
+ borderRadius: 100,
136
+ justifyContent: "center",
137
+ alignItems: "center",
138
+ },
139
+ _continueBtnTxt: {
140
+ color: COLORS.whiteColor,
141
+ fontFamily: FONT_NORMAL,
142
+ fontSize: 17
143
+ },
144
+ businessMain: {
145
+ width: "95%",
146
+ height: 60,
147
+ backgroundColor: COLORS.whiteColor,
148
+ shadowColor: "#000",
149
+ shadowOffset: {
150
+ width: 0,
151
+ height: 2,
152
+ },
153
+ shadowOpacity: 0.2,
154
+ shadowRadius: 3.84,
155
+ elevation: 5,
156
+ borderRadius: 10,
157
+ flexDirection: "row",
158
+ alignItems: "center",
159
+ justifyContent: "space-between",
160
+ paddingHorizontal: 10
161
+ },
162
+ _logo: {
163
+ width: 30,
164
+ height: 30,
165
+ },
166
+ _txt: {
167
+ color: COLORS.blackColor,
168
+ fontFamily: FONT_MEDIUM,
169
+ fontSize: 13
170
+ },
171
+ _txt2: {
172
+ color: COLORS.blackColor,
173
+ opacity: 0.6,
174
+ fontFamily: FONT_NORMAL,
175
+ fontSize: 11
176
+ },
177
+ })
@@ -0,0 +1,43 @@
1
+ import { View, Text, Image } from 'react-native'
2
+ import React, { useEffect } from 'react'
3
+ import LinearGradient from 'react-native-linear-gradient'
4
+ import { COLORS } from '../themes/config'
5
+ import { getClientsByType } from '../database/clients'
6
+ import { useDispatch } from "react-redux";
7
+ import { HOME_CUSTOMERS, HOME_SUPPLIERS } from '../redux/reducers/client/client_types'
8
+
9
+ export default function Splash({ navigation }) {
10
+
11
+ const dispatch = useDispatch();
12
+
13
+ useEffect(() => {
14
+ setTimeout(() => {
15
+ navigation.replace('bottomTabs');
16
+
17
+ getClientsByType(0).then(clients => {
18
+ dispatch({ type: HOME_CUSTOMERS, payload: clients });
19
+ console.log("Clients:", clients);
20
+ }).catch(err => console.error(err));
21
+
22
+ getClientsByType(1).then(clients => {
23
+ dispatch({ type: HOME_SUPPLIERS, payload: clients });
24
+ console.log("Suppliers:", clients);
25
+ }).catch(err => console.error(err));
26
+
27
+
28
+ }, 2000);
29
+ }, [])
30
+
31
+ return (
32
+ <LinearGradient
33
+ style={{ flex: 1, justifyContent: "center", alignItems: "center" }}
34
+ colors={[COLORS.primaryColor, COLORS.secondaryColor]}
35
+ >
36
+ <Image
37
+ source={require("../assets/images/svgviewer-png-output-white.png")}
38
+ resizeMode='contain'
39
+ style={{ width: 170, height: 170 }}
40
+ />
41
+ </LinearGradient>
42
+ )
43
+ }
@@ -0,0 +1,228 @@
1
+ import { View, Text, StyleSheet, TouchableOpacity, ScrollView } from 'react-native'
2
+ import React, { useEffect } from 'react'
3
+ import { COLORS, FONT_NORMAL, formatDateTime, HP, WP } from '../themes/config'
4
+ import { Balance, Entries, SearchBar, User } from '../components'
5
+ import Ionicons from "react-native-vector-icons/Ionicons"
6
+ import FontAwesome6 from "react-native-vector-icons/FontAwesome6"
7
+ import LinearGradient from 'react-native-linear-gradient'
8
+ import { getAllClients, getClientDetails, getClientsByType } from '../database/clients';
9
+ import { useSelector, useDispatch } from "react-redux";
10
+ import { CLIENT_DETAILS, HOME_SUPPLIERS, SUPPLIER_DETAILS } from '../redux/reducers/client/client_types'
11
+
12
+ export default function Suppliers({ navigation }) {
13
+
14
+ const dispatch = useDispatch();
15
+ const suppliers = useSelector(state => state.client.home_suppliers);
16
+
17
+ useEffect(() => {
18
+ const unsubscribe = navigation.addListener('focus', () => {
19
+ getClientsByType(1).then(clients => {
20
+ dispatch({ type: HOME_SUPPLIERS, payload: clients });
21
+ console.log("Suppliers:", clients);
22
+ }).catch(err => console.error(err));
23
+ });
24
+ return () => unsubscribe();
25
+ }, [navigation]);
26
+
27
+ const totalSubamountSum = suppliers?.reduce(
28
+ (sum, item) => sum + (parseFloat(item?.total_subamount) || 0),
29
+ 0
30
+ );
31
+
32
+ const totalAmountSum = suppliers?.reduce(
33
+ (sum, item) => sum + (parseFloat(item?.total_amount) || 0),
34
+ 0
35
+ );
36
+
37
+ // Step 2: Difference
38
+ let finalAmount = totalSubamountSum - totalAmountSum;
39
+
40
+ let type = "none";
41
+ if (finalAmount > 0) {
42
+ type = "receivable";
43
+ } else if (finalAmount < 0) {
44
+ type = "payable";
45
+ }
46
+
47
+ finalAmount = Math.abs(finalAmount);
48
+
49
+
50
+ return (
51
+ <View style={Styles._mainContainer}>
52
+ <ScrollView
53
+ contentContainerStyle={{ alignItems: "center", paddingBottom: 60 }}
54
+ showsVerticalScrollIndicator={false}
55
+ >
56
+ <Balance
57
+ greenValue={totalSubamountSum}
58
+ greenTitle={"Total purchase of Sep"}
59
+ redTitle={type == "payable" ? "Received" : "You will give"}
60
+ redValue={finalAmount}
61
+ rightColor={type == "payable" ? "red" : "green"}
62
+ />
63
+ <Entries marginTop={85} />
64
+
65
+ <View style={Styles._contentMain}>
66
+ <View style={Styles._searchMain}>
67
+ <View style={Styles._inputMain}>
68
+ <SearchBar />
69
+ </View>
70
+
71
+ <View style={Styles._filterMain}>
72
+ <TouchableOpacity
73
+ activeOpacity={0.8}
74
+ style={Styles._filterBtn}
75
+ >
76
+ <Ionicons
77
+ name={"funnel-outline"}
78
+ color={COLORS.primaryColor}
79
+ size={27}
80
+ />
81
+ </TouchableOpacity>
82
+
83
+ <TouchableOpacity
84
+ activeOpacity={0.8}
85
+ style={Styles._filterBtn}
86
+ >
87
+ <FontAwesome6
88
+ name={"file-pdf"}
89
+ color={COLORS.primaryColor}
90
+ size={23}
91
+ />
92
+ </TouchableOpacity>
93
+ </View>
94
+ </View>
95
+
96
+ <View>
97
+ {
98
+ suppliers?.map((item, index) => {
99
+ let amount = item?.total_subamount - item?.total_amount;
100
+
101
+ let type = "none";
102
+ if (amount > 0) {
103
+ type = "receivable";
104
+ } else if (amount < 0) {
105
+ type = "payable";
106
+ }
107
+
108
+ amount = Math.abs(amount);
109
+
110
+ // console.log({amount,type})
111
+
112
+ return (
113
+ <User
114
+ key={index}
115
+ name={item?.name}
116
+ addedAt={formatDateTime(item?.latest_updated_at)}
117
+ amount={amount}
118
+ type={type}
119
+ clientType={item?.type}
120
+ avatarColor={"green"}
121
+ onPress={() => {
122
+ getClientDetails(item?.id).then((res) => {
123
+ dispatch({
124
+ type: CLIENT_DETAILS,
125
+ payload: res
126
+ })
127
+ navigation.navigate("CustomerEntries", { homeDetails: item })
128
+ })
129
+ }}
130
+ />
131
+ );
132
+ })
133
+ }
134
+
135
+ </View>
136
+ </View>
137
+ </ScrollView>
138
+
139
+ <TouchableOpacity
140
+ style={Styles._floatingBtn}
141
+ activeOpacity={0.8}
142
+ onPress={() => {
143
+ navigation.navigate("AddScreen", { type: 1 });
144
+ }}
145
+ >
146
+ <LinearGradient start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }} colors={["darkgreen", "green"]} style={Styles._linearGradient}>
147
+ <Ionicons
148
+ name={"person-add-outline"}
149
+ color={COLORS.whiteColor}
150
+ size={22}
151
+ style={{ paddingLeft: 10 }}
152
+ />
153
+
154
+ <Text style={Styles._fabTxt}>ADD SUPPLIER</Text>
155
+ </LinearGradient>
156
+ </TouchableOpacity>
157
+ </View>
158
+ )
159
+ }
160
+
161
+
162
+ const Styles = StyleSheet.create({
163
+ _mainContainer: {
164
+ flex: 1,
165
+ backgroundColor: COLORS.backgroundColor,
166
+ alignItems: "center",
167
+ },
168
+ _contentMain: {
169
+ width: WP(100),
170
+ // height: 30,
171
+ backgroundColor: COLORS.whiteColor,
172
+ paddingHorizontal: 15,
173
+ marginTop: 6
174
+ },
175
+ _searchMain: {
176
+ width: "100%",
177
+ flexDirection: "row",
178
+ // height:40,
179
+ paddingVertical: 20
180
+ },
181
+ _inputMain: {
182
+ width: "75%"
183
+ },
184
+ _filterMain: {
185
+ flexDirection: "row",
186
+ alignItems: "center",
187
+ justifyContent: "center",
188
+ gap: 11,
189
+ paddingLeft: 10
190
+ },
191
+ _filterBtn: {
192
+ width: 35,
193
+ height: 35,
194
+ justifyContent: "center",
195
+ alignItems: "center"
196
+ // backgroundColor:"red"
197
+ },
198
+ _floatingBtn: {
199
+ width: WP(38),
200
+ height: 42,
201
+ position: "absolute",
202
+ right: 12,
203
+ bottom: 70,
204
+ borderRadius: 40,
205
+ overflow: "hidden",
206
+ shadowColor: "#000",
207
+ shadowOffset: {
208
+ width: 0,
209
+ height: 2,
210
+ },
211
+ shadowOpacity: 0.2,
212
+ shadowRadius: 3.84,
213
+ elevation: 5,
214
+ },
215
+ _linearGradient: {
216
+ width: "100%",
217
+ height: "100%",
218
+ flexDirection: "row",
219
+ justifyContent: "space-between",
220
+ alignItems: "center",
221
+ },
222
+ _fabTxt: {
223
+ color: COLORS.whiteColor,
224
+ fontSize: 12,
225
+ fontFamily: FONT_NORMAL,
226
+ paddingRight: 10,
227
+ },
228
+ })