@jescon-technologies/react-native-ui-kit 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -66
- package/index.js +1 -66
- package/package.json +1 -1
- package/src/Alerts/AAlert.js +0 -137
- package/src/Alerts/AAlertIOS.js +0 -97
- package/src/Alerts/ABlink.js +0 -40
- package/src/Common/Icons.js +0 -49
- package/src/Common/NetworkServiceCall.js +0 -265
- package/src/CommonStyle/CommonTheme.js +0 -11
- package/src/CommonStyle/ComponentFunctions.js +0 -632
- package/src/CommonStyle/PopupStyle.js +0 -146
- package/src/CommonStyle/commonStyle.js +0 -93
- package/src/CommonStyle/componentStyle.js +0 -545
- package/src/CommonStyle/optionListStyles.js +0 -175
- package/src/Components/ByProductPage.js +0 -200
- package/src/Components/CDropDownListNew.js +0 -153
- package/src/Components/CSupplierList.js +0 -88
- package/src/Components/CVerificationCard.js +0 -2822
- package/src/Components/CustomButton.js +0 -67
- package/src/Components/CustomCard.js +0 -127
- package/src/Components/CustomTextInput.js +0 -47
- package/src/Components/EquipmentPage.js +0 -313
- package/src/Components/FilterInput.Copy.js +0 -723
- package/src/Components/FilterInput.js +0 -569
- package/src/Components/HSubHeading.js +0 -68
- package/src/Components/HeaderCard.js +0 -40
- package/src/Components/MoreOptionsScreen.js +0 -251
- package/src/Components/NonSwipableProductCard.js +0 -226
- package/src/Components/NonSwipableSupplierCard.js +0 -348
- package/src/Components/ProductCard.js +0 -1336
- package/src/Components/QualityProductCard.js +0 -1059
- package/src/Components/RateProductCard.js +0 -1452
- package/src/Components/RawMaterial.js +0 -261
- package/src/Components/SDropDownEdited.js +0 -549
- package/src/Components/SDropDownNew.js +0 -529
- package/src/Components/SHelpDescription.js +0 -147
- package/src/Components/STextInputNew.js +0 -510
- package/src/Components/SearchProductCard.js +0 -470
- package/src/Components/StageByProduct.js +0 -199
- package/src/Components/SupplierCard.js +0 -243
- package/src/Components/SupplierInvoiceCard.js +0 -405
- package/src/Components/SwipableSupplierCard.js +0 -136
- package/src/Components/TagTemplate.js +0 -74
- package/src/Components/WrappedComponent.js +0 -25
- package/src/Custom/CBooking.js +0 -944
- package/src/Custom/CBookingPostpone.js +0 -1822
- package/src/Custom/CCalendar.js +0 -560
- package/src/Custom/CCard.js +0 -880
- package/src/Custom/CDetailCard.js +0 -205
- package/src/Custom/CHelpImage.js +0 -52
- package/src/Custom/CReport.js +0 -569
- package/src/Custom/CScrollView.js +0 -73
- package/src/Custom/CSignature.js +0 -112
- package/src/Custom/CSliderMenu.js +0 -339
- package/src/Custom/CSupplierCard.js +0 -99
- package/src/Custom/CTemplateCard.js +0 -438
- package/src/Custom/CTokenAllocation.js +0 -1402
- package/src/Custom/CTokenListOverlay.js +0 -122
- package/src/Custom/CWardStatus.js +0 -444
- package/src/Custom/Charts/CBarChart.js +0 -218
- package/src/Custom/Charts/CDashBoardList.js +0 -133
- package/src/Custom/Charts/CDashBoardTable.js +0 -172
- package/src/Custom/Charts/CLineChart.js +0 -193
- package/src/Custom/Charts/CPieChart.js +0 -186
- package/src/Custom/Loader.js +0 -182
- package/src/Custom/OUserView.js +0 -1121
- package/src/Custom/PreviewDosage.js +0 -115
- package/src/Custom/SearchLoader.js +0 -32
- package/src/Custom/TableComponent/CActivityTable.js +0 -707
- package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
- package/src/Custom/TableComponent/CTable.js +0 -185
- package/src/Custom/TableComponent/CTextBody.js +0 -40
- package/src/Custom/TableComponent/CTextHeader.js +0 -17
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
- package/src/Custom/TableComponent/SDropdownTable.js +0 -491
- package/src/Custom/TableComponent/TagTable.js +0 -1200
- package/src/CustomComponents/CAddColumn.js +0 -140
- package/src/CustomComponents/CAssessmentDelete.js +0 -307
- package/src/CustomComponents/CAwesomeButton.js +0 -83
- package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
- package/src/CustomComponents/CBackHandler.js +0 -273
- package/src/CustomComponents/CCalendar.js +0 -243
- package/src/CustomComponents/CCommentOverlay.js +0 -202
- package/src/CustomComponents/CComments.js +0 -162
- package/src/CustomComponents/CContainerView.js +0 -24
- package/src/CustomComponents/CCustomTextInput.js +0 -336
- package/src/CustomComponents/CDetailView.js +0 -40
- package/src/CustomComponents/CDropDownList.js +0 -153
- package/src/CustomComponents/CDropdownSelect.js +0 -555
- package/src/CustomComponents/CFooterView.js +0 -42
- package/src/CustomComponents/CImagePickerSave.js +0 -316
- package/src/CustomComponents/CModalOverlay.js +0 -91
- package/src/CustomComponents/CNetworkStatus.js +0 -327
- package/src/CustomComponents/CNotesInstructions.js +0 -1000
- package/src/CustomComponents/COverlay.js +0 -81
- package/src/CustomComponents/CRemarks.js +0 -176
- package/src/CustomComponents/CRowAdd.js +0 -143
- package/src/CustomComponents/CSummaryDropDown.js +0 -327
- package/src/CustomComponents/CText.js +0 -9
- package/src/CustomComponents/CVectorIcon.js +0 -34
- package/src/CustomComponents/HtmlContentViewer.js +0 -65
- package/src/CustomComponents/PdfContentViewer.js +0 -90
- package/src/CustomComponents/SDropDownDosage.js +0 -1087
- package/src/CustomComponents/SwipableProductCard.js +0 -246
- package/src/CustomComponents/SwipableProductImageCard.js +0 -254
- package/src/CustomComponents/WorkOrderDetails.js +0 -1216
- package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
- package/src/HOC/ConfirmOverlay.js +0 -192
- package/src/HOC/HHeading.js +0 -70
- package/src/HOC/HMoreButton.js +0 -88
- package/src/HOC/HNatureHeading.js +0 -402
- package/src/HOC/HOCIcons.js +0 -80
- package/src/HOC/HOverlayCentered.js +0 -140
- package/src/HOC/HShadowButton.js +0 -45
- package/src/HOC/HShadowCountButton.js +0 -82
- package/src/HOC/OptionOverlay.js +0 -48
- package/src/Json/Chart.json +0 -818
- package/src/Json/Consultation.json +0 -622
- package/src/Json/CreditBill.json +0 -490
- package/src/Json/Dropdown.json +0 -216
- package/src/Json/DropdownConsultation.json +0 -228
- package/src/Json/DynamicReports.json +0 -623
- package/src/Json/Footer.json +0 -79
- package/src/Media/AudioScreen.js +0 -342
- package/src/Media/BarcodeScan.js +0 -145
- package/src/Media/CAudioPlay.js +0 -228
- package/src/Media/CCaptureImageWithoutEdit.js +0 -330
- package/src/Media/CImageGallery.js +0 -289
- package/src/Media/CImageZoom.js +0 -82
- package/src/Media/CSingleImage.js +0 -391
- package/src/Media/CSketchCanvas.js +0 -76
- package/src/Media/CVideoPlay.js +0 -31
- package/src/Media/DocumentScreen.js +0 -362
- package/src/Media/DrawingScreen.js +0 -578
- package/src/Media/ImageScreen.js +0 -309
- package/src/Media/RecordAudio.js +0 -250
- package/src/Media/RecordVideo.js +0 -223
- package/src/Media/VideoScreen.js +0 -378
- package/src/Navigation/PageNavigation.js +0 -224
- package/src/Navigation/useFocusEffect.js +0 -2
- package/src/Navigation/useFocusEffect.native.js +0 -1
- package/src/Navigation/useFocusEffect.web.js +0 -1
- package/src/Navigation/useIsFocused.js +0 -1
- package/src/Navigation/useIsFocused.native.js +0 -1
- package/src/Navigation/useIsFocused.web.js +0 -1
- package/src/Navigation/useNavigation.js +0 -2
- package/src/Navigation/useNavigation.native.js +0 -1
- package/src/Navigation/useNavigation.web.js +0 -1
- package/src/Screens/CMedications.js +0 -528
- package/src/Screens/CWebViewGallery.js +0 -203
- package/src/Screens/ChartScan.js +0 -279
- package/src/Screens/ChartScreenNew.js +0 -1579
- package/src/Screens/Consultation.js +0 -1500
- package/src/Screens/Dashboard.js +0 -778
- package/src/Screens/FileExplorer.js +0 -288
- package/src/Screens/Footer.js +0 -340
- package/src/Screens/ForgotPassword.js +0 -288
- package/src/Screens/HeaderBlock.js +0 -353
- package/src/Screens/Login.js +0 -328
- package/src/Screens/Notification.js +0 -149
- package/src/Screens/OcrScreen.js +0 -20
- package/src/Screens/PdfPreview.js +0 -507
- package/src/Screens/RegistrationDetails.js +0 -467
- package/src/Screens/SearchScreen.js +0 -582
- package/src/Screens/Splash.js +0 -788
- package/src/Screens/SwipeLeftView.js +0 -1867
- package/src/StaticComponents/SAlphabet.js +0 -47
- package/src/StaticComponents/SCheckBox.js +0 -42
- package/src/StaticComponents/SDatePicker.js +0 -208
- package/src/StaticComponents/SDatePickerLabel.js +0 -253
- package/src/StaticComponents/SDatePickerNew.js +0 -258
- package/src/StaticComponents/SDateTimePickerNew.js +0 -381
- package/src/StaticComponents/SDropDownGenerate.js +0 -450
- package/src/StaticComponents/SDropDownHoc.js +0 -636
- package/src/StaticComponents/SDropDownIcon.js +0 -500
- package/src/StaticComponents/SMenuBox.js +0 -131
- package/src/StaticComponents/SOverlay.js +0 -177
- package/src/StaticComponents/SOverlayTextInput.js +0 -109
- package/src/StaticComponents/SSearch.js +0 -438
- package/src/StaticComponents/SSearchBar.js +0 -53
- package/src/StaticComponents/SSpeedDial.js +0 -303
- package/src/StaticComponents/STextInput.js +0 -289
- package/src/StaticComponents/STextInputProps.js +0 -36
- package/src/StaticComponents/STimePicker.js +0 -171
- package/src/StaticComponents/STimingDropDownNew.js +0 -1585
- package/src/StaticComponents/STimingSwitch.js +0 -34
- package/src/layout/CContainerView.js +0 -21
- package/src/layout/CDetailView.js +0 -81
- package/src/layout/HeaderBlock.js +0 -353
- package/src/layout/INVLoginLayout.js +0 -657
- package/src/layout/Loader.js +0 -176
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import { View, Text, TouchableOpacity } from 'react-native';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import moment from 'moment';
|
|
4
|
-
import { CButtonShadow, isNUQ } from '../CommonStyle/ComponentFunctions';
|
|
5
|
-
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
6
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
7
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
8
|
-
import { useNavigation } from '../Navigation/useNavigation';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const SupplierCard = ({ supplierName, invoiceNumber, invoiceDate, supplierCode }) => {
|
|
13
|
-
const navigation = useNavigation();
|
|
14
|
-
return (
|
|
15
|
-
// Swipable card
|
|
16
|
-
// <View>
|
|
17
|
-
// <SwipeRow
|
|
18
|
-
// swipeToOpenPercent={1}
|
|
19
|
-
// swipeToClosePercent={1}
|
|
20
|
-
// leftOpenValue={normalize(80)}
|
|
21
|
-
// rightOpenValue={normalize(-80)}
|
|
22
|
-
// style={{
|
|
23
|
-
// borderRadius: 10,
|
|
24
|
-
// width: '100%',
|
|
25
|
-
// }}
|
|
26
|
-
// >
|
|
27
|
-
// <View
|
|
28
|
-
// style={{
|
|
29
|
-
// flexDirection: 'row',
|
|
30
|
-
// justifyContent: 'space-between',
|
|
31
|
-
// marginVertical: 10,
|
|
32
|
-
// marginHorizontal: 20,
|
|
33
|
-
// borderRadius: 10,
|
|
34
|
-
// flex: 1,
|
|
35
|
-
// }}
|
|
36
|
-
// >
|
|
37
|
-
// {/* Left Action */}
|
|
38
|
-
// <TouchableOpacity
|
|
39
|
-
// style={{
|
|
40
|
-
// flex: 1,
|
|
41
|
-
// backgroundColor: '#4caf50',
|
|
42
|
-
// justifyContent: 'center',
|
|
43
|
-
// alignItems: 'center',
|
|
44
|
-
// borderTopLeftRadius: 10,
|
|
45
|
-
// borderBottomLeftRadius: 10,
|
|
46
|
-
// }}
|
|
47
|
-
// onPress={() => {
|
|
48
|
-
// // rowMap[data.item.key].closeRow();
|
|
49
|
-
// alert('Left action executed!');
|
|
50
|
-
// }}
|
|
51
|
-
// >
|
|
52
|
-
// <Text style={{ color: '#fff', fontWeight: 'bold' }}>Left Action</Text>
|
|
53
|
-
// </TouchableOpacity>
|
|
54
|
-
|
|
55
|
-
// {/* Right Action */}
|
|
56
|
-
// <TouchableOpacity
|
|
57
|
-
// style={{
|
|
58
|
-
// flex: 1,
|
|
59
|
-
// backgroundColor: '#f44336',
|
|
60
|
-
// justifyContent: 'center',
|
|
61
|
-
// alignItems: 'center',
|
|
62
|
-
// borderTopRightRadius: 10,
|
|
63
|
-
// borderBottomRightRadius: 10,
|
|
64
|
-
// }}
|
|
65
|
-
// onPress={() => {
|
|
66
|
-
// // rowMap[data.item.key].closeRow();
|
|
67
|
-
// alert('Right action executed!');
|
|
68
|
-
// }}
|
|
69
|
-
// >
|
|
70
|
-
// <Text style={{ color: '#fff', fontWeight: 'bold' }}>Right Action</Text>
|
|
71
|
-
// </TouchableOpacity>
|
|
72
|
-
// </View>
|
|
73
|
-
|
|
74
|
-
// <View
|
|
75
|
-
// style={{
|
|
76
|
-
// backgroundColor: '#fff',
|
|
77
|
-
// padding: 10,
|
|
78
|
-
// borderRadius: 10,
|
|
79
|
-
// shadowColor: '#000',
|
|
80
|
-
// shadowOpacity: 0.1,
|
|
81
|
-
// shadowRadius: 5,
|
|
82
|
-
// elevation: 3,
|
|
83
|
-
// marginVertical: 5,
|
|
84
|
-
// marginHorizontal: 1,
|
|
85
|
-
// // width: Dimensions.get('screen').width * 0.95,
|
|
86
|
-
// borderLeftWidth: 3,
|
|
87
|
-
// borderLeftColor: '#094485',
|
|
88
|
-
// }}
|
|
89
|
-
// >
|
|
90
|
-
// <View>
|
|
91
|
-
// {supplierName && <Text style={{ fontSize: 16, fontWeight: 'bold', color: '#094485' }}>
|
|
92
|
-
// {supplierName}
|
|
93
|
-
// </Text>}
|
|
94
|
-
// <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
95
|
-
// {invoiceNumber && <Text style={{ fontSize: 14, fontWeight: 'bold', color: '#333' }}>
|
|
96
|
-
// {invoiceNumber}
|
|
97
|
-
// </Text>}
|
|
98
|
-
// {invoiceDate && <Text style={{ fontSize: 14, fontWeight: 'bold', color: '#333' }}>
|
|
99
|
-
// Date : {moment(invoiceDate).format('DD-MM-YYYY')}
|
|
100
|
-
// </Text>}
|
|
101
|
-
// </View>
|
|
102
|
-
// </View>
|
|
103
|
-
// {/* <View>
|
|
104
|
-
// {supplierDetails?.grade && <View style={{
|
|
105
|
-
// height: 60,
|
|
106
|
-
// width: 60,
|
|
107
|
-
// backgroundColor: 'lightgrey',
|
|
108
|
-
// borderRadius: 30,
|
|
109
|
-
// justifyContent: 'center',
|
|
110
|
-
// alignItems: 'center'
|
|
111
|
-
// }}>
|
|
112
|
-
// <Text style={{ fontSize: 20, fontWeight: 'bold', color: '#094485' }}>
|
|
113
|
-
// {supplierDetails.grade}
|
|
114
|
-
// </Text>
|
|
115
|
-
// <Text
|
|
116
|
-
// style={{ fontSize: 12 }}>Grade</Text>
|
|
117
|
-
// </View>}
|
|
118
|
-
// </View> */}
|
|
119
|
-
// </View>
|
|
120
|
-
// </SwipeRow>
|
|
121
|
-
// </View>
|
|
122
|
-
|
|
123
|
-
// Normal card
|
|
124
|
-
<View
|
|
125
|
-
style={{
|
|
126
|
-
padding: normalize(5),
|
|
127
|
-
marginVertical: 5,
|
|
128
|
-
borderLeftWidth: normalize(10),
|
|
129
|
-
borderLeftColor: '#083787',
|
|
130
|
-
backgroundColor: '#ebf1fa',
|
|
131
|
-
marginHorizontal: normalize(10),
|
|
132
|
-
marginBottom: normalize(10),
|
|
133
|
-
borderRadius: normalize(5),
|
|
134
|
-
shadowColor: Global.AppTheme.primary_color,
|
|
135
|
-
shadowOffset: { width: 4, height: 4 },
|
|
136
|
-
shadowOpacity: 0.6,
|
|
137
|
-
shadowRadius: 10,
|
|
138
|
-
elevation: 8,
|
|
139
|
-
...CButtonShadow(),
|
|
140
|
-
}}>
|
|
141
|
-
<View
|
|
142
|
-
style={{
|
|
143
|
-
flexDirection: 'row',
|
|
144
|
-
justifyContent: 'space-between',
|
|
145
|
-
}}>
|
|
146
|
-
<View>
|
|
147
|
-
{/* Supplier name */}
|
|
148
|
-
{isNUQ(supplierName) ? (
|
|
149
|
-
<Text
|
|
150
|
-
numberOfLines={1}
|
|
151
|
-
style={{
|
|
152
|
-
fontSize: normalize(12),
|
|
153
|
-
paddingLeft: normalize(5),
|
|
154
|
-
fontWeight: 'bold',
|
|
155
|
-
color: Global.AppTheme.primary_color,
|
|
156
|
-
}}>
|
|
157
|
-
{supplierName}
|
|
158
|
-
</Text>
|
|
159
|
-
) : null}
|
|
160
|
-
{/* Section */}
|
|
161
|
-
<View>
|
|
162
|
-
{/* Invoice number */}
|
|
163
|
-
{isNUQ(invoiceNumber) ? (
|
|
164
|
-
<View
|
|
165
|
-
style={{
|
|
166
|
-
flexDirection: 'row',
|
|
167
|
-
alignItems: 'center',
|
|
168
|
-
paddingLeft: normalize(5),
|
|
169
|
-
}}>
|
|
170
|
-
<Icons.FontAwesome5
|
|
171
|
-
name={'file-invoice'}
|
|
172
|
-
size={normalize(11)}
|
|
173
|
-
color={'#094485'}
|
|
174
|
-
/>
|
|
175
|
-
<Text
|
|
176
|
-
style={{
|
|
177
|
-
fontSize: 10,
|
|
178
|
-
color: '#555',
|
|
179
|
-
marginLeft: normalize(5),
|
|
180
|
-
}}>
|
|
181
|
-
{invoiceNumber}
|
|
182
|
-
</Text>
|
|
183
|
-
</View>
|
|
184
|
-
) : null}
|
|
185
|
-
{/* Date */}
|
|
186
|
-
{isNUQ(invoiceDate) ? (
|
|
187
|
-
<View
|
|
188
|
-
style={{
|
|
189
|
-
flexDirection: 'row',
|
|
190
|
-
alignItems: 'center',
|
|
191
|
-
paddingLeft: normalize(5),
|
|
192
|
-
}}>
|
|
193
|
-
<Icons.FontAwesome5
|
|
194
|
-
name={'calendar-alt'}
|
|
195
|
-
size={normalize(11)}
|
|
196
|
-
color={'#094485'}
|
|
197
|
-
/>
|
|
198
|
-
<Text
|
|
199
|
-
style={{
|
|
200
|
-
fontSize: 10,
|
|
201
|
-
color: '#555',
|
|
202
|
-
marginLeft: normalize(5),
|
|
203
|
-
}}>
|
|
204
|
-
{moment(invoiceDate).format('DD-MM-YYYY')}
|
|
205
|
-
</Text>
|
|
206
|
-
</View>
|
|
207
|
-
) : null}
|
|
208
|
-
</View>
|
|
209
|
-
</View>
|
|
210
|
-
<View>
|
|
211
|
-
<TouchableOpacity onPress={() => {
|
|
212
|
-
console.log(supplierCode);
|
|
213
|
-
navigation.navigate('CPurchaseDetails', {
|
|
214
|
-
supplierCode: supplierCode,
|
|
215
|
-
// productCode: invoiceData?.data[sectionIndex]?.productdetail[productIndex]?.insuproduct
|
|
216
|
-
});
|
|
217
|
-
}}>
|
|
218
|
-
<Icons.Entypo
|
|
219
|
-
name={'info-with-circle'}
|
|
220
|
-
size={normalize(19)}
|
|
221
|
-
color={'#094485'}
|
|
222
|
-
/>
|
|
223
|
-
</TouchableOpacity>
|
|
224
|
-
</View>
|
|
225
|
-
</View>
|
|
226
|
-
{/* <View>
|
|
227
|
-
{supplierName != undefined && supplierName != null && supplierName != '' ? <Text style={{ fontSize: 16, fontWeight: 'bold', color: '#094485' }}>
|
|
228
|
-
{supplierName}
|
|
229
|
-
</Text> : null}
|
|
230
|
-
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
231
|
-
{invoiceNumber != undefined && invoiceNumber != null && invoiceNumber != '' ? <Text style={{ fontSize: 14, fontWeight: '600', color: '#000' }}>
|
|
232
|
-
{invoiceNumber}
|
|
233
|
-
</Text> : null}
|
|
234
|
-
{invoiceDate != undefined && invoiceDate != null && invoiceDate != '' ? <Text style={{ fontSize: 14, fontWeight: '600', color: '#000' }}>
|
|
235
|
-
<Text style={{ fontSize: 14, fontWeight: '400', color: '#000' }}>Date : </Text>{moment(invoiceDate).format('DD-MM-YYYY')}
|
|
236
|
-
</Text> : null}
|
|
237
|
-
</View>
|
|
238
|
-
</View> */}
|
|
239
|
-
</View>
|
|
240
|
-
);
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export default SupplierCard;
|
|
@@ -1,405 +0,0 @@
|
|
|
1
|
-
import {View, Text, Dimensions} from 'react-native';
|
|
2
|
-
import React, {useState} from 'react';
|
|
3
|
-
import { useNavigation } from '../Navigation/useNavigation';
|
|
4
|
-
|
|
5
|
-
import {TouchableOpacity} from 'react-native';
|
|
6
|
-
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
7
|
-
import moment from 'moment';
|
|
8
|
-
import {normalize} from '../CommonStyle/componentStyle';
|
|
9
|
-
import {Global} from '../../../../../src/Common/Global';
|
|
10
|
-
import {isNUQ} from '../CommonStyle/ComponentFunctions';
|
|
11
|
-
import { SwipeRow } from 'react-native-swipe-list-view';
|
|
12
|
-
|
|
13
|
-
const SupplierInvoiceCard = ({
|
|
14
|
-
supplier,
|
|
15
|
-
verification,
|
|
16
|
-
screen,
|
|
17
|
-
renderLeftActions,
|
|
18
|
-
renderRightActions,
|
|
19
|
-
}) => {
|
|
20
|
-
const [expanded, setExpanded] = useState(false);
|
|
21
|
-
const navigation = useNavigation();
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<SwipeRow
|
|
25
|
-
disableLeftSwipe={false}
|
|
26
|
-
disableRightSwipe={false}
|
|
27
|
-
leftOpenValue={190}
|
|
28
|
-
rightOpenValue={-190}
|
|
29
|
-
swipeToClosePercent={10}
|
|
30
|
-
swipeToOpenPercent={10}
|
|
31
|
-
>
|
|
32
|
-
{/* Hidden Row (Swipe Actions) */}
|
|
33
|
-
<View style={{
|
|
34
|
-
borderWidth: 0,
|
|
35
|
-
flexDirection: 'row',
|
|
36
|
-
justifyContent: 'space-between',
|
|
37
|
-
minHeight: normalize(70),
|
|
38
|
-
}}>
|
|
39
|
-
<View style={{ flex: 1, alignItems: 'flex-start' }}>
|
|
40
|
-
{renderLeftActions && renderLeftActions()}
|
|
41
|
-
</View>
|
|
42
|
-
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
|
43
|
-
{renderRightActions && renderRightActions()}
|
|
44
|
-
</View>
|
|
45
|
-
</View>
|
|
46
|
-
|
|
47
|
-
{/* Main Content */}
|
|
48
|
-
<View>
|
|
49
|
-
{/* Top card */}
|
|
50
|
-
<View
|
|
51
|
-
style={{
|
|
52
|
-
backgroundColor: '#faeeeb',
|
|
53
|
-
marginHorizontal: normalize(10),
|
|
54
|
-
marginBottom: normalize(10),
|
|
55
|
-
borderRadius: normalize(5),
|
|
56
|
-
shadowColor: Global.AppTheme.primary_color,
|
|
57
|
-
shadowOffset: {width: 4, height: 4},
|
|
58
|
-
shadowOpacity: 0.6,
|
|
59
|
-
shadowRadius: 10,
|
|
60
|
-
elevation: 8,
|
|
61
|
-
}}>
|
|
62
|
-
<View style={{flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-start'}}>
|
|
63
|
-
<View style={{flex: 1, flexDirection: 'row'}}>
|
|
64
|
-
<View
|
|
65
|
-
style={{
|
|
66
|
-
backgroundColor: '#870808',
|
|
67
|
-
width: normalize(10),
|
|
68
|
-
height: normalize(50),
|
|
69
|
-
borderStartStartRadius: normalize(5),
|
|
70
|
-
borderStartEndRadius: normalize(5),
|
|
71
|
-
}} />
|
|
72
|
-
<View style={{padding: normalize(3), flex: 1}}>
|
|
73
|
-
{/* Supplier name */}
|
|
74
|
-
{isNUQ(supplier.suppliername) ? (
|
|
75
|
-
<Text
|
|
76
|
-
numberOfLines={1}
|
|
77
|
-
style={{
|
|
78
|
-
fontSize: normalize(12),
|
|
79
|
-
paddingLeft: normalize(5),
|
|
80
|
-
fontWeight: 'bold',
|
|
81
|
-
color: Global.AppTheme.primary_color,
|
|
82
|
-
}}>
|
|
83
|
-
{supplier.suppliername}
|
|
84
|
-
</Text>
|
|
85
|
-
) : null}
|
|
86
|
-
|
|
87
|
-
{/* Section */}
|
|
88
|
-
<View
|
|
89
|
-
style={{
|
|
90
|
-
flexDirection: 'row',
|
|
91
|
-
width: '100%',
|
|
92
|
-
paddingRight: normalize(10),
|
|
93
|
-
}}>
|
|
94
|
-
{/* Section */}
|
|
95
|
-
<View style={{flex: 1}}>
|
|
96
|
-
<View style={{flexDirection: 'row'}}>
|
|
97
|
-
{/* Phone no */}
|
|
98
|
-
{isNUQ(supplier.phoneno) ? (
|
|
99
|
-
<View
|
|
100
|
-
style={{
|
|
101
|
-
flexDirection: 'row',
|
|
102
|
-
alignItems: 'center',
|
|
103
|
-
paddingLeft: normalize(5),
|
|
104
|
-
}}>
|
|
105
|
-
<Icons.FontAwesome5
|
|
106
|
-
name={'phone'}
|
|
107
|
-
size={normalize(11)}
|
|
108
|
-
color={'#094485'}
|
|
109
|
-
/>
|
|
110
|
-
<Text
|
|
111
|
-
style={{
|
|
112
|
-
fontSize: 10,
|
|
113
|
-
color: '#555',
|
|
114
|
-
marginLeft: normalize(5),
|
|
115
|
-
}}>
|
|
116
|
-
{supplier.phoneno}
|
|
117
|
-
</Text>
|
|
118
|
-
</View>
|
|
119
|
-
) : null}
|
|
120
|
-
|
|
121
|
-
{/* email */}
|
|
122
|
-
{isNUQ(supplier.email) ? (
|
|
123
|
-
<View
|
|
124
|
-
style={{
|
|
125
|
-
flexDirection: 'row',
|
|
126
|
-
alignItems: 'center',
|
|
127
|
-
paddingLeft: normalize(5),
|
|
128
|
-
}}>
|
|
129
|
-
<Icons.FontAwesome5
|
|
130
|
-
name={'envelope'}
|
|
131
|
-
size={normalize(11)}
|
|
132
|
-
color={'#094485'}
|
|
133
|
-
/>
|
|
134
|
-
<Text
|
|
135
|
-
numberOfLines={1}
|
|
136
|
-
style={{
|
|
137
|
-
fontSize: 10,
|
|
138
|
-
color: '#555',
|
|
139
|
-
marginLeft: normalize(5),
|
|
140
|
-
}}>
|
|
141
|
-
{supplier.email}
|
|
142
|
-
</Text>
|
|
143
|
-
</View>
|
|
144
|
-
) : null}
|
|
145
|
-
</View>
|
|
146
|
-
|
|
147
|
-
<View style={{flexDirection: 'row'}}>
|
|
148
|
-
{/* Place */}
|
|
149
|
-
{isNUQ(supplier.town) ? (
|
|
150
|
-
<View
|
|
151
|
-
style={{
|
|
152
|
-
flexDirection: 'row',
|
|
153
|
-
alignItems: 'center',
|
|
154
|
-
paddingLeft: normalize(5),
|
|
155
|
-
}}>
|
|
156
|
-
<Icons.FontAwesome5
|
|
157
|
-
name={'map-marker-alt'}
|
|
158
|
-
size={normalize(11)}
|
|
159
|
-
color={'#094485'}
|
|
160
|
-
/>
|
|
161
|
-
<Text
|
|
162
|
-
style={{
|
|
163
|
-
fontSize: 10,
|
|
164
|
-
color: '#555',
|
|
165
|
-
marginLeft: normalize(5),
|
|
166
|
-
}}>
|
|
167
|
-
{supplier.town}
|
|
168
|
-
</Text>
|
|
169
|
-
</View>
|
|
170
|
-
) : null}
|
|
171
|
-
|
|
172
|
-
{/* Pin */}
|
|
173
|
-
{isNUQ(supplier.pin) ? (
|
|
174
|
-
<View
|
|
175
|
-
style={{
|
|
176
|
-
flexDirection: 'row',
|
|
177
|
-
alignItems: 'center',
|
|
178
|
-
paddingLeft: normalize(5),
|
|
179
|
-
}}>
|
|
180
|
-
<Icons.FontAwesome5
|
|
181
|
-
name={'map-marker-alt'}
|
|
182
|
-
size={normalize(11)}
|
|
183
|
-
color={'#094485'}
|
|
184
|
-
/>
|
|
185
|
-
<Text
|
|
186
|
-
numberOfLines={1}
|
|
187
|
-
style={{
|
|
188
|
-
fontSize: 10,
|
|
189
|
-
color: '#555',
|
|
190
|
-
marginLeft: normalize(5),
|
|
191
|
-
}}>
|
|
192
|
-
{supplier.pin}
|
|
193
|
-
</Text>
|
|
194
|
-
</View>
|
|
195
|
-
) : null}
|
|
196
|
-
</View>
|
|
197
|
-
</View>
|
|
198
|
-
</View>
|
|
199
|
-
</View>
|
|
200
|
-
</View>
|
|
201
|
-
|
|
202
|
-
{/* Buttons Wrapper - Grade and Expand Button */}
|
|
203
|
-
<View style={{flexDirection: 'row', alignItems: 'center', paddingRight: normalize(10), paddingTop: normalize(3)}}>
|
|
204
|
-
{/* Grade Button */}
|
|
205
|
-
<View>
|
|
206
|
-
{supplier?.grade && (
|
|
207
|
-
<View
|
|
208
|
-
style={{
|
|
209
|
-
height: 40,
|
|
210
|
-
width: 40,
|
|
211
|
-
backgroundColor: '#870808',
|
|
212
|
-
borderRadius: 20,
|
|
213
|
-
justifyContent: 'center',
|
|
214
|
-
alignItems: 'center',
|
|
215
|
-
marginRight: normalize(10),
|
|
216
|
-
}}>
|
|
217
|
-
<Text
|
|
218
|
-
style={{
|
|
219
|
-
fontSize: 20,
|
|
220
|
-
fontWeight: 'bold',
|
|
221
|
-
color: '#fff',
|
|
222
|
-
}}>
|
|
223
|
-
{supplier.grade}
|
|
224
|
-
</Text>
|
|
225
|
-
</View>
|
|
226
|
-
)}
|
|
227
|
-
</View>
|
|
228
|
-
{/* Expand Button */}
|
|
229
|
-
<TouchableOpacity
|
|
230
|
-
style={{
|
|
231
|
-
justifyContent: 'center',
|
|
232
|
-
alignItems: 'center',
|
|
233
|
-
padding: normalize(10),
|
|
234
|
-
}}
|
|
235
|
-
onPress={() => {
|
|
236
|
-
setExpanded(!expanded);
|
|
237
|
-
}}>
|
|
238
|
-
<View
|
|
239
|
-
style={{
|
|
240
|
-
width: 30,
|
|
241
|
-
height: 30,
|
|
242
|
-
justifyContent: 'center',
|
|
243
|
-
alignItems: 'center',
|
|
244
|
-
}}>
|
|
245
|
-
<Icons.FontAwesome5
|
|
246
|
-
name={
|
|
247
|
-
expanded == true
|
|
248
|
-
? 'chevron-circle-up'
|
|
249
|
-
: 'chevron-circle-down'
|
|
250
|
-
}
|
|
251
|
-
size={normalize(18)}
|
|
252
|
-
color={'#094485'}
|
|
253
|
-
/>
|
|
254
|
-
</View>
|
|
255
|
-
</TouchableOpacity>
|
|
256
|
-
</View>
|
|
257
|
-
</View>
|
|
258
|
-
</View>
|
|
259
|
-
|
|
260
|
-
{/* Expanded section */}
|
|
261
|
-
{expanded && (
|
|
262
|
-
<View>
|
|
263
|
-
{supplier.invoicedetail != undefined &&
|
|
264
|
-
supplier.invoicedetail != null &&
|
|
265
|
-
supplier.invoicedetail != ''
|
|
266
|
-
? supplier.invoicedetail.map((invoice, i) => (
|
|
267
|
-
<TouchableOpacity
|
|
268
|
-
key={invoice.invoiceno + invoice.invoicedate + i}
|
|
269
|
-
onPress={() => {
|
|
270
|
-
if (screen == 1) {
|
|
271
|
-
if (verification == true) {
|
|
272
|
-
navigation.navigate('CInvoiceRateVerificationScreen', {
|
|
273
|
-
suppliercode: supplier.insusupplier,
|
|
274
|
-
invoicenumber: invoice.invoiceno,
|
|
275
|
-
suppliername: supplier.suppliername,
|
|
276
|
-
invoicedate: invoice.invoicedate,
|
|
277
|
-
invoicetablecode: invoice.intrpu,
|
|
278
|
-
});
|
|
279
|
-
} else {
|
|
280
|
-
navigation.navigate('CInvoiceRateEntryScreen', {
|
|
281
|
-
suppliercode: supplier.insusupplier,
|
|
282
|
-
invoicenumber: invoice.invoiceno,
|
|
283
|
-
suppliername: supplier.suppliername,
|
|
284
|
-
invoicedate: invoice.invoicedate,
|
|
285
|
-
invoicetablecode: invoice.intrpu,
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
} else if (screen == 2) {
|
|
289
|
-
if (verification == true) {
|
|
290
|
-
navigation.navigate(
|
|
291
|
-
'CInvoiceQualityVerificationScreen',
|
|
292
|
-
{
|
|
293
|
-
suppliercode: supplier.insusupplier,
|
|
294
|
-
invoicenumber: invoice.invoiceno,
|
|
295
|
-
suppliername: supplier.suppliername,
|
|
296
|
-
invoicedate: invoice.invoicedate,
|
|
297
|
-
invoicetablecode: invoice.intrpu,
|
|
298
|
-
},
|
|
299
|
-
);
|
|
300
|
-
} else {
|
|
301
|
-
navigation.navigate('CInvoiceQualityEntryScreen', {
|
|
302
|
-
suppliercode: supplier.insusupplier,
|
|
303
|
-
invoicenumber: invoice.invoiceno,
|
|
304
|
-
suppliername: supplier.suppliername,
|
|
305
|
-
invoicedate: invoice.invoicedate,
|
|
306
|
-
invoicetablecode: invoice.intrpu,
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
} else if (screen == 3) {
|
|
310
|
-
if (verification == true) {
|
|
311
|
-
navigation.navigate(
|
|
312
|
-
'CInvoiceQuantityVerificationScreen',
|
|
313
|
-
{
|
|
314
|
-
suppliercode: supplier.insusupplier,
|
|
315
|
-
invoicenumber: invoice.invoiceno,
|
|
316
|
-
suppliername: supplier.suppliername,
|
|
317
|
-
invoicedate: invoice.invoicedate,
|
|
318
|
-
invoicetablecode: invoice.intrpu,
|
|
319
|
-
},
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}}
|
|
324
|
-
style={{
|
|
325
|
-
padding: normalize(5),
|
|
326
|
-
marginVertical: 5,
|
|
327
|
-
borderLeftWidth: normalize(10),
|
|
328
|
-
borderLeftColor: '#083787',
|
|
329
|
-
backgroundColor: '#ebf1fa',
|
|
330
|
-
marginHorizontal: normalize(10),
|
|
331
|
-
marginBottom: normalize(10),
|
|
332
|
-
borderRadius: normalize(5),
|
|
333
|
-
shadowColor: Global.AppTheme.primary_color,
|
|
334
|
-
shadowOffset: {width: 4, height: 4},
|
|
335
|
-
shadowOpacity: 0.6,
|
|
336
|
-
shadowRadius: 10,
|
|
337
|
-
elevation: 8,
|
|
338
|
-
}}>
|
|
339
|
-
<View
|
|
340
|
-
style={{
|
|
341
|
-
flexDirection: 'row',
|
|
342
|
-
justifyContent: 'space-between',
|
|
343
|
-
}}>
|
|
344
|
-
<View>
|
|
345
|
-
{/* invoice no */}
|
|
346
|
-
{isNUQ(invoice.invoiceno) ? (
|
|
347
|
-
<Text
|
|
348
|
-
numberOfLines={1}
|
|
349
|
-
style={{
|
|
350
|
-
fontSize: normalize(12),
|
|
351
|
-
paddingLeft: normalize(5),
|
|
352
|
-
fontWeight: 'bold',
|
|
353
|
-
color: Global.AppTheme.primary_color,
|
|
354
|
-
}}>
|
|
355
|
-
{invoice.invoiceno}
|
|
356
|
-
</Text>
|
|
357
|
-
) : null}
|
|
358
|
-
{/* Date */}
|
|
359
|
-
{/* Indent no */}
|
|
360
|
-
{isNUQ(invoice.invoicedate) ? (
|
|
361
|
-
<View
|
|
362
|
-
style={{
|
|
363
|
-
flexDirection: 'row',
|
|
364
|
-
alignItems: 'center',
|
|
365
|
-
paddingLeft: normalize(5),
|
|
366
|
-
}}>
|
|
367
|
-
<Icons.FontAwesome5
|
|
368
|
-
name={'calendar-alt'}
|
|
369
|
-
size={normalize(11)}
|
|
370
|
-
color={'#094485'}
|
|
371
|
-
/>
|
|
372
|
-
<Text
|
|
373
|
-
style={{
|
|
374
|
-
fontSize: 10,
|
|
375
|
-
color: '#555',
|
|
376
|
-
marginLeft: normalize(5),
|
|
377
|
-
}}>
|
|
378
|
-
{moment(invoice.invoicedate).format('DD-MM-YYYY')}
|
|
379
|
-
</Text>
|
|
380
|
-
</View>
|
|
381
|
-
) : null}
|
|
382
|
-
</View>
|
|
383
|
-
<Text style={{color: '#094485', fontSize: normalize(10)}}>
|
|
384
|
-
Total Quantity :{' '}
|
|
385
|
-
<Text
|
|
386
|
-
style={{
|
|
387
|
-
fontSize: normalize(10),
|
|
388
|
-
fontWeight: 'bold',
|
|
389
|
-
color: '#555',
|
|
390
|
-
}}>
|
|
391
|
-
{invoice.totalpackingno}
|
|
392
|
-
</Text>
|
|
393
|
-
</Text>
|
|
394
|
-
</View>
|
|
395
|
-
</TouchableOpacity>
|
|
396
|
-
))
|
|
397
|
-
: null}
|
|
398
|
-
</View>
|
|
399
|
-
)}
|
|
400
|
-
</View>
|
|
401
|
-
</SwipeRow>
|
|
402
|
-
);
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
export default SupplierInvoiceCard;
|