@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,1213 @@
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 WorkOrderDetailsPage({ 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/rnintrworkorderdetail ${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
+ } else {
194
+ notifyMessage('Data Not Found.....');
195
+ setIsLoading(false);
196
+ }
197
+ });
198
+ // getLoading(v => setIsLoading(false));
199
+ }
200
+
201
+ // Function for handle data change
202
+ function hanldeDataChange(workOrderIndex, value, field) {
203
+ // Clone the workOrder data to ensure immutability
204
+ const updatedWorkOrders = [...invoiceData.workOrder];
205
+
206
+ // Update the object at the specified index
207
+ updatedWorkOrders[workOrderIndex] = {
208
+ ...updatedWorkOrders[workOrderIndex],
209
+ [field]: value, // Dynamically update the specific field with the new value
210
+ };
211
+
212
+ // Update the state with the modified workOrder data
213
+ setInvoiceData(prevState => ({
214
+ ...prevState,
215
+ workOrder: updatedWorkOrders,
216
+ EditStatus: true, // Mark edit status as true indicating a change has occurred
217
+ }));
218
+ }
219
+
220
+ // Function for handle work order details data change
221
+ function handleWorkOrderDetailDataChange(
222
+ workOrderIndex,
223
+ detailIndex,
224
+ value,
225
+ field,
226
+ ) {
227
+ // Clone the workOrder data to ensure immutability
228
+ const updatedWorkOrders = [...invoiceData.workOrder];
229
+
230
+ // Clone the details array for the specific workOrder at workOrderIndex
231
+ const updatedDetails = [...updatedWorkOrders[workOrderIndex].details];
232
+
233
+ // Update the specific detail at detailIndex in the details array
234
+ updatedDetails[detailIndex] = {
235
+ ...updatedDetails[detailIndex],
236
+ [field]: value,
237
+ };
238
+
239
+ // Update the workOrder with the modified details array
240
+ updatedWorkOrders[workOrderIndex] = {
241
+ ...updatedWorkOrders[workOrderIndex],
242
+ details: updatedDetails,
243
+ };
244
+
245
+ // Update the state with the modified workOrder data
246
+ setInvoiceData(prevState => ({
247
+ ...prevState,
248
+ workOrder: updatedWorkOrders,
249
+ EditStatus: true,
250
+ }));
251
+ }
252
+
253
+ // Function for handle dropdown data change
254
+ function hanldeWorkOrderDropdownDataChange(
255
+ workOrderIndex,
256
+ value,
257
+ datavalue,
258
+ displayvalue,
259
+ ) {
260
+ // Clone the workOrder data to ensure immutability
261
+ const updatedWorkOrders = [...invoiceData.workOrder];
262
+
263
+ // Update the object at the specified index
264
+ updatedWorkOrders[workOrderIndex] = {
265
+ ...updatedWorkOrders[workOrderIndex],
266
+ [datavalue]: value.datavalue,
267
+ [displayvalue]: value.displayvalue,
268
+ };
269
+
270
+ // Update the state with the modified workOrder data
271
+ setInvoiceData(prevState => ({
272
+ ...prevState,
273
+ workOrder: updatedWorkOrders,
274
+ EditStatus: true, // Mark edit status as true indicating a change has occurred
275
+ }));
276
+ }
277
+
278
+ // Function for handle work order details dropdown data change
279
+ function handleWorkOrderDetailDropdownDataChange(
280
+ workOrderIndex,
281
+ detailIndex,
282
+ value,
283
+ datavalue,
284
+ displayvalue,
285
+ ) {
286
+ // Clone the workOrder data to ensure immutability
287
+ const updatedWorkOrders = [...invoiceData.workOrder];
288
+
289
+ // Clone the details array for the specific workOrder at workOrderIndex
290
+ const updatedDetails = [...updatedWorkOrders[workOrderIndex].details];
291
+
292
+ // Update the specific detail based on detailIndex
293
+ updatedDetails[detailIndex] = {
294
+ ...updatedDetails[detailIndex],
295
+ [datavalue]: value.datavalue,
296
+ [displayvalue]: value.displayvalue,
297
+ };
298
+
299
+ // Update the workOrder with the modified details array
300
+ updatedWorkOrders[workOrderIndex] = {
301
+ ...updatedWorkOrders[workOrderIndex],
302
+ details: updatedDetails,
303
+ };
304
+
305
+ // Update the state with the modified workOrder data
306
+ setInvoiceData(prevState => ({
307
+ ...prevState,
308
+ workOrder: updatedWorkOrders,
309
+ EditStatus: true,
310
+ }));
311
+ }
312
+
313
+ // Save function
314
+ function getFooterFunctions(params) {
315
+ // Prepare data for saving
316
+ var groups = {
317
+ option: 'rnintrworkorder1',
318
+ userdata: Global.userData,
319
+ workOrder: invoiceData.workOrder[orderIndex],
320
+ };
321
+ var dataset = { groups };
322
+
323
+ console.log(
324
+ '------------------SAVE----------------------------',
325
+ JSON.stringify(dataset),
326
+ );
327
+
328
+ if (groups.workOrder != undefined) {
329
+ let buttonapi = `${APIURL}invsave/FlCommonSave`;
330
+ setLoading(true);
331
+ NetworkServiceCall('post', buttonapi, dataset).then(function (response) {
332
+ if (response.httpstatus == 200) {
333
+ notifyMessage('Data Saved!!!!!');
334
+ setInvoiceData(prevData => ({
335
+ workOrder: [],
336
+ EditStatus: false,
337
+ EquipmentUpdate: false,
338
+ }));
339
+ setLoading(false);
340
+ setTimeout(() => {
341
+ navigation.goBack();
342
+ }, 100);
343
+ } else {
344
+ notifyMessage('Data Not Saved!!!!! Network Error');
345
+ setLoading(false);
346
+ }
347
+ });
348
+ } else {
349
+ notifyMessage('No data to save');
350
+ }
351
+ getLoading(v => setLoading(false));
352
+ }
353
+
354
+ function handleToggleExpand(index) {
355
+ // Clone the data and update the specific index
356
+ const updatedData = [...invoiceData.verification];
357
+
358
+ // Toggle the 'expand' property of the specific section (index)
359
+ updatedData[index] = {
360
+ ...updatedData[index],
361
+ expand: !updatedData[index].expand,
362
+ };
363
+
364
+ // Update the state with the modified data
365
+ setInvoiceData(prevState => ({
366
+ ...prevState,
367
+ verification: updatedData,
368
+ }));
369
+ }
370
+
371
+ // Json for pdf unsaved viewr
372
+ function getDataForPreview(invoiceData) {
373
+ let jsondata = {
374
+ groups: {
375
+ userdata: Global.userData,
376
+ verification: invoiceData?.verification?.map(item => ({
377
+ ...item,
378
+ currentreportbuttonapi: '',
379
+ })),
380
+ },
381
+ };
382
+
383
+ return jsondata;
384
+ }
385
+
386
+ // Function for get arguments HOverlay
387
+ function getArguments(overlayComponent, rawMaterial, detailIndex) {
388
+ if (overlayComponent == 'RawMaterial') {
389
+ return {
390
+ argument: rawMaterial,
391
+ workOrderIndex: orderIndex,
392
+ detailIndex: detailIndex,
393
+ };
394
+ } else if (overlayComponent == 'EquipmentPage') {
395
+ return {
396
+ argument: workOrder.insuworkorder,
397
+ workOrderIndex: orderIndex,
398
+ detailIndex: detailIndex,
399
+ };
400
+ } else if (overlayComponent == 'ByProductPage') {
401
+ return {
402
+ argument: workOrder.insuworkorder,
403
+ workOrderIndex: orderIndex,
404
+ detailIndex: detailIndex,
405
+ };
406
+ } else if (overlayComponent == 'StageByProduct') {
407
+ return {
408
+ argument: workOrder.insuworkorder,
409
+ workOrderIndex: orderIndex,
410
+ detailIndex: detailIndex,
411
+ };
412
+ }
413
+ }
414
+
415
+ return (
416
+ <CContainerView>
417
+ <HeaderBlock
418
+ navigation={navigation}
419
+ callback={val => {
420
+ invoiceData.EditStatus ? setBackHandler(true) : navigation.goBack();
421
+ }}
422
+ />
423
+ <CDetailView>
424
+ {isLoading ? (
425
+ <View
426
+ style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
427
+ <Loader />
428
+ </View>
429
+ ) : (
430
+ <ScrollView
431
+ style={
432
+ {
433
+ // flex: 1,
434
+ // marginVertical: normalize(9),
435
+ // marginTop: normalize(10),
436
+ // paddingHorizontal: normalize(8),
437
+ // alignSelf: 'center',
438
+ // width: Dimensions.get('screen').width * 0.99,
439
+ }
440
+ }>
441
+ {/* Container for the page title */}
442
+ <View style={{ marginBottom: normalize(5) }}>
443
+ <HHeading
444
+ styles={{
445
+ iconname: 'file-invoice',
446
+ bgcolor: '#f2efef',
447
+ iconsize: 14,
448
+ iconcolor: Global.AppTheme.primary_color,
449
+ displaytext: workOrder.workordername,
450
+ textsize: 13,
451
+ textcolor: Global.AppTheme.primary_color,
452
+ }}
453
+ callBack={val =>
454
+ val == undefined ? null : console.log(val)
455
+ } />
456
+ </View>
457
+ {invoiceData?.workOrder != undefined &&
458
+ invoiceData?.workOrder?.length != 0 ? (
459
+ <View
460
+ style={{
461
+ flex: 1,
462
+ paddingHorizontal: normalize(8),
463
+ alignSelf: 'center',
464
+ width: Dimensions.get('screen').width * 0.99,
465
+ }}>
466
+ {/* Container for the page title */}
467
+ {/* <View
468
+ style={{
469
+ borderWidth: 0,
470
+ justifyContent: 'center',
471
+ alignItems: 'center',
472
+ marginTop: normalize(5),
473
+ marginVertical: normalize(5),
474
+ alignSelf: 'center',
475
+ }}>
476
+ <Text
477
+ style={{
478
+ fontSize: normalize(17),
479
+ fontWeight: 'bold',
480
+ color: '#094485',
481
+ }}>
482
+ {workOrder.workordername}
483
+ </Text>
484
+
485
+ <View>
486
+ <Text>{workOrder.productname}</Text>
487
+ </View>
488
+ </View> */}
489
+
490
+ <View>
491
+ <Text style={{ fontSize: normalize(12) }}>
492
+ {workOrder.productname}
493
+ </Text>
494
+ </View>
495
+
496
+ {/* Product details section */}
497
+ <View>
498
+ {/* <Text
499
+ style={{
500
+ fontSize:normalize(11)
501
+ }}>Request #${workOrder.requestno} | Ref #
502
+ ${workOrder.intrworkorderrequest} | Entered By:
503
+ ${workOrder.username} | On:${workOrder.entrydate}</Text> */}
504
+ {/* <CTextHeader
505
+ text={workOrder.productname}
506
+ widthArr={Dimensions.get('screen').width * 99}
507
+ bgColor={'rgba(184, 184, 191,0.3)'}
508
+ color={'#094485'}
509
+ borderColor={'white'}
510
+ marginHorizontal={normalize(2)}
511
+ borderRadius={5}
512
+ elevation={0}
513
+ /> */}
514
+
515
+ <View
516
+ style={{
517
+ flexDirection: 'row',
518
+ }}>
519
+ {/* Quantity */}
520
+ <View>
521
+ <CTextHeader
522
+ text={'Quantity'}
523
+ widthArr={Dimensions.get('screen').width * 0.2}
524
+ bgColor={'rgba(184, 184, 191,0.3)'}
525
+ color={'#094485'}
526
+ borderColor={'#f5f5f5'}
527
+ marginHorizontal={normalize(2)}
528
+ borderRadius={5}
529
+ elevation={0}
530
+ />
531
+ <STextInputNew
532
+ data={{
533
+ borderWidth: 1,
534
+ value: workOrder.requestedquantity || '',
535
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
536
+ borderColor: 'lightgrey',
537
+ elevation: 0,
538
+ borderRadius: 5,
539
+ fontWeight: 'normal',
540
+ color: 'black',
541
+ itemwidth: Dimensions.get('screen').width * 0.2,
542
+ paddingTop: 5,
543
+ paddingBottom: 5,
544
+ height: Dimensions.get('screen').height * 0.05,
545
+ textAlign: 'start',
546
+ marginTop: normalize(2),
547
+ marginHorizontal: normalize(2),
548
+ fontSize: normalize(12),
549
+ }}
550
+ keyboardType={'numeric'}
551
+ callBack={val => {
552
+ hanldeDataChange(
553
+ orderIndex,
554
+ val,
555
+ 'requestedquantity',
556
+ );
557
+ }}
558
+ />
559
+ </View>
560
+
561
+ {/* Unit */}
562
+ <View>
563
+ <CTextHeader
564
+ text={'Unit'}
565
+ widthArr={Dimensions.get('screen').width * 0.2}
566
+ bgColor={'rgba(184, 184, 191,0.3)'}
567
+ color={'#094485'}
568
+ borderColor={'#f5f5f5'}
569
+ marginHorizontal={normalize(2)}
570
+ borderRadius={5}
571
+ elevation={0}
572
+ />
573
+ <SDropDownNew
574
+ widthArr={Dimensions.get('screen').width * 0.2}
575
+ heightArr={Dimensions.get('screen').height * 0.051}
576
+ dropdowndata={workOrder.unitname}
577
+ fontSize={normalize(12)}
578
+ fontWeight={'normal'}
579
+ onChangeData={val => {
580
+ hanldeWorkOrderDropdownDataChange(
581
+ orderIndex,
582
+ val,
583
+ 'insuunit',
584
+ 'unitname',
585
+ );
586
+ }}
587
+ editable={false}
588
+ dropdownarray={workOrder.dropdowndata}
589
+ refreshCount={val =>
590
+ // val == undefined ? setRefresh(refresh + 1) : null
591
+ console.log(val)
592
+ }
593
+ />
594
+ </View>
595
+
596
+ {/* Amount */}
597
+ <View>
598
+ <CTextHeader
599
+ text={'Amount'}
600
+ widthArr={Dimensions.get('screen').width * 0.2}
601
+ bgColor={'rgba(184, 184, 191,0.3)'}
602
+ color={'#094485'}
603
+ borderColor={'#f5f5f5'}
604
+ marginHorizontal={normalize(2)}
605
+ borderRadius={5}
606
+ elevation={0}
607
+ />
608
+ <STextInputNew
609
+ data={{
610
+ borderWidth: 1,
611
+ value: workOrder.totalamount || '',
612
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
613
+ borderColor: 'lightgrey',
614
+ elevation: 0,
615
+ borderRadius: 5,
616
+ fontWeight: 'normal',
617
+ color: 'black',
618
+ itemwidth: Dimensions.get('screen').width * 0.2,
619
+ paddingTop: 5,
620
+ paddingBottom: 5,
621
+ height: Dimensions.get('screen').height * 0.05,
622
+ textAlign: 'start',
623
+ marginTop: normalize(2),
624
+ marginHorizontal: normalize(2),
625
+ fontSize: normalize(12),
626
+ }}
627
+ keyboardType={'numeric'}
628
+ callBack={val => {
629
+ hanldeDataChange(orderIndex, val, 'totalamount');
630
+ }}
631
+ />
632
+ </View>
633
+ </View>
634
+ </View>
635
+ {/* <View
636
+ style={{
637
+ borderBottomColor: '#094485',
638
+ borderBottomWidth: 0.5,
639
+ marginVertical: normalize(6),
640
+ }}
641
+ /> */}
642
+ <View
643
+ style={{
644
+ flexDirection: 'row',
645
+ justifyContent: 'space-between',
646
+ alignItems: 'center',
647
+ paddingHorizontal: 5,
648
+ marginVertical: normalize(10),
649
+ }}>
650
+ {ButtonsArray != undefined
651
+ ? ButtonsArray.map((item, i) => {
652
+ return item.visibility ? (
653
+ <View key={i} style={{ marginLeft: 5 }}>
654
+ {/* <CustomButton
655
+ data={{
656
+ ...item,
657
+ shadowcolor: '#fff',
658
+ iconcolor: '#094485',
659
+ fontcolor: '#094485',
660
+ }}
661
+ callBack={val => {
662
+ if (val.keyid === 3) {
663
+ setOverlayComponent('RawMaterial');
664
+ setTimeout(() => {
665
+ setOverlay(true);
666
+ }, 0);
667
+ } else if (val.keyid === 4) {
668
+ setOverlayComponent('EquipmentPage');
669
+ setTimeout(() => {
670
+ setOverlay(true);
671
+ }, 0);
672
+ } else if (val.keyid === 5) {
673
+ setOverlayComponent('ByProductPage');
674
+ setTimeout(() => {
675
+ setOverlay(true);
676
+ }, 0);
677
+ } else if (val.keyid === 6) {
678
+ setOverlayComponent('StageByProduct');
679
+ setTimeout(() => {
680
+ setOverlay(true);
681
+ }, 0);
682
+ }
683
+ }}
684
+ /> */}
685
+ <HShadowCountButton
686
+ useicon={true}
687
+ usetext={true}
688
+ disabled={false}
689
+ buttonstyle={{
690
+ ...CButtonShadow(),
691
+ alignItems: 'center',
692
+ justifyContent: 'center',
693
+ borderWidth: 1,
694
+ borderColor: 'lightblue',
695
+ borderRadius: 10,
696
+ height: Dimensions.get('screen').height * 0.055,
697
+ width: Dimensions.get('screen').height * 0.065,
698
+ marginVertical: normalize(0),
699
+ marginHorizontal: normalize(5),
700
+ }}
701
+ iconcolor={Global.AppTheme.primary_color}
702
+ icongroup={item.icongroup ? item.icongroup : 5}
703
+ iconname={item.iconname}
704
+ iconsize={normalize(24)}
705
+ displaytext={item.displaytext}
706
+ count={item.count}
707
+ countValue={item.countValue}
708
+ buttonCallback={() => {
709
+ if (item.keyid === 3) {
710
+ setOverlayComponent('RawMaterial');
711
+ setTimeout(() => {
712
+ setOverlay(true);
713
+ }, 0);
714
+ } else if (item.keyid === 4) {
715
+ setOverlayComponent('EquipmentPage');
716
+ setTimeout(() => {
717
+ setOverlay(true);
718
+ }, 0);
719
+ } else if (item.keyid === 5) {
720
+ setOverlayComponent('ByProductPage');
721
+ setTimeout(() => {
722
+ setOverlay(true);
723
+ }, 0);
724
+ } else if (item.keyid === 6) {
725
+ setOverlayComponent('StageByProduct');
726
+ setTimeout(() => {
727
+ setOverlay(true);
728
+ }, 0);
729
+ }
730
+ }}
731
+ textstyle={{
732
+ color: Global.AppTheme.primary_color,
733
+ fontSize: normalize(9),
734
+ textAlign: 'center',
735
+ alignSelf: 'center',
736
+ }}
737
+ />
738
+ </View>
739
+ ) : null;
740
+ })
741
+ : null}
742
+ </View>
743
+ {/* <View
744
+ style={{
745
+ borderBottomColor: '#094485',
746
+ borderBottomWidth: 0.5,
747
+ marginVertical: normalize(6),
748
+ }}
749
+ /> */}
750
+
751
+ {/* Preperation section */}
752
+ {workOrder.details != undefined
753
+ ? workOrder.details.map((wodetail, index) => (
754
+ <View key={index}>
755
+ {/* Stage */}
756
+ <View
757
+ style={{
758
+ borderWidth: 0,
759
+ justifyContent: 'center',
760
+ alignItems: 'flex-start',
761
+ marginTop: normalize(5),
762
+ marginVertical: normalize(5),
763
+ alignSelf: 'flex-start',
764
+ }}>
765
+ {/* <Text
766
+ style={{
767
+ fontSize: normalize(15),
768
+ fontWeight: 'bold',
769
+ color: '#094485',
770
+ }}>
771
+ {wodetail.stagename}
772
+ </Text> */}
773
+ <View style={{ marginBottom: normalize(5) }}>
774
+ <HHeading
775
+ styles={{
776
+ iconname: 'file-invoice',
777
+ bgcolor: '#f2efef',
778
+ iconsize: 14,
779
+ iconcolor: Global.AppTheme.primary_color,
780
+ displaytext: wodetail.stagename,
781
+ textsize: 13,
782
+ textcolor: Global.AppTheme.primary_color,
783
+ }}
784
+ callBack={val =>
785
+ val == undefined ? null : console.log(val)
786
+ } />
787
+ </View>
788
+
789
+ <View>
790
+ <Text style={{ fontSize: normalize(12) }}>
791
+ {wodetail.productname}
792
+ </Text>
793
+ </View>
794
+ </View>
795
+ <ScrollView
796
+ horizontal={true}
797
+ style={{
798
+ marginVertical: normalize(3),
799
+ }}>
800
+ <View
801
+ style={{
802
+ flexDirection: 'row',
803
+ }}>
804
+ {/* Status */}
805
+ <View>
806
+ <CTextHeader
807
+ text={'Status'}
808
+ widthArr={Dimensions.get('screen').width * 0.25}
809
+ bgColor={'rgba(184, 184, 191,0.3)'}
810
+ color={'#094485'}
811
+ borderColor={'#f5f5f5'}
812
+ marginHorizontal={normalize(2)}
813
+ borderRadius={5}
814
+ elevation={0}
815
+ />
816
+ <SDropDownNew
817
+ widthArr={Dimensions.get('screen').width * 0.25}
818
+ heightArr={
819
+ Dimensions.get('screen').height * 0.051
820
+ }
821
+ fontSize={normalize(12)}
822
+ fontWeight={'normal'}
823
+ dropdowndata={wodetail.statusname}
824
+ onChangeData={val => {
825
+ handleWorkOrderDetailDropdownDataChange(
826
+ orderIndex,
827
+ index,
828
+ val,
829
+ 'hrsustatus',
830
+ 'statusname',
831
+ );
832
+ }}
833
+ editable={false}
834
+ dropdownarray={wodetail.dropdownstatusdata}
835
+ refreshCount={val =>
836
+ // val == undefined ? setRefresh(refresh + 1) : null
837
+ console.log(val)
838
+ }
839
+ />
840
+ </View>
841
+
842
+ {/* Priority */}
843
+ <View>
844
+ <CTextHeader
845
+ text={'Priority'}
846
+ widthArr={Dimensions.get('screen').width * 0.2}
847
+ bgColor={'rgba(184, 184, 191,0.3)'}
848
+ color={'#094485'}
849
+ borderColor={'#f5f5f5'}
850
+ marginHorizontal={normalize(2)}
851
+ borderRadius={5}
852
+ elevation={0}
853
+ />
854
+ <STextInputNew
855
+ data={{
856
+ borderWidth: 1,
857
+ value: wodetail.orderofprecedence || 0,
858
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
859
+ borderColor: 'lightgrey',
860
+ elevation: 0,
861
+ borderRadius: 5,
862
+ fontWeight: 'normal',
863
+ color: 'black',
864
+ itemwidth:
865
+ Dimensions.get('screen').width * 0.2,
866
+ paddingTop: 5,
867
+ paddingBottom: 5,
868
+ height:
869
+ Dimensions.get('screen').height * 0.05,
870
+ textAlign: 'start',
871
+ marginTop: normalize(2),
872
+ marginHorizontal: normalize(2),
873
+ fontSize: normalize(12),
874
+ }}
875
+ keyboardType={'numeric'}
876
+ callBack={val => {
877
+ handleWorkOrderDetailDataChange(
878
+ orderIndex,
879
+ index,
880
+ val,
881
+ 'orderofprecedence',
882
+ );
883
+ }}
884
+ />
885
+ </View>
886
+
887
+ {/* Location */}
888
+ <View>
889
+ <CTextHeader
890
+ text={'Location'}
891
+ widthArr={Dimensions.get('screen').width * 0.25}
892
+ bgColor={'rgba(184, 184, 191,0.3)'}
893
+ color={'#094485'}
894
+ borderColor={'#f5f5f5'}
895
+ marginHorizontal={normalize(2)}
896
+ borderRadius={5}
897
+ elevation={0}
898
+ />
899
+ {console.log(
900
+ 'location',
901
+ wodetail.locationdropdowndata,
902
+ )}
903
+ <SDropDownNew
904
+ widthArr={Dimensions.get('screen').width * 0.25}
905
+ heightArr={
906
+ Dimensions.get('screen').height * 0.051
907
+ }
908
+ fontSize={normalize(12)}
909
+ fontWeight={'normal'}
910
+ dropdowndata={wodetail.locationname}
911
+ onChangeData={val => {
912
+ console.log(val);
913
+ handleWorkOrderDetailDropdownDataChange(
914
+ orderIndex,
915
+ index,
916
+ val,
917
+ 'sulocation',
918
+ 'locationname',
919
+ );
920
+ }}
921
+ editable={false}
922
+ dropdownarray={wodetail.locationdropdowndata}
923
+ refreshCount={val =>
924
+ // val == undefined ? setRefresh(refresh + 1) : null
925
+ console.log(val)
926
+ }
927
+ />
928
+ </View>
929
+
930
+ {/* Quantity */}
931
+ <View>
932
+ <CTextHeader
933
+ text={'Quantity'}
934
+ widthArr={Dimensions.get('screen').width * 0.2}
935
+ bgColor={'rgba(184, 184, 191,0.3)'}
936
+ color={'#094485'}
937
+ borderColor={'#f5f5f5'}
938
+ marginHorizontal={normalize(2)}
939
+ borderRadius={5}
940
+ elevation={0}
941
+ />
942
+ <STextInputNew
943
+ data={{
944
+ borderWidth: 1,
945
+ value: wodetail.quantity || '',
946
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
947
+ borderColor: 'lightgrey',
948
+ elevation: 0,
949
+ borderRadius: 5,
950
+ fontWeight: 'normal',
951
+ color: 'black',
952
+ itemwidth:
953
+ Dimensions.get('screen').width * 0.2,
954
+ paddingTop: 5,
955
+ paddingBottom: 5,
956
+ height:
957
+ Dimensions.get('screen').height * 0.05,
958
+ textAlign: 'start',
959
+ marginTop: normalize(2),
960
+ marginHorizontal: normalize(2),
961
+ fontSize: normalize(12),
962
+ }}
963
+ keyboardType={'numeric'}
964
+ callBack={val => {
965
+ handleWorkOrderDetailDataChange(
966
+ orderIndex,
967
+ index,
968
+ val,
969
+ 'quantity',
970
+ );
971
+ }}
972
+ />
973
+ </View>
974
+
975
+ {/* Unit */}
976
+ <View>
977
+ <CTextHeader
978
+ text={'Unit'}
979
+ widthArr={Dimensions.get('screen').width * 0.2}
980
+ bgColor={'rgba(184, 184, 191,0.3)'}
981
+ color={'#094485'}
982
+ borderColor={'#f5f5f5'}
983
+ marginHorizontal={normalize(2)}
984
+ borderRadius={5}
985
+ elevation={0}
986
+ />
987
+ <SDropDownNew
988
+ widthArr={Dimensions.get('screen').width * 0.2}
989
+ heightArr={
990
+ Dimensions.get('screen').height * 0.051
991
+ }
992
+ fontSize={normalize(12)}
993
+ fontWeight={'normal'}
994
+ dropdowndata={wodetail.unitname}
995
+ onChangeData={val => {
996
+ handleWorkOrderDetailDropdownDataChange(
997
+ orderIndex,
998
+ index,
999
+ val,
1000
+ 'insuunit',
1001
+ 'unitname',
1002
+ );
1003
+ }}
1004
+ editable={false}
1005
+ dropdownarray={wodetail.dropdowndata}
1006
+ refreshCount={val =>
1007
+ // val == undefined ? setRefresh(refresh + 1) : null
1008
+ console.log(val)
1009
+ }
1010
+ />
1011
+ </View>
1012
+
1013
+ {/* Amount */}
1014
+ <View>
1015
+ <CTextHeader
1016
+ text={'Amount'}
1017
+ widthArr={Dimensions.get('screen').width * 0.2}
1018
+ bgColor={'rgba(184, 184, 191,0.3)'}
1019
+ color={'#094485'}
1020
+ borderColor={'#f5f5f5'}
1021
+ marginHorizontal={normalize(2)}
1022
+ borderRadius={5}
1023
+ elevation={0}
1024
+ />
1025
+ <STextInputNew
1026
+ data={{
1027
+ borderWidth: 1,
1028
+ value:
1029
+ wodetail.amountperqty * wodetail.quantity ||
1030
+ 0,
1031
+ // backgroundColor: 'rgba(161, 188, 196,0.2)',
1032
+ borderColor: 'lightgrey',
1033
+ elevation: 0,
1034
+ borderRadius: 5,
1035
+ fontWeight: 'normal',
1036
+ color: 'black',
1037
+ itemwidth:
1038
+ Dimensions.get('screen').width * 0.2,
1039
+ paddingTop: 5,
1040
+ paddingBottom: 5,
1041
+ height:
1042
+ Dimensions.get('screen').height * 0.05,
1043
+ textAlign: 'start',
1044
+ marginTop: normalize(2),
1045
+ marginHorizontal: normalize(2),
1046
+ fontSize: normalize(12),
1047
+ }}
1048
+ editable={false}
1049
+ keyboardType={'numeric'}
1050
+ callBack={val => {
1051
+ console.log(val);
1052
+ // hanldeDataChange(
1053
+ // orderIndex,
1054
+ // val,
1055
+ // 'totalamount',
1056
+ // );
1057
+ }}
1058
+ />
1059
+ </View>
1060
+ </View>
1061
+ </ScrollView>
1062
+ {overlay ? (
1063
+ <HOverlay
1064
+ component={overlayComponent}
1065
+ visibility={val =>
1066
+ val == undefined ? null : setOverlay(val)
1067
+ }
1068
+ argument={getArguments(
1069
+ overlayComponent,
1070
+ wodetail.insuworkorderdetail,
1071
+ index,
1072
+ )}
1073
+ />
1074
+ ) : null}
1075
+ </View>
1076
+ ))
1077
+ : null}
1078
+ </View>
1079
+ ) : null}
1080
+ </ScrollView>
1081
+ )}
1082
+
1083
+ {backHandler ? (
1084
+ <ConfirmOverlay
1085
+ confirmtext={'Are your sure you want to exit without save ?'}
1086
+ navigation={navigation}
1087
+ saveHandler={val => (val == undefined ? null : setBackHandler(val))}
1088
+ callback={val => {
1089
+ if (val === true) {
1090
+ // setEditStatus(false);
1091
+ setInvoiceData(prevData => ({
1092
+ ...prevData,
1093
+ EditStatus: false,
1094
+ EquipmentUpdate: false,
1095
+ }));
1096
+ setTimeout(() => {
1097
+ navigation.goBack();
1098
+ }, 0);
1099
+ }
1100
+ }}
1101
+ />
1102
+ ) : null}
1103
+ </CDetailView>
1104
+ <CFooterView style={{ backgroundColor: '#fff' }}>
1105
+ {/* Bottom buttons section */}
1106
+ {FooterArr != undefined
1107
+ ? FooterArr.map((item, i) => {
1108
+ return item.visibility ? (
1109
+ // <View key={i} style={{marginLeft: 5}}>
1110
+ // <CustomButton
1111
+ // data={{
1112
+ // ...item,
1113
+ // shadowcolor: '#fff',
1114
+ // iconcolor: '#094485',
1115
+ // fontcolor: '#094485',
1116
+ // }}
1117
+ // callBack={val => {
1118
+ // if (val.keyid === 1) {
1119
+ // val == undefined ? null : getFooterFunctions(val);
1120
+ // } else if (val.keyid === 2) {
1121
+ // navigation.navigate('PdfUnSavedViewer', {
1122
+ // headerblockstyle: {marginBottom: normalize(35)},
1123
+ // data: getDataForPreview(invoiceData),
1124
+ // link:
1125
+ // APIURL +
1126
+ // 'jremr/jrcommonjreport/' +
1127
+ // 'rnintrverificationpreview/0/IndentPreview',
1128
+ // });
1129
+ // }
1130
+ // }}
1131
+ // />
1132
+ // </View>
1133
+ <View
1134
+ style={{
1135
+ flexDirection: 'row',
1136
+ alignItems: 'center',
1137
+ justifyContent: 'flex-start',
1138
+ paddingHorizontal: 2,
1139
+ }}>
1140
+ {FooterArr != undefined
1141
+ ? FooterArr.map((item, i) => {
1142
+ return item.visibility ? (
1143
+ <HShadowCountButton
1144
+ useicon={true}
1145
+ usetext={true}
1146
+ disabled={false}
1147
+ buttonstyle={{
1148
+ ...CButtonShadow(),
1149
+ alignItems: 'center',
1150
+ justifyContent: 'center',
1151
+ borderWidth: 1,
1152
+ borderColor: 'lightblue',
1153
+ borderRadius: 10,
1154
+ height: Dimensions.get('screen').height * 0.055,
1155
+ width: Dimensions.get('screen').height * 0.065,
1156
+ marginVertical: normalize(5),
1157
+ marginHorizontal: normalize(5),
1158
+ }}
1159
+ iconcolor={Global.AppTheme.primary_color}
1160
+ icongroup={item.icongroup ? item.icongroup : 5}
1161
+ iconname={item.iconname}
1162
+ iconsize={normalize(24)}
1163
+ displaytext={item.displaytext}
1164
+ count={item.count}
1165
+ countValue={item.countValue}
1166
+ buttonCallback={() => {
1167
+ if (item.keyid === 1) {
1168
+ val == undefined ? null : getFooterFunctions(val);
1169
+ } else if (item.keyid === 2) {
1170
+ navigation.navigate('PdfUnSavedViewer', {
1171
+ headerblockstyle: { marginBottom: normalize(35) },
1172
+ data: getDataForPreview(invoiceData),
1173
+ link:
1174
+ APIURL +
1175
+ 'jremr/jrcommonjreport/' +
1176
+ 'rnintrverificationpreview/0/IndentPreview',
1177
+ });
1178
+ }
1179
+ // if (item.keyid === 1) {
1180
+ // item == undefined
1181
+ // ? null
1182
+ // : getFooterFunctions(item);
1183
+ // } else if (item.keyid === 2) {
1184
+ // navigation.navigate('PdfUnSavedViewer', {
1185
+ // headerblockstyle: {
1186
+ // marginBottom: normalize(35),
1187
+ // },
1188
+ // data: getDataForPreview(invoiceData),
1189
+ // link:
1190
+ // APIURL +
1191
+ // 'jremr/jrcommonjreport/' +
1192
+ // 'rnintrverificationpreview/0/Procurement',
1193
+ // });
1194
+ // }
1195
+ }}
1196
+ textstyle={{
1197
+ color: Global.AppTheme.primary_color,
1198
+ fontSize: normalize(9),
1199
+ textAlign: 'center',
1200
+ alignSelf: 'center',
1201
+ }}
1202
+ />
1203
+ ) : null;
1204
+ })
1205
+ : null}
1206
+ </View>
1207
+ ) : null;
1208
+ })
1209
+ : null}
1210
+ </CFooterView>
1211
+ </CContainerView>
1212
+ );
1213
+ }