@jescon-technologies/react-native-ui-kit 0.0.4 → 0.0.6

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 (178) hide show
  1. package/index.d.ts +66 -0
  2. package/index.js +3 -7
  3. package/package.json +3 -2
  4. package/src/Alerts/AAlert.js +4 -4
  5. package/src/Alerts/AAlertIOS.js +3 -3
  6. package/src/{common → Common}/NetworkServiceCall.js +1 -1
  7. package/src/CommonStyle/CommonTheme.js +11 -0
  8. package/src/CommonStyle/ComponentFunctions.js +632 -0
  9. package/src/CommonStyle/PopupStyle.js +146 -0
  10. package/src/CommonStyle/commonStyle.js +93 -0
  11. package/src/CommonStyle/componentStyle.js +545 -0
  12. package/src/CommonStyle/optionListStyles.js +175 -0
  13. package/src/Components/ByProductPage.js +200 -0
  14. package/src/Components/CDropDownListNew.js +153 -0
  15. package/src/Components/CSupplierList.js +88 -0
  16. package/src/Components/CVerificationCard.js +2822 -0
  17. package/src/Components/CustomButton.js +67 -0
  18. package/src/Components/CustomCard.js +127 -0
  19. package/src/Components/CustomTextInput.js +47 -0
  20. package/src/Components/EquipmentPage.js +313 -0
  21. package/src/Components/FilterInput.Copy.js +723 -0
  22. package/src/Components/FilterInput.js +569 -0
  23. package/src/Components/HSubHeading.js +68 -0
  24. package/src/Components/HeaderCard.js +40 -0
  25. package/src/Components/MoreOptionsScreen.js +251 -0
  26. package/src/Components/NonSwipableProductCard.js +226 -0
  27. package/src/Components/NonSwipableSupplierCard.js +348 -0
  28. package/src/Components/ProductCard.js +1336 -0
  29. package/src/Components/QualityProductCard.js +1059 -0
  30. package/src/Components/RateProductCard.js +1452 -0
  31. package/src/Components/RawMaterial.js +261 -0
  32. package/src/Components/SDropDownEdited.js +549 -0
  33. package/src/Components/SDropDownNew.js +529 -0
  34. package/src/Components/SHelpDescription.js +147 -0
  35. package/src/Components/STextInputNew.js +510 -0
  36. package/src/Components/SearchProductCard.js +470 -0
  37. package/src/Components/StageByProduct.js +199 -0
  38. package/src/Components/SupplierCard.js +243 -0
  39. package/src/Components/SupplierInvoiceCard.js +405 -0
  40. package/src/Components/SwipableSupplierCard.js +136 -0
  41. package/src/Components/TagTemplate.js +74 -0
  42. package/src/Components/WrappedComponent.js +25 -0
  43. package/src/Custom/CBooking.js +944 -0
  44. package/src/Custom/CBookingPostpone.js +1822 -0
  45. package/src/Custom/CCalendar.js +560 -0
  46. package/src/Custom/CCard.js +880 -0
  47. package/src/Custom/CDetailCard.js +205 -0
  48. package/src/Custom/CHelpImage.js +52 -0
  49. package/src/Custom/CReport.js +569 -0
  50. package/src/Custom/CScrollView.js +73 -0
  51. package/src/Custom/CSignature.js +112 -0
  52. package/src/Custom/CSliderMenu.js +339 -0
  53. package/src/Custom/CSupplierCard.js +99 -0
  54. package/src/Custom/CTemplateCard.js +438 -0
  55. package/src/Custom/CTokenAllocation.js +1402 -0
  56. package/src/Custom/CTokenListOverlay.js +122 -0
  57. package/src/Custom/CWardStatus.js +444 -0
  58. package/src/Custom/Charts/CBarChart.js +218 -0
  59. package/src/Custom/Charts/CDashBoardList.js +133 -0
  60. package/src/Custom/Charts/CDashBoardTable.js +172 -0
  61. package/src/Custom/Charts/CLineChart.js +193 -0
  62. package/src/Custom/Charts/CPieChart.js +186 -0
  63. package/src/Custom/Loader.js +182 -0
  64. package/src/Custom/OUserView.js +1121 -0
  65. package/src/Custom/PreviewDosage.js +115 -0
  66. package/src/Custom/SearchLoader.js +32 -0
  67. package/src/Custom/TableComponent/CActivityTable.js +707 -0
  68. package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
  69. package/src/Custom/TableComponent/CTable.js +185 -0
  70. package/src/Custom/TableComponent/CTextBody.js +40 -0
  71. package/src/Custom/TableComponent/CTextHeader.js +17 -0
  72. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
  73. package/src/Custom/TableComponent/SDropdownTable.js +491 -0
  74. package/src/Custom/TableComponent/TagTable.js +1200 -0
  75. package/src/CustomComponents/CAddColumn.js +140 -0
  76. package/src/CustomComponents/CAssessmentDelete.js +307 -0
  77. package/src/CustomComponents/CAwesomeButton.js +83 -0
  78. package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
  79. package/src/CustomComponents/CBackHandler.js +273 -0
  80. package/src/CustomComponents/CCalendar.js +243 -0
  81. package/src/CustomComponents/CCommentOverlay.js +202 -0
  82. package/src/CustomComponents/CComments.js +162 -0
  83. package/src/CustomComponents/CContainerView.js +24 -0
  84. package/src/CustomComponents/CCustomTextInput.js +336 -0
  85. package/src/CustomComponents/CDetailView.js +40 -0
  86. package/src/CustomComponents/CDropDownList.js +153 -0
  87. package/src/CustomComponents/CDropdownSelect.js +555 -0
  88. package/src/CustomComponents/CFooterView.js +42 -0
  89. package/src/CustomComponents/CImagePickerSave.js +316 -0
  90. package/src/CustomComponents/CModalOverlay.js +91 -0
  91. package/src/CustomComponents/CNetworkStatus.js +327 -0
  92. package/src/CustomComponents/CNotesInstructions.js +1000 -0
  93. package/src/CustomComponents/COverlay.js +81 -0
  94. package/src/CustomComponents/CRemarks.js +176 -0
  95. package/src/CustomComponents/CRowAdd.js +143 -0
  96. package/src/CustomComponents/CSummaryDropDown.js +327 -0
  97. package/src/CustomComponents/CText.js +9 -0
  98. package/src/CustomComponents/CVectorIcon.js +34 -0
  99. package/src/CustomComponents/HtmlContentViewer.js +65 -0
  100. package/src/CustomComponents/PdfContentViewer.js +90 -0
  101. package/src/CustomComponents/SDropDownDosage.js +1087 -0
  102. package/src/CustomComponents/SwipableProductCard.js +246 -0
  103. package/src/CustomComponents/SwipableProductImageCard.js +254 -0
  104. package/src/CustomComponents/WorkOrderDetails.js +1216 -0
  105. package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
  106. package/src/HOC/ConfirmOverlay.js +2 -2
  107. package/src/HOC/HMoreButton.js +1 -1
  108. package/src/HOC/HNatureHeading.js +1 -1
  109. package/src/HOC/HShadowButton.js +1 -1
  110. package/src/HOC/HShadowCountButton.js +1 -1
  111. package/src/Json/Chart.json +818 -0
  112. package/src/Json/Consultation.json +622 -0
  113. package/src/Json/CreditBill.json +490 -0
  114. package/src/Json/Dropdown.json +216 -0
  115. package/src/Json/DropdownConsultation.json +228 -0
  116. package/src/Json/DynamicReports.json +623 -0
  117. package/src/Json/Footer.json +79 -0
  118. package/src/Media/AudioScreen.js +2 -7
  119. package/src/Media/CCaptureImageWithoutEdit.js +1 -1
  120. package/src/Media/CImageGallery.js +2 -2
  121. package/src/Media/CSingleImage.js +2 -2
  122. package/src/Media/CVideoPlay.js +1 -1
  123. package/src/Media/DocumentScreen.js +2 -7
  124. package/src/Media/DrawingScreen.js +2 -6
  125. package/src/Media/ImageScreen.js +2 -6
  126. package/src/Media/RecordAudio.js +1 -1
  127. package/src/Media/VideoScreen.js +2 -7
  128. package/src/Navigation/PageNavigation.js +224 -0
  129. package/src/Navigation/useFocusEffect.js +2 -0
  130. package/src/Navigation/useFocusEffect.native.js +1 -0
  131. package/src/Navigation/useFocusEffect.web.js +1 -0
  132. package/src/Navigation/useIsFocused.js +1 -0
  133. package/src/Navigation/useIsFocused.native.js +1 -0
  134. package/src/Navigation/useIsFocused.web.js +1 -0
  135. package/src/Navigation/useNavigation.js +2 -0
  136. package/src/Navigation/useNavigation.native.js +1 -0
  137. package/src/Navigation/useNavigation.web.js +1 -0
  138. package/src/Screens/CMedications.js +528 -0
  139. package/src/Screens/CWebViewGallery.js +203 -0
  140. package/src/Screens/ChartScan.js +279 -0
  141. package/src/Screens/ChartScreenNew.js +1579 -0
  142. package/src/Screens/Consultation.js +1500 -0
  143. package/src/Screens/Dashboard.js +778 -0
  144. package/src/Screens/FileExplorer.js +288 -0
  145. package/src/Screens/Footer.js +340 -0
  146. package/src/Screens/ForgotPassword.js +288 -0
  147. package/src/Screens/HeaderBlock.js +353 -0
  148. package/src/Screens/Login.js +328 -0
  149. package/src/Screens/Notification.js +149 -0
  150. package/src/Screens/OcrScreen.js +20 -0
  151. package/src/Screens/PdfPreview.js +507 -0
  152. package/src/Screens/RegistrationDetails.js +467 -0
  153. package/src/Screens/SearchScreen.js +582 -0
  154. package/src/Screens/Splash.js +788 -0
  155. package/src/Screens/SwipeLeftView.js +1867 -0
  156. package/src/StaticComponents/SDatePickerLabel.js +1 -1
  157. package/src/StaticComponents/SDatePickerNew.js +1 -1
  158. package/src/StaticComponents/SDateTimePickerNew.js +2 -2
  159. package/src/StaticComponents/SDropDownGenerate.js +3 -3
  160. package/src/StaticComponents/SDropDownHoc.js +4 -4
  161. package/src/StaticComponents/SDropDownIcon.js +1 -1
  162. package/src/StaticComponents/SMenuBox.js +2 -2
  163. package/src/StaticComponents/SSearch.js +2 -2
  164. package/src/StaticComponents/STextInput.js +1 -1
  165. package/src/StaticComponents/STimePicker.js +1 -1
  166. package/src/StaticComponents/STimingDropDownNew.js +2 -6
  167. package/src/StaticComponents/STimingSwitch.js +1 -1
  168. package/src/layout/CContainerView.js +1 -1
  169. package/src/layout/CDetailView.js +3 -3
  170. package/src/layout/HeaderBlock.js +5 -5
  171. package/src/layout/INVLoginLayout.js +3 -4
  172. package/src/layout/Loader.js +2 -2
  173. package/src/HOC/HAbsolute.js +0 -56
  174. package/src/HOC/HDiscontinue.js +0 -105
  175. package/src/HOC/HOverlay.js +0 -99
  176. package/src/layout/FooterBlock.js +0 -821
  177. /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
  178. /package/src/{common → Common}/Icons.js +0 -0
@@ -0,0 +1,1216 @@
1
+ import {
2
+ View,
3
+ Text,
4
+ BackHandler,
5
+ Dimensions,
6
+ ScrollView,
7
+ TouchableOpacity,
8
+ } from 'react-native';
9
+ import React, { useContext, useEffect, useState } from 'react';
10
+ import CDetailView from '../CustomComponents/CDetailView';
11
+ import HeaderBlock from '../Screens/HeaderBlock';
12
+ import { useNavigation } from '../Navigation/useNavigation';
13
+
14
+ import ContextBio from '../ContextAPI/ContextBio';
15
+ import ConfirmOverlay from '../HOC/ConfirmOverlay';
16
+ import { CButtonShadow, getLoading, notifyMessage } from '../CommonStyle/ComponentFunctions';
17
+ import Loader from '../Custom/Loader';
18
+ import { normalize } from '../CommonStyle/componentStyle';
19
+ import CFooterView from '../CustomComponents/CFooterView';
20
+ import CustomButton from '../Components/CustomButton';
21
+ import { Global } from '../../../../../src/Common/Global';
22
+ import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
23
+ import { APIURL } from '../../../../../src/Common/apiConstants';
24
+ import CContainerView from '../CustomComponents/CContainerView';
25
+ import CTextHeader from '../Custom/TableComponent/CTextHeader';
26
+ import STextInput from '../StaticComponents/STextInput';
27
+ import SDropDownIcon from '../StaticComponents/SDropDownIcon';
28
+ import SDropDownNew from '../Components/SDropDownNew';
29
+
30
+ import HOverlay from '../HOC/HOverlay';
31
+ import STextInputNew from '../Components/STextInputNew';
32
+ import HHeading from '../HOC/HHeading';
33
+ import HShadowCountButton from '../HOC/HShadowCountButton';
34
+
35
+ export default function WorkOrderDetails({ route }) {
36
+ const { orderIndex } = route.params || {};
37
+ const { invoiceData, setInvoiceData } = useContext(ContextBio);
38
+ const navigation = useNavigation();
39
+ const [backHandler, setBackHandler] = useState(false);
40
+ const [isLoading, setIsLoading] = useState(false);
41
+ const [loading, setLoading] = useState(false);
42
+ const [overlay, setOverlay] = useState(false);
43
+ const [overlayComponent, setOverlayComponent] = useState('');
44
+
45
+ const workOrder = invoiceData.workOrder[orderIndex];
46
+
47
+ const FooterArr = [
48
+ {
49
+ keyid: 1,
50
+ displaytext: 'Save',
51
+ size: 10,
52
+ iconname: 'save',
53
+ iconcolor: '#a30e0e',
54
+ fontcolor: '#a30e0e',
55
+ shadowcolor: '#ffe5e5',
56
+ selected: false,
57
+ visibility: true,
58
+ iconsize: 20,
59
+ functionid: 'D01',
60
+ count: false,
61
+ countValue: 0,
62
+ },
63
+ {
64
+ keyid: 2,
65
+ displaytext: 'Preview',
66
+ size: 10,
67
+ iconname: 'file-invoice',
68
+ iconcolor: '#a30e0e',
69
+ fontcolor: '#a30e0e',
70
+ shadowcolor: '#ffe5e5',
71
+ selected: false,
72
+ visibility: false,
73
+ iconsize: 20,
74
+ functionid: 'D01',
75
+ count: false,
76
+ countValue: 0,
77
+ },
78
+ ];
79
+
80
+ const ButtonsArray = [
81
+ {
82
+ keyid: 3,
83
+ displaytext: 'Raw Material',
84
+ size: 10,
85
+ iconname: 'box-open',
86
+ iconcolor: '#a30e0e',
87
+ fontcolor: '#a30e0e',
88
+ shadowcolor: '#ffe5e5',
89
+ selected: false,
90
+ visibility: true,
91
+ iconsize: 20,
92
+ functionid: 'D01',
93
+ count: false,
94
+ countValue: 0,
95
+ },
96
+ {
97
+ keyid: 4,
98
+ displaytext: 'Equipment',
99
+ size: 10,
100
+ iconname: 'toolbox',
101
+ iconcolor: '#a30e0e',
102
+ fontcolor: '#a30e0e',
103
+ shadowcolor: '#ffe5e5',
104
+ selected: false,
105
+ visibility: true,
106
+ iconsize: 20,
107
+ functionid: 'D01',
108
+ count: false,
109
+ countValue: 0,
110
+ },
111
+ {
112
+ keyid: 5,
113
+ displaytext: 'By-product',
114
+ size: 10,
115
+ iconname: 'boxes',
116
+ iconcolor: '#a30e0e',
117
+ fontcolor: '#a30e0e',
118
+ shadowcolor: '#ffe5e5',
119
+ selected: false,
120
+ visibility: true,
121
+ iconsize: 20,
122
+ functionid: 'D01',
123
+ count: false,
124
+ countValue: 0,
125
+ },
126
+ {
127
+ keyid: 6,
128
+ displaytext: 'Stage By-product',
129
+ size: 10,
130
+ iconname: 'file-alt',
131
+ iconcolor: '#a30e0e',
132
+ fontcolor: '#a30e0e',
133
+ shadowcolor: '#ffe5e5',
134
+ selected: false,
135
+ visibility: true,
136
+ iconsize: 20,
137
+ functionid: 'D01',
138
+ count: false,
139
+ countValue: 0,
140
+ },
141
+ ];
142
+
143
+ // UseEffect for backhandler
144
+ useEffect(() => {
145
+ const backAction = () => {
146
+ if (invoiceData?.EditStatus) {
147
+ setBackHandler(true);
148
+ return true; // Block default back action
149
+ }
150
+ return false; // Allow default back action
151
+ };
152
+
153
+ const backHandler = BackHandler.addEventListener(
154
+ 'hardwareBackPress',
155
+ backAction
156
+ );
157
+
158
+ // Cleanup on unmount
159
+ return () => backHandler.remove();
160
+ }, [invoiceData]);
161
+
162
+ // useEffect for API call
163
+ useEffect(() => {
164
+ getData();
165
+ }, []);
166
+
167
+ // Function for fetch data from API
168
+ function getData() {
169
+ setIsLoading(true);
170
+ let buttonapi = `${APIURL}invget/invcommonget/rnintrworkorderdetailall ${workOrder.insuworkorder}`;
171
+ console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', buttonapi);
172
+ NetworkServiceCall('get', buttonapi).then(function (response) {
173
+ if (response.httpstatus == 200) {
174
+ setInvoiceData(prevData => {
175
+ const updatedWorkOrder = prevData.workOrder.map((item, index) => {
176
+ if (index === orderIndex) {
177
+ return { ...item, details: response.data.data };
178
+ }
179
+ return item;
180
+ });
181
+
182
+ return {
183
+ ...prevData,
184
+ workOrder: updatedWorkOrder,
185
+ EditStatus: false,
186
+ };
187
+ });
188
+ setIsLoading(false);
189
+ // console.log(
190
+ // 'RESPONSEEEEEEEEEEE FROM CONSULTATTION22222222',
191
+ // JSON.stringify(response.data.data),
192
+ // );
193
+
194
+ console.log('invoicequantityentryworkorder', JSON.stringify(invoiceData));
195
+ } else {
196
+ notifyMessage('Data Not Found.....');
197
+ setIsLoading(false);
198
+ }
199
+ });
200
+ // getLoading(v => setIsLoading(false));
201
+ }
202
+
203
+ // Function for handle data change
204
+ function hanldeDataChange(workOrderIndex, value, field) {
205
+ // Clone the workOrder data to ensure immutability
206
+ const updatedWorkOrders = [...invoiceData.workOrder];
207
+
208
+ // Update the object at the specified index
209
+ updatedWorkOrders[workOrderIndex] = {
210
+ ...updatedWorkOrders[workOrderIndex],
211
+ [field]: value, // Dynamically update the specific field with the new value
212
+ };
213
+
214
+ // Update the state with the modified workOrder data
215
+ setInvoiceData(prevState => ({
216
+ ...prevState,
217
+ workOrder: updatedWorkOrders,
218
+ EditStatus: true, // Mark edit status as true indicating a change has occurred
219
+ }));
220
+ }
221
+
222
+ // Function for handle work order details data change
223
+ function handleWorkOrderDetailDataChange(
224
+ workOrderIndex,
225
+ detailIndex,
226
+ value,
227
+ field,
228
+ ) {
229
+ // Clone the workOrder data to ensure immutability
230
+ const updatedWorkOrders = [...invoiceData.workOrder];
231
+
232
+ // Clone the details array for the specific workOrder at workOrderIndex
233
+ const updatedDetails = [...updatedWorkOrders[workOrderIndex].details];
234
+
235
+ // Update the specific detail at detailIndex in the details array
236
+ updatedDetails[detailIndex] = {
237
+ ...updatedDetails[detailIndex],
238
+ [field]: value,
239
+ };
240
+
241
+ // Update the workOrder with the modified details array
242
+ updatedWorkOrders[workOrderIndex] = {
243
+ ...updatedWorkOrders[workOrderIndex],
244
+ details: updatedDetails,
245
+ };
246
+
247
+ // Update the state with the modified workOrder data
248
+ setInvoiceData(prevState => ({
249
+ ...prevState,
250
+ workOrder: updatedWorkOrders,
251
+ EditStatus: true,
252
+ }));
253
+ }
254
+
255
+ // Function for handle dropdown data change
256
+ function hanldeWorkOrderDropdownDataChange(
257
+ workOrderIndex,
258
+ value,
259
+ datavalue,
260
+ displayvalue,
261
+ ) {
262
+ // Clone the workOrder data to ensure immutability
263
+ const updatedWorkOrders = [...invoiceData.workOrder];
264
+
265
+ // Update the object at the specified index
266
+ updatedWorkOrders[workOrderIndex] = {
267
+ ...updatedWorkOrders[workOrderIndex],
268
+ [datavalue]: value.datavalue,
269
+ [displayvalue]: value.displayvalue,
270
+ };
271
+
272
+ // Update the state with the modified workOrder data
273
+ setInvoiceData(prevState => ({
274
+ ...prevState,
275
+ workOrder: updatedWorkOrders,
276
+ EditStatus: true, // Mark edit status as true indicating a change has occurred
277
+ }));
278
+ }
279
+
280
+ // Function for handle work order details dropdown data change
281
+ function handleWorkOrderDetailDropdownDataChange(
282
+ workOrderIndex,
283
+ detailIndex,
284
+ value,
285
+ datavalue,
286
+ displayvalue,
287
+ ) {
288
+ // Clone the workOrder data to ensure immutability
289
+ const updatedWorkOrders = [...invoiceData.workOrder];
290
+
291
+ // Clone the details array for the specific workOrder at workOrderIndex
292
+ const updatedDetails = [...updatedWorkOrders[workOrderIndex].details];
293
+
294
+ // Update the specific detail based on detailIndex
295
+ updatedDetails[detailIndex] = {
296
+ ...updatedDetails[detailIndex],
297
+ [datavalue]: value.datavalue,
298
+ [displayvalue]: value.displayvalue,
299
+ };
300
+
301
+ // Update the workOrder with the modified details array
302
+ updatedWorkOrders[workOrderIndex] = {
303
+ ...updatedWorkOrders[workOrderIndex],
304
+ details: updatedDetails,
305
+ };
306
+
307
+ // Update the state with the modified workOrder data
308
+ setInvoiceData(prevState => ({
309
+ ...prevState,
310
+ workOrder: updatedWorkOrders,
311
+ EditStatus: true,
312
+ }));
313
+ }
314
+
315
+ // Save function
316
+ function getFooterFunctions(params) {
317
+ // Prepare data for saving
318
+ var groups = {
319
+ // option: 'rnintrworkorder1',
320
+ option: 'rnintrworkorder1_05032025',
321
+ userdata: Global.userData,
322
+ workOrder: invoiceData.workOrder[orderIndex],
323
+ };
324
+ var dataset = { groups };
325
+
326
+ console.log(
327
+ '------------------SAVE----------------------------',
328
+ JSON.stringify(dataset),
329
+ );
330
+
331
+ if (groups.workOrder != undefined) {
332
+ let buttonapi = `${APIURL}invsave/FlCommonSave`;
333
+ setLoading(true);
334
+ NetworkServiceCall('post', buttonapi, dataset).then(function (response) {
335
+ if (response.httpstatus == 200) {
336
+ notifyMessage('Data Saved!!!!!');
337
+ setInvoiceData(prevData => ({
338
+ workOrder: [],
339
+ EditStatus: false,
340
+ EquipmentUpdate: false,
341
+ }));
342
+ setLoading(false);
343
+ setTimeout(() => {
344
+ navigation.goBack();
345
+ }, 100);
346
+ } else {
347
+ notifyMessage('Data Not Saved!!!!! Network Error');
348
+ setLoading(false);
349
+ }
350
+ });
351
+ } else {
352
+ notifyMessage('No data to save');
353
+ }
354
+ getLoading(v => setLoading(false));
355
+ }
356
+
357
+ function handleToggleExpand(index) {
358
+ // Clone the data and update the specific index
359
+ const updatedData = [...invoiceData.verification];
360
+
361
+ // Toggle the 'expand' property of the specific section (index)
362
+ updatedData[index] = {
363
+ ...updatedData[index],
364
+ expand: !updatedData[index].expand,
365
+ };
366
+
367
+ // Update the state with the modified data
368
+ setInvoiceData(prevState => ({
369
+ ...prevState,
370
+ verification: updatedData,
371
+ }));
372
+ }
373
+
374
+ // Json for pdf unsaved viewr
375
+ function getDataForPreview(invoiceData) {
376
+ let jsondata = {
377
+ groups: {
378
+ userdata: Global.userData,
379
+ verification: invoiceData?.verification?.map(item => ({
380
+ ...item,
381
+ currentreportbuttonapi: '',
382
+ })),
383
+ },
384
+ };
385
+
386
+ return jsondata;
387
+ }
388
+
389
+ // Function for get arguments HOverlay
390
+ function getArguments(overlayComponent, rawMaterial, detailIndex) {
391
+ if (overlayComponent == 'RawMaterial') {
392
+ return {
393
+ argument: rawMaterial,
394
+ workOrderIndex: orderIndex,
395
+ detailIndex: detailIndex,
396
+ };
397
+ } else if (overlayComponent == 'EquipmentPage') {
398
+ return {
399
+ argument: workOrder.insuworkorder,
400
+ workOrderIndex: orderIndex,
401
+ detailIndex: detailIndex,
402
+ };
403
+ } else if (overlayComponent == 'ByProductPage') {
404
+ return {
405
+ argument: workOrder.insuworkorder,
406
+ workOrderIndex: orderIndex,
407
+ detailIndex: detailIndex,
408
+ };
409
+ } else if (overlayComponent == 'StageByProduct') {
410
+ return {
411
+ argument: workOrder.insuworkorder,
412
+ workOrderIndex: orderIndex,
413
+ detailIndex: detailIndex,
414
+ };
415
+ }
416
+ }
417
+
418
+ return (
419
+ <CContainerView>
420
+ <HeaderBlock
421
+ navigation={navigation}
422
+ callback={val => {
423
+ invoiceData.EditStatus ? setBackHandler(true) : navigation.goBack();
424
+ }}
425
+ />
426
+ <CDetailView>
427
+ {isLoading ? (
428
+ <View
429
+ style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
430
+ <Loader />
431
+ </View>
432
+ ) : (
433
+ <ScrollView
434
+ style={
435
+ {
436
+ // flex: 1,
437
+ // marginVertical: normalize(9),
438
+ // marginTop: normalize(10),
439
+ // paddingHorizontal: normalize(8),
440
+ // alignSelf: 'center',
441
+ // width: Dimensions.get('screen').width * 0.99,
442
+ }
443
+ }>
444
+ {/* Container for the page title */}
445
+ <View style={{ marginBottom: normalize(5) }}>
446
+ <HHeading
447
+ styles={{
448
+ iconname: 'file-invoice',
449
+ bgcolor: '#f2efef',
450
+ iconsize: 14,
451
+ iconcolor: Global.AppTheme.primary_color,
452
+ displaytext: workOrder?.workordername,
453
+ textsize: 13,
454
+ textcolor: Global.AppTheme.primary_color,
455
+ }}
456
+ callBack={val =>
457
+ val == undefined ? null : console.log(val)
458
+ } />
459
+ </View>
460
+ {invoiceData?.workOrder != undefined &&
461
+ invoiceData?.workOrder?.length != 0 ? (
462
+ <View
463
+ style={{
464
+ flex: 1,
465
+ paddingHorizontal: normalize(8),
466
+ alignSelf: 'center',
467
+ width: Dimensions.get('screen').width * 0.99,
468
+ }}>
469
+ {/* Container for the page title */}
470
+ {/* <View
471
+ style={{
472
+ borderWidth: 0,
473
+ justifyContent: 'center',
474
+ alignItems: 'center',
475
+ marginTop: normalize(5),
476
+ marginVertical: normalize(5),
477
+ alignSelf: 'center',
478
+ }}>
479
+ <Text
480
+ style={{
481
+ fontSize: normalize(17),
482
+ fontWeight: 'bold',
483
+ color: '#094485',
484
+ }}>
485
+ {workOrder.workordername}
486
+ </Text>
487
+
488
+ <View>
489
+ <Text>{workOrder.productname}</Text>
490
+ </View>
491
+ </View> */}
492
+
493
+ <View>
494
+ <Text style={{ fontSize: normalize(12) }}>
495
+ {workOrder.productname}
496
+ </Text>
497
+ </View>
498
+
499
+ {/* Product details section */}
500
+ <View>
501
+ {/* <Text
502
+ style={{
503
+ fontSize:normalize(11)
504
+ }}>Request #${workOrder.requestno} | Ref #
505
+ ${workOrder.intrworkorderrequest} | Entered By:
506
+ ${workOrder.username} | On:${workOrder.entrydate}</Text> */}
507
+ {/* <CTextHeader
508
+ text={workOrder.productname}
509
+ widthArr={Dimensions.get('screen').width * 99}
510
+ bgColor={'rgba(184, 184, 191,0.3)'}
511
+ color={'#094485'}
512
+ borderColor={'white'}
513
+ marginHorizontal={normalize(2)}
514
+ borderRadius={5}
515
+ elevation={0}
516
+ /> */}
517
+
518
+ <View
519
+ style={{
520
+ flexDirection: 'row',
521
+ }}>
522
+ {/* Quantity */}
523
+ <View>
524
+ <CTextHeader
525
+ text={'Quantity'}
526
+ widthArr={Dimensions.get('screen').width * 0.2}
527
+ bgColor={'rgba(184, 184, 191,0.3)'}
528
+ color={'#094485'}
529
+ borderColor={'#f5f5f5'}
530
+ marginHorizontal={normalize(2)}
531
+ borderRadius={5}
532
+ elevation={0}
533
+ />
534
+ <STextInputNew
535
+ data={{
536
+ borderWidth: 1,
537
+ value: workOrder.requestedquantity || '',
538
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
539
+ borderColor: 'lightgrey',
540
+ elevation: 0,
541
+ borderRadius: 5,
542
+ fontWeight: 'normal',
543
+ color: 'black',
544
+ itemwidth: Dimensions.get('screen').width * 0.2,
545
+ paddingTop: 5,
546
+ paddingBottom: 5,
547
+ height: Dimensions.get('screen').height * 0.05,
548
+ textAlign: 'start',
549
+ marginTop: normalize(2),
550
+ marginHorizontal: normalize(2),
551
+ fontSize: normalize(11),
552
+ }}
553
+ keyboardType={'numeric'}
554
+ callBack={val => {
555
+ hanldeDataChange(
556
+ orderIndex,
557
+ val,
558
+ 'requestedquantity',
559
+ );
560
+ }}
561
+ />
562
+ </View>
563
+
564
+ {/* Unit */}
565
+ <View>
566
+ <CTextHeader
567
+ text={'Unit'}
568
+ widthArr={Dimensions.get('screen').width * 0.2}
569
+ bgColor={'rgba(184, 184, 191,0.3)'}
570
+ color={'#094485'}
571
+ borderColor={'#f5f5f5'}
572
+ marginHorizontal={normalize(2)}
573
+ borderRadius={5}
574
+ elevation={0}
575
+ />
576
+ <SDropDownNew
577
+ widthArr={Dimensions.get('screen').width * 0.2}
578
+ heightArr={Dimensions.get('screen').height * 0.051}
579
+ dropdowndata={workOrder.unitname}
580
+ dropdownapi={'invget/invcommonget/rndddwdropdownselect 21,0,0,0,0,0,0'}
581
+ fontSize={normalize(11)}
582
+ fontWeight={'normal'}
583
+ onChangeData={val => {
584
+ hanldeWorkOrderDropdownDataChange(
585
+ orderIndex,
586
+ val,
587
+ 'insuunit',
588
+ 'unitname',
589
+ );
590
+ }}
591
+ editable={true}
592
+ // dropdownarray={workOrder.dropdowndata}
593
+ refreshCount={val =>
594
+ // val == undefined ? setRefresh(refresh + 1) : null
595
+ console.log(val)
596
+ }
597
+ />
598
+ </View>
599
+
600
+ {/* Amount */}
601
+ <View>
602
+ <CTextHeader
603
+ text={'Amount'}
604
+ widthArr={Dimensions.get('screen').width * 0.2}
605
+ bgColor={'rgba(184, 184, 191,0.3)'}
606
+ color={'#094485'}
607
+ borderColor={'#f5f5f5'}
608
+ marginHorizontal={normalize(2)}
609
+ borderRadius={5}
610
+ elevation={0}
611
+ />
612
+ <STextInputNew
613
+ data={{
614
+ borderWidth: 1,
615
+ value: workOrder.totalamount || '',
616
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
617
+ borderColor: 'lightgrey',
618
+ elevation: 0,
619
+ borderRadius: 5,
620
+ fontWeight: 'normal',
621
+ color: 'black',
622
+ itemwidth: Dimensions.get('screen').width * 0.2,
623
+ paddingTop: 5,
624
+ paddingBottom: 5,
625
+ height: Dimensions.get('screen').height * 0.05,
626
+ textAlign: 'start',
627
+ marginTop: normalize(2),
628
+ marginHorizontal: normalize(2),
629
+ fontSize: normalize(11),
630
+ }}
631
+ keyboardType={'numeric'}
632
+ callBack={val => {
633
+ hanldeDataChange(orderIndex, val, 'totalamount');
634
+ }}
635
+ />
636
+ </View>
637
+ </View>
638
+ </View>
639
+ {/* <View
640
+ style={{
641
+ borderBottomColor: '#094485',
642
+ borderBottomWidth: 0.5,
643
+ marginVertical: normalize(6),
644
+ }}
645
+ /> */}
646
+ <View
647
+ style={{
648
+ flexDirection: 'row',
649
+ justifyContent: 'space-between',
650
+ alignItems: 'center',
651
+ paddingHorizontal: 5,
652
+ marginVertical: normalize(10),
653
+ }}>
654
+ {ButtonsArray != undefined
655
+ ? ButtonsArray.map((item, i) => {
656
+ return item.visibility ? (
657
+ <View key={i} style={{ marginLeft: 5 }}>
658
+ {/* <CustomButton
659
+ data={{
660
+ ...item,
661
+ shadowcolor: '#fff',
662
+ iconcolor: '#094485',
663
+ fontcolor: '#094485',
664
+ }}
665
+ callBack={val => {
666
+ if (val.keyid === 3) {
667
+ setOverlayComponent('RawMaterial');
668
+ setTimeout(() => {
669
+ setOverlay(true);
670
+ }, 0);
671
+ } else if (val.keyid === 4) {
672
+ setOverlayComponent('EquipmentPage');
673
+ setTimeout(() => {
674
+ setOverlay(true);
675
+ }, 0);
676
+ } else if (val.keyid === 5) {
677
+ setOverlayComponent('ByProductPage');
678
+ setTimeout(() => {
679
+ setOverlay(true);
680
+ }, 0);
681
+ } else if (val.keyid === 6) {
682
+ setOverlayComponent('StageByProduct');
683
+ setTimeout(() => {
684
+ setOverlay(true);
685
+ }, 0);
686
+ }
687
+ }}
688
+ /> */}
689
+ <HShadowCountButton
690
+ useicon={true}
691
+ usetext={true}
692
+ disabled={false}
693
+ buttonstyle={{
694
+ ...CButtonShadow(),
695
+ alignItems: 'center',
696
+ justifyContent: 'center',
697
+ borderWidth: 1,
698
+ borderColor: 'lightblue',
699
+ borderRadius: 10,
700
+ height: Dimensions.get('screen').height * 0.055,
701
+ width: Dimensions.get('screen').height * 0.065,
702
+ marginVertical: normalize(0),
703
+ marginHorizontal: normalize(5),
704
+ }}
705
+ iconcolor={Global.AppTheme.primary_color}
706
+ icongroup={item.icongroup ? item.icongroup : 5}
707
+ iconname={item.iconname}
708
+ iconsize={normalize(24)}
709
+ displaytext={item.displaytext}
710
+ count={item.count}
711
+ countValue={item.countValue}
712
+ buttonCallback={() => {
713
+ if (item.keyid === 3) {
714
+ setOverlayComponent('RawMaterial');
715
+ setTimeout(() => {
716
+ setOverlay(true);
717
+ }, 0);
718
+ } else if (item.keyid === 4) {
719
+ setOverlayComponent('EquipmentPage');
720
+ setTimeout(() => {
721
+ setOverlay(true);
722
+ }, 0);
723
+ } else if (item.keyid === 5) {
724
+ setOverlayComponent('ByProductPage');
725
+ setTimeout(() => {
726
+ setOverlay(true);
727
+ }, 0);
728
+ } else if (item.keyid === 6) {
729
+ setOverlayComponent('StageByProduct');
730
+ setTimeout(() => {
731
+ setOverlay(true);
732
+ }, 0);
733
+ }
734
+ }}
735
+ textstyle={{
736
+ color: Global.AppTheme.primary_color,
737
+ fontSize: normalize(9),
738
+ textAlign: 'center',
739
+ alignSelf: 'center',
740
+ }}
741
+ />
742
+ </View>
743
+ ) : null;
744
+ })
745
+ : null}
746
+ </View>
747
+ {/* <View
748
+ style={{
749
+ borderBottomColor: '#094485',
750
+ borderBottomWidth: 0.5,
751
+ marginVertical: normalize(6),
752
+ }}
753
+ /> */}
754
+
755
+ {/* Preperation section */}
756
+ {workOrder.details != undefined
757
+ ? workOrder.details.map((wodetail, index) => (
758
+ <View key={index}>
759
+ {/* Stage */}
760
+ <View
761
+ style={{
762
+ borderWidth: 0,
763
+ justifyContent: 'center',
764
+ alignItems: 'flex-start',
765
+ marginTop: normalize(5),
766
+ marginVertical: normalize(5),
767
+ alignSelf: 'flex-start',
768
+ }}>
769
+ {/* <Text
770
+ style={{
771
+ fontSize: normalize(15),
772
+ fontWeight: 'bold',
773
+ color: '#094485',
774
+ }}>
775
+ {wodetail.stagename}
776
+ </Text> */}
777
+ <View style={{ marginBottom: normalize(5) }}>
778
+ <HHeading
779
+ styles={{
780
+ iconname: 'file-invoice',
781
+ bgcolor: '#f2efef',
782
+ iconsize: 14,
783
+ iconcolor: Global.AppTheme.primary_color,
784
+ displaytext: wodetail.stagename,
785
+ textsize: 13,
786
+ textcolor: Global.AppTheme.primary_color,
787
+ }}
788
+ callBack={val =>
789
+ val == undefined ? null : console.log(val)
790
+ } />
791
+ </View>
792
+
793
+ <View>
794
+ <Text style={{ fontSize: normalize(12) }}>
795
+ {wodetail.productname}
796
+ </Text>
797
+ </View>
798
+ </View>
799
+ <ScrollView
800
+ horizontal={true}
801
+ style={{
802
+ marginVertical: normalize(3),
803
+ }}>
804
+ <View
805
+ style={{
806
+ flexDirection: 'row',
807
+ }}>
808
+ {/* Status */}
809
+ <View>
810
+ <CTextHeader
811
+ text={'Status'}
812
+ widthArr={Dimensions.get('screen').width * 0.25}
813
+ bgColor={'rgba(184, 184, 191,0.3)'}
814
+ color={'#094485'}
815
+ borderColor={'#f5f5f5'}
816
+ marginHorizontal={normalize(2)}
817
+ borderRadius={5}
818
+ elevation={0}
819
+ />
820
+ <SDropDownNew
821
+ widthArr={Dimensions.get('screen').width * 0.25}
822
+ heightArr={
823
+ Dimensions.get('screen').height * 0.051
824
+ }
825
+ fontSize={normalize(11)}
826
+ fontWeight={'normal'}
827
+ dropdownapi={'invget/invcommonget/rndddwdropdownselect 20,0,0,0,0,0,0'}
828
+ dropdowndata={wodetail.statusname}
829
+ onChangeData={val => {
830
+ handleWorkOrderDetailDropdownDataChange(
831
+ orderIndex,
832
+ index,
833
+ val,
834
+ 'hrsustatus',
835
+ 'statusname',
836
+ );
837
+ }}
838
+ editable={true}
839
+ // dropdownarray={wodetail.dropdownstatusdata}
840
+ refreshCount={val =>
841
+ // val == undefined ? setRefresh(refresh + 1) : null
842
+ console.log(val)
843
+ }
844
+ />
845
+ </View>
846
+
847
+ {/* Priority */}
848
+ <View>
849
+ <CTextHeader
850
+ text={'Priority'}
851
+ widthArr={Dimensions.get('screen').width * 0.2}
852
+ bgColor={'rgba(184, 184, 191,0.3)'}
853
+ color={'#094485'}
854
+ borderColor={'#f5f5f5'}
855
+ marginHorizontal={normalize(2)}
856
+ borderRadius={5}
857
+ elevation={0}
858
+ />
859
+ <STextInputNew
860
+ data={{
861
+ borderWidth: 1,
862
+ value: wodetail.orderofprecedence || 0,
863
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
864
+ borderColor: 'lightgrey',
865
+ elevation: 0,
866
+ borderRadius: 5,
867
+ fontWeight: 'normal',
868
+ color: 'black',
869
+ itemwidth:
870
+ Dimensions.get('screen').width * 0.2,
871
+ paddingTop: 5,
872
+ paddingBottom: 5,
873
+ height:
874
+ Dimensions.get('screen').height * 0.05,
875
+ textAlign: 'start',
876
+ marginTop: normalize(2),
877
+ marginHorizontal: normalize(2),
878
+ fontSize: normalize(11),
879
+ }}
880
+ keyboardType={'numeric'}
881
+ callBack={val => {
882
+ handleWorkOrderDetailDataChange(
883
+ orderIndex,
884
+ index,
885
+ val,
886
+ 'orderofprecedence',
887
+ );
888
+ }}
889
+ />
890
+ </View>
891
+
892
+ {/* Location */}
893
+ <View>
894
+ <CTextHeader
895
+ text={'Location'}
896
+ widthArr={Dimensions.get('screen').width * 0.25}
897
+ bgColor={'rgba(184, 184, 191,0.3)'}
898
+ color={'#094485'}
899
+ borderColor={'#f5f5f5'}
900
+ marginHorizontal={normalize(2)}
901
+ borderRadius={5}
902
+ elevation={0}
903
+ />
904
+ <SDropDownNew
905
+ widthArr={Dimensions.get('screen').width * 0.25}
906
+ heightArr={
907
+ Dimensions.get('screen').height * 0.051
908
+ }
909
+ fontSize={normalize(11)}
910
+ fontWeight={'normal'}
911
+ dropdownapi={'invget/invcommonget/rndddwdropdownselect 19,0,0,0,0,0,0'}
912
+ dropdowndata={wodetail.locationname}
913
+ onChangeData={val => {
914
+ console.log(val);
915
+ handleWorkOrderDetailDropdownDataChange(
916
+ orderIndex,
917
+ index,
918
+ val,
919
+ 'sulocation',
920
+ 'locationname',
921
+ );
922
+ }}
923
+ editable={true}
924
+ // dropdownarray={wodetail.locationdropdowndata}
925
+ refreshCount={val =>
926
+ // val == undefined ? setRefresh(refresh + 1) : null
927
+ console.log(val)
928
+ }
929
+ />
930
+ </View>
931
+
932
+ {/* Quantity */}
933
+ <View>
934
+ <CTextHeader
935
+ text={'Quantity'}
936
+ widthArr={Dimensions.get('screen').width * 0.2}
937
+ bgColor={'rgba(184, 184, 191,0.3)'}
938
+ color={'#094485'}
939
+ borderColor={'#f5f5f5'}
940
+ marginHorizontal={normalize(2)}
941
+ borderRadius={5}
942
+ elevation={0}
943
+ />
944
+ <STextInputNew
945
+ data={{
946
+ borderWidth: 1,
947
+ value: wodetail.quantity || '',
948
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
949
+ borderColor: 'lightgrey',
950
+ elevation: 0,
951
+ borderRadius: 5,
952
+ fontWeight: 'normal',
953
+ color: 'black',
954
+ itemwidth:
955
+ Dimensions.get('screen').width * 0.2,
956
+ paddingTop: 5,
957
+ paddingBottom: 5,
958
+ height:
959
+ Dimensions.get('screen').height * 0.05,
960
+ textAlign: 'start',
961
+ marginTop: normalize(2),
962
+ marginHorizontal: normalize(2),
963
+ fontSize: normalize(11),
964
+ }}
965
+ keyboardType={'numeric'}
966
+ callBack={val => {
967
+ handleWorkOrderDetailDataChange(
968
+ orderIndex,
969
+ index,
970
+ val,
971
+ 'quantity',
972
+ );
973
+ }}
974
+ />
975
+ </View>
976
+
977
+ {/* Unit */}
978
+ <View>
979
+ <CTextHeader
980
+ text={'Unit'}
981
+ widthArr={Dimensions.get('screen').width * 0.2}
982
+ bgColor={'rgba(184, 184, 191,0.3)'}
983
+ color={'#094485'}
984
+ borderColor={'#f5f5f5'}
985
+ marginHorizontal={normalize(2)}
986
+ borderRadius={5}
987
+ elevation={0}
988
+ />
989
+ <SDropDownNew
990
+ widthArr={Dimensions.get('screen').width * 0.2}
991
+ heightArr={
992
+ Dimensions.get('screen').height * 0.051
993
+ }
994
+ fontSize={normalize(11)}
995
+ fontWeight={'normal'}
996
+ dropdownapi={'invget/invcommonget/rndddwdropdownselect 21,0,0,0,0,0,0'}
997
+ dropdowndata={wodetail.unitname}
998
+ onChangeData={val => {
999
+ handleWorkOrderDetailDropdownDataChange(
1000
+ orderIndex,
1001
+ index,
1002
+ val,
1003
+ 'insuunit',
1004
+ 'unitname',
1005
+ );
1006
+ }}
1007
+ editable={true}
1008
+ // dropdownarray={wodetail.dropdowndata}
1009
+ refreshCount={val =>
1010
+ // val == undefined ? setRefresh(refresh + 1) : null
1011
+ console.log(val)
1012
+ }
1013
+ />
1014
+ </View>
1015
+
1016
+ {/* Amount */}
1017
+ <View>
1018
+ <CTextHeader
1019
+ text={'Amount'}
1020
+ widthArr={Dimensions.get('screen').width * 0.2}
1021
+ bgColor={'rgba(184, 184, 191,0.3)'}
1022
+ color={'#094485'}
1023
+ borderColor={'#f5f5f5'}
1024
+ marginHorizontal={normalize(2)}
1025
+ borderRadius={5}
1026
+ elevation={0}
1027
+ />
1028
+ <STextInputNew
1029
+ data={{
1030
+ borderWidth: 1,
1031
+ value:
1032
+ wodetail.amountperqty * wodetail.quantity ||
1033
+ 0,
1034
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
1035
+ borderColor: 'lightgrey',
1036
+ elevation: 0,
1037
+ borderRadius: 5,
1038
+ fontWeight: 'normal',
1039
+ color: 'black',
1040
+ itemwidth:
1041
+ Dimensions.get('screen').width * 0.2,
1042
+ paddingTop: 5,
1043
+ paddingBottom: 5,
1044
+ height:
1045
+ Dimensions.get('screen').height * 0.05,
1046
+ textAlign: 'start',
1047
+ marginTop: normalize(2),
1048
+ marginHorizontal: normalize(2),
1049
+ fontSize: normalize(11),
1050
+ }}
1051
+ editable={false}
1052
+ keyboardType={'numeric'}
1053
+ callBack={val => {
1054
+ console.log(val);
1055
+ // hanldeDataChange(
1056
+ // orderIndex,
1057
+ // val,
1058
+ // 'totalamount',
1059
+ // );
1060
+ }}
1061
+ />
1062
+ </View>
1063
+ </View>
1064
+ </ScrollView>
1065
+ {overlay ? (
1066
+ <HOverlay
1067
+ component={overlayComponent}
1068
+ visibility={val =>
1069
+ val == undefined ? null : setOverlay(val)
1070
+ }
1071
+ argument={getArguments(
1072
+ overlayComponent,
1073
+ wodetail.insuworkorderdetail,
1074
+ index,
1075
+ )}
1076
+ />
1077
+ ) : null}
1078
+ </View>
1079
+ ))
1080
+ : null}
1081
+ </View>
1082
+ ) : null}
1083
+ </ScrollView>
1084
+ )}
1085
+
1086
+ {backHandler ? (
1087
+ <ConfirmOverlay
1088
+ confirmtext={'Are your sure you want to exit without save ?'}
1089
+ navigation={navigation}
1090
+ saveHandler={val => (val == undefined ? null : setBackHandler(val))}
1091
+ callback={val => {
1092
+ if (val === true) {
1093
+ // setEditStatus(false);
1094
+ setInvoiceData(prevData => ({
1095
+ ...prevData,
1096
+ EditStatus: false,
1097
+ EquipmentUpdate: false,
1098
+ }));
1099
+ setTimeout(() => {
1100
+ navigation.goBack();
1101
+ }, 0);
1102
+ }
1103
+ }}
1104
+ />
1105
+ ) : null}
1106
+ </CDetailView>
1107
+ <CFooterView style={{ backgroundColor: '#fff' }}>
1108
+ {/* Bottom buttons section */}
1109
+ {FooterArr != undefined
1110
+ ? FooterArr.map((item, i) => {
1111
+ return item.visibility ? (
1112
+ // <View key={i} style={{marginLeft: 5}}>
1113
+ // <CustomButton
1114
+ // data={{
1115
+ // ...item,
1116
+ // shadowcolor: '#fff',
1117
+ // iconcolor: '#094485',
1118
+ // fontcolor: '#094485',
1119
+ // }}
1120
+ // callBack={val => {
1121
+ // if (val.keyid === 1) {
1122
+ // val == undefined ? null : getFooterFunctions(val);
1123
+ // } else if (val.keyid === 2) {
1124
+ // navigation.navigate('PdfUnSavedViewer', {
1125
+ // headerblockstyle: {marginBottom: normalize(35)},
1126
+ // data: getDataForPreview(invoiceData),
1127
+ // link:
1128
+ // APIURL +
1129
+ // 'jremr/jrcommonjreport/' +
1130
+ // 'rnintrverificationpreview/0/IndentPreview',
1131
+ // });
1132
+ // }
1133
+ // }}
1134
+ // />
1135
+ // </View>
1136
+ <View
1137
+ style={{
1138
+ flexDirection: 'row',
1139
+ alignItems: 'center',
1140
+ justifyContent: 'flex-start',
1141
+ paddingHorizontal: 2,
1142
+ }}>
1143
+ {FooterArr != undefined
1144
+ ? FooterArr.map((item, i) => {
1145
+ return item.visibility ? (
1146
+ <HShadowCountButton
1147
+ useicon={true}
1148
+ usetext={true}
1149
+ disabled={false}
1150
+ buttonstyle={{
1151
+ ...CButtonShadow(),
1152
+ alignItems: 'center',
1153
+ justifyContent: 'center',
1154
+ borderWidth: 1,
1155
+ borderColor: 'lightblue',
1156
+ borderRadius: 10,
1157
+ height: Dimensions.get('screen').height * 0.055,
1158
+ width: Dimensions.get('screen').height * 0.065,
1159
+ marginVertical: normalize(5),
1160
+ marginHorizontal: normalize(5),
1161
+ }}
1162
+ iconcolor={Global.AppTheme.primary_color}
1163
+ icongroup={item.icongroup ? item.icongroup : 5}
1164
+ iconname={item.iconname}
1165
+ iconsize={normalize(24)}
1166
+ displaytext={item.displaytext}
1167
+ count={item.count}
1168
+ countValue={item.countValue}
1169
+ buttonCallback={() => {
1170
+ if (item.keyid === 1) {
1171
+ item == undefined ? null : getFooterFunctions(item);
1172
+ } else if (item.keyid === 2) {
1173
+ navigation.navigate('PdfUnSavedViewer', {
1174
+ headerblockstyle: { marginBottom: normalize(35) },
1175
+ data: getDataForPreview(invoiceData),
1176
+ link:
1177
+ APIURL +
1178
+ 'jremr/jrcommonjreport/' +
1179
+ 'rnintrverificationpreview/0/IndentPreview',
1180
+ });
1181
+ }
1182
+ // if (item.keyid === 1) {
1183
+ // item == undefined
1184
+ // ? null
1185
+ // : getFooterFunctions(item);
1186
+ // } else if (item.keyid === 2) {
1187
+ // navigation.navigate('PdfUnSavedViewer', {
1188
+ // headerblockstyle: {
1189
+ // marginBottom: normalize(35),
1190
+ // },
1191
+ // data: getDataForPreview(invoiceData),
1192
+ // link:
1193
+ // APIURL +
1194
+ // 'jremr/jrcommonjreport/' +
1195
+ // 'rnintrverificationpreview/0/Procurement',
1196
+ // });
1197
+ // }
1198
+ }}
1199
+ textstyle={{
1200
+ color: Global.AppTheme.primary_color,
1201
+ fontSize: normalize(9),
1202
+ textAlign: 'center',
1203
+ alignSelf: 'center',
1204
+ }}
1205
+ />
1206
+ ) : null;
1207
+ })
1208
+ : null}
1209
+ </View>
1210
+ ) : null;
1211
+ })
1212
+ : null}
1213
+ </CFooterView>
1214
+ </CContainerView>
1215
+ );
1216
+ }