@@ -247,8 +247,8 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
247
247
} , [ refresh ] ) ;
248
248
249
249
//function to handle customer id input element changes - change event.
250
- const handleCustomerIDChange = ( event ) : void => {
251
- const enteredID : number = parseInt ( event . value ) ;
250
+ const handleCustomerIDChange = ( event : ChangeEventArgs ) : void => {
251
+ const enteredID : number = parseInt ( event . value as string ) ;
252
252
const foundCustomer : any = customerDatabase . find (
253
253
( customer ) => ( customer as any ) . id === enteredID
254
254
) ;
@@ -336,7 +336,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
336
336
//Function to Calculate total savings of the bill amount
337
337
function computeSavings ( dataSource : any ) : number {
338
338
let savings = 0 ;
339
- dataSource . forEach ( ( item ) => {
339
+ dataSource . forEach ( ( item : any ) => {
340
340
const MRP = item . MRP ;
341
341
const Price = item . Price ;
342
342
const Qty = parseFloat ( item . Quantity ) || 0 ;
@@ -364,7 +364,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
364
364
}
365
365
366
366
//Grid action begin event
367
- const actionBegin = ( args ) : void => {
367
+ const actionBegin = ( args : any ) : void => {
368
368
if ( args . requestType === 'save' ) {
369
369
args . index = ( gridInstance . current . pageSettings . currentPage * gridInstance . current . pageSettings . pageSize ) - 1 ;
370
370
productSearchGridInstance . current . clearSelection ( ) ;
@@ -390,16 +390,16 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
390
390
? true
391
391
: false ;
392
392
function printTable (
393
- gridInstance ,
394
- shopName ,
395
- billNo ,
396
- customerName ,
397
- phoneNumber ,
398
- address ,
399
- formattedDateTime ,
400
- totalAmount ,
401
- savings ,
402
- isDoorDelivery ,
393
+ gridInstance : any ,
394
+ shopName : any ,
395
+ billNo : any ,
396
+ customerName : any ,
397
+ phoneNumber : any ,
398
+ address : any ,
399
+ formattedDateTime : any ,
400
+ totalAmount : any ,
401
+ savings : any ,
402
+ isDoorDelivery : any ,
403
403
) {
404
404
let data = gridInstance . dataSource ;
405
405
let columnConfig = gridInstance . columns ;
@@ -513,9 +513,9 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
513
513
514
514
// Data rows
515
515
printWindow . document . write ( "<tbody>" ) ;
516
- data . forEach ( ( item ) => {
516
+ data . forEach ( ( item : any ) => {
517
517
let row = "<tr>" ;
518
- columnConfig . forEach ( ( column ) => {
518
+ columnConfig . forEach ( ( column : any ) => {
519
519
if (
520
520
column . headerText !== "" &&
521
521
column . headerText !== "Product ID" &&
@@ -662,7 +662,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
662
662
} ;
663
663
664
664
//Grid command column delete button - Click event.
665
- const commandClick = ( arg ) : void => {
665
+ const commandClick = ( args : any ) : void => {
666
666
const rowIndex = parseInt (
667
667
args . target . closest ( "tr" ) . getAttribute ( "data-rowindex" ) ,
668
668
10
@@ -694,7 +694,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
694
694
) ;
695
695
if ( product ) {
696
696
const isProductExists = ( gridInstance . current . dataSource as any ) . some (
697
- ( item ) => ( item as any ) . ProductID === ( product as any ) . ProductID
697
+ ( item : any ) => ( item as any ) . ProductID === ( product as any ) . ProductID
698
698
) ;
699
699
if ( isProductExists ) {
700
700
alert ( "Product has already been added." ) ;
@@ -750,7 +750,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
750
750
751
751
const destroyProductIDFn = ( ) => {
752
752
if ( autocompleteIns && productIDInput ) {
753
- // textBoxIns .destroy();
753
+ autocompleteIns . destroy ( ) ;
754
754
productIDInput . removeEventListener ( "keyup" , handleKeyUp ) ; // Remove event listener
755
755
}
756
756
} ;
@@ -759,7 +759,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
759
759
return args . value ;
760
760
} ;
761
761
762
- const writeProductIDFn = ( args ) => {
762
+ const writeProductIDFn = ( args : any ) => {
763
763
autocompleteIns = new AutoComplete ( {
764
764
dataSource : productData . map ( product => ( { ProductID : ( product as any ) . ProductID , ProductName : ( product as any ) . ProductName } ) ) , // Provide your data source
765
765
fields : { value : 'ProductID' } ,
@@ -818,7 +818,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
818
818
return args . value ;
819
819
} ;
820
820
821
- const writeProductNameFn = ( args ) => {
821
+ const writeProductNameFn = ( args : any ) => {
822
822
productNameTextBoxIns = new TextBox ( {
823
823
value : args . rowData [ args . column . field ] ,
824
824
placeholder : "Enter product name" ,
@@ -888,7 +888,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
888
888
return "" ;
889
889
} ;
890
890
891
- const writeQuantityFn = ( args ) => {
891
+ const writeQuantityFn = ( args : any ) => {
892
892
quantityTextBoxIns = new TextBox ( {
893
893
value : args . rowData [ args . column . field ] ,
894
894
placeholder : "Enter quantity" ,
@@ -1018,10 +1018,11 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1018
1018
( ) => (
1019
1019
< GridComponent
1020
1020
ref = { gridInstance }
1021
- emptyRecordTemplate = { ( ) => null }
1021
+ emptyRecordTemplate = { ( ) : any => null }
1022
1022
gridLines = "Both"
1023
- height = "435px "
1023
+ height = "250px "
1024
1024
width = '100%'
1025
+ rowHeight = { 15 }
1025
1026
textWrapSettings = { wrapSettings }
1026
1027
dataSource = { [ ] }
1027
1028
actionComplete = { actionComplete }
@@ -1139,27 +1140,24 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1139
1140
1140
1141
return (
1141
1142
< div >
1142
- < div className = "input-container-title" >
1143
- ABC Supermarket Point of Sale (POS)
1144
- </ div >
1145
-
1143
+ < div className = "input-container-title" > ABC SUPERMARKET POINT OF SALE (POS)</ div >
1146
1144
{ /* Customer details Header element */ }
1147
- < div className = "header" style = { { marginTop : "30px" } } >
1148
- < div className = "input-container billno" >
1149
- < label > Bill No:</ label >
1145
+ < div className = "header" style = { { marginTop : "15px" , height : '20%' } } >
1146
+ < table className = "header-table" style = { { marginLeft : '40px' } } >
1147
+ < tr className = "input-container billno" > < td >
1148
+ < label > Bill Number:</ label > </ td > < td >
1150
1149
< TextBoxComponent
1151
1150
id = "billNoInput"
1152
1151
type = "text"
1153
1152
readOnly
1154
1153
/>
1155
- </ div >
1156
- < div className = "input-container custid" >
1157
- < label > Customer ID:</ label >
1154
+ </ td > </ tr >
1155
+ < tr className = "input-container custid" > < td >
1156
+ < label > Customer ID:</ label > </ td > < td >
1158
1157
< AutoCompleteComponent
1159
1158
id = "customerID"
1160
- placeholder = "Enter id"
1159
+ placeholder = "Enter customer id"
1161
1160
dataSource = { customerDatabase . map ( customer => ( customer as any ) . id ) }
1162
- width = { 150 }
1163
1161
ref = { customerIDRef }
1164
1162
/>
1165
1163
< ButtonComponent
@@ -1170,51 +1168,52 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1170
1168
>
1171
1169
+
1172
1170
</ ButtonComponent >
1173
- </ div >
1174
- < div className = "input-container custname" >
1175
- < label > Customer Name:</ label >
1171
+ </ td > </ tr > </ table >
1172
+ < table className = "header-table" >
1173
+ < tr className = "input-container custname" > < td >
1174
+ < label > Customer Name:</ label > </ td > < td >
1176
1175
< TextBoxComponent
1177
1176
type = "text"
1178
1177
id = "customerName"
1179
1178
ref = { customerNameRef }
1180
- placeholder = "Customer name "
1179
+ placeholder = "Customer Name "
1181
1180
readOnly
1182
1181
/>
1183
- </ div >
1184
- < div className = "input-container phone" >
1185
- < label > Phone No :</ label >
1182
+ </ td > </ tr >
1183
+ < tr className = "input-container phone" > < td >
1184
+ < label > Phone Number :</ label > </ td > < td >
1186
1185
< MaskedTextBoxComponent
1187
1186
id = "phone-input"
1188
1187
ref = { customerPhoneRef }
1189
1188
mask = "(999) 999-9999"
1190
1189
placeholder = "(999) 999-9999"
1191
1190
readOnly
1192
1191
/>
1193
- </ div >
1194
- < div className = "input-container custaddress" >
1195
- < label > Address:</ label >
1192
+ </ td > </ tr > </ table >
1193
+ < table className = "header-table" >
1194
+ < tr className = "input-container custaddress" > < td >
1195
+ < label > Customer Address:</ label > </ td > < td >
1196
1196
< TextAreaComponent
1197
1197
id = "customerAddress"
1198
1198
value = { "" }
1199
1199
ref = { customerAddressRef }
1200
- placeholder = "Customer address "
1200
+ placeholder = "Customer Address "
1201
1201
readOnly
1202
1202
/>
1203
- </ div >
1204
- < div className = "input-container datepicker" >
1205
- < label > Date:</ label >
1203
+ </ td > </ tr >
1204
+ < tr className = "input-container datepicker" > < td >
1205
+ < label > Date:</ label > </ td > < td >
1206
1206
< DateTimePickerComponent
1207
1207
id = "date-picker"
1208
1208
ref = { datePicker }
1209
1209
value = { currentDateTime }
1210
- width = { 300 }
1211
1210
format = "MM/dd/yyyy hh:mm:ss a"
1212
1211
readOnly
1213
1212
/>
1214
- </ div >
1213
+ </ td > </ tr > </ table >
1215
1214
</ div >
1216
1215
{ /* Main Content of the Body - Primary Grid and Vertical Amount details Card components */ }
1217
- < div className = "primary-container" style = { { marginTop : "30px" } } >
1216
+ < div className = "primary-container" style = { { marginTop : "15px" , height : '50%' } } >
1218
1217
{ MemorizedGridComponent }
1219
1218
1220
1219
{ /* Product search by its name - Dialog popup */ }
@@ -1269,7 +1268,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1269
1268
< div className = "control-section card-control-section vertical_card_layout" >
1270
1269
< div className = "e-card-resize-container" >
1271
1270
< div className = "row" >
1272
- < div className = "row card-layout" style = { { height : '485px ' } } >
1271
+ < div className = "row card-layout" style = { { height : '330px ' } } >
1273
1272
< div className = "col-xs-6 col-sm-6 col-sm-4 " >
1274
1273
< div className = "e-card" id = "poscards" >
1275
1274
< div className = "e-card-header" >
@@ -1324,7 +1323,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1324
1323
</ div >
1325
1324
1326
1325
{ /* Horizontal Card components - Delivery type, Payment type Buttons*/ }
1327
- < div className = "control-pane payment" style = { { marginTop : "37px" } } >
1326
+ < div className = "control-pane payment" style = { { marginTop : "15px" , height : '20%' } } >
1328
1327
< div className = "control-section card-control-section vertical_card_layout" >
1329
1328
< div className = "e-card-resize-container" >
1330
1329
< div className = "row" >
@@ -1333,15 +1332,15 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1333
1332
< div className = "col-xs-3 col-sm-3 " >
1334
1333
< div className = "e-card" id = "poscards" >
1335
1334
< div className = "e-card-actions" >
1336
- < div className = "e-card-btn-txt" id = "deliverOptionDiv" >
1335
+ < div className = "e-card-btn-txt" id = "deliverOptionDiv" style = { { background : 'linear-gradient(to right, rgb(251, 146, 60), rgb(224 212 55) 50%, rgb(251, 146, 60))' } } >
1337
1336
< ButtonComponent
1338
1337
ref = { buttonRef }
1339
1338
onClick = { onClickToggle }
1340
1339
isToggle = { true }
1341
1340
title = "Toggle Delivery type"
1342
1341
>
1343
- < span > Delivery type :</ span >
1344
- < span ref = { deliverytypeRef } style = { { color : deliveryType === "Take Away" ? "rgb(50,234, 50 )" : "red" } } >
1342
+ < span > Delivery Type :</ span >
1343
+ < span ref = { deliverytypeRef } style = { { color : deliveryType === "Take Away" ? "rgb(8 168 67 )" : "red" } } >
1345
1344
{ deliveryType }
1346
1345
</ span >
1347
1346
</ ButtonComponent >
@@ -1353,7 +1352,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1353
1352
< div className = "col-xs-3 col-sm-3 " >
1354
1353
< div className = "e-card" id = "poscards" >
1355
1354
< div className = "e-card-actions" >
1356
- < div className = "e-card-btn-txt" id = "cardPayButtonDiv" >
1355
+ < div className = "e-card-btn-txt" id = "cardPayButtonDiv" style = { { background : 'linear-gradient(to right, rgb(16, 18, 240), rgb(141 149 232) 50%, rgb(16, 18, 240))' } } >
1357
1356
< ButtonComponent
1358
1357
id = "cardPayButton"
1359
1358
title = "Click to enter card payment"
@@ -1374,7 +1373,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1374
1373
< div className = "col-xs-3 col-sm-3 " >
1375
1374
< div className = "e-card" id = "poscards" >
1376
1375
< div className = "e-card-actions" >
1377
- < div className = "e-card-btn-txt" id = "UPIPayButtondiv" >
1376
+ < div className = "e-card-btn-txt" id = "UPIPayButtondiv" style = { { background : 'linear-gradient(to right, #15803d, #55e189 50%, #15803d)' } } >
1378
1377
< ButtonComponent
1379
1378
id = "UPIPayButton"
1380
1379
title = "Click to enter UPI payment"
@@ -1395,7 +1394,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1395
1394
< div className = "col-xs-3 col-sm-3 " >
1396
1395
< div className = "e-card" id = "poscards" >
1397
1396
< div className = "e-card-actions" >
1398
- < div className = "e-card-btn-txt" id = "totalNetAmount" >
1397
+ < div className = "e-card-btn-txt" id = "totalNetAmount" style = { { background : 'linear-gradient(to right, rgb(251 60 60), rgb(239 179 87) 50%, rgb(251 60 60))' } } >
1399
1398
< ButtonComponent
1400
1399
id = "cashPayButton"
1401
1400
title = "Click to enter cash payment"
@@ -1441,15 +1440,15 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1441
1440
>
1442
1441
< form >
1443
1442
< div className = "input-container" style = { { marginBottom : "5px" } } >
1444
- < label htmlFor = "customerName" style = { { marginBottom : "10px" , fontWeight : "bold" } } > Customer Name: </ label >
1443
+ < label htmlFor = "customerName" > Customer Name</ label >
1445
1444
< TextBoxComponent
1446
1445
id = "customerName"
1447
1446
ref = { newCustomerNameRef }
1448
1447
placeholder = "Enter customer name"
1449
1448
/>
1450
1449
</ div >
1451
1450
< div className = "input-container" style = { { marginBottom : "5px" } } >
1452
- < label htmlFor = "phone-input" style = { { marginBottom : "10px" , fontWeight : "bold" } } > Phone No: </ label >
1451
+ < label htmlFor = "phone-input" > Phone No</ label >
1453
1452
< MaskedTextBoxComponent
1454
1453
id = "phone-input"
1455
1454
ref = { newCustomerPhoneRef }
@@ -1458,7 +1457,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
1458
1457
/>
1459
1458
</ div >
1460
1459
< div className = "input-container" style = { { marginBottom : "5px" } } >
1461
- < label htmlFor = "customerAddress" style = { { marginBottom : "10px" , fontWeight : "bold" } } > Address: </ label >
1460
+ < label htmlFor = "customerAddress" > Address</ label >
1462
1461
< TextAreaComponent
1463
1462
id = "customerAddress"
1464
1463
width = '100%'
0 commit comments