tango-app-api-trax 3.7.76 → 3.7.77
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/package.json
CHANGED
|
@@ -13,4 +13,19 @@ Handlebars.registerHelper( 'includes', function( array, value ) {
|
|
|
13
13
|
return array.includes( value );
|
|
14
14
|
} );
|
|
15
15
|
|
|
16
|
+
Handlebars.registerHelper( 'gte', function( a, b, options ) {
|
|
17
|
+
if ( options && options.fn ) {
|
|
18
|
+
return ( a >= b ) ? options.fn( this ) : options.inverse( this );
|
|
19
|
+
}
|
|
20
|
+
return a >= b;
|
|
21
|
+
} );
|
|
22
|
+
|
|
23
|
+
Handlebars.registerHelper( 'mult', function( a, b ) {
|
|
24
|
+
return Math.round( ( a || 0 ) * ( b || 1 ) );
|
|
25
|
+
} );
|
|
26
|
+
|
|
27
|
+
Handlebars.registerHelper( 'add', function( a, b ) {
|
|
28
|
+
return ( a || 0 ) + ( b || 0 );
|
|
29
|
+
} );
|
|
30
|
+
|
|
16
31
|
export default Handlebars;
|
|
@@ -4730,18 +4730,13 @@ export async function downloadChecklist( req, res ) {
|
|
|
4730
4730
|
return res.sendError( 'No data found', 204 );
|
|
4731
4731
|
}
|
|
4732
4732
|
|
|
4733
|
-
let storeDetails = await storeService.findOne( { storeId: checklistDetails.store_id }, { storeProfile: 1 } );
|
|
4734
|
-
if ( !storeDetails ) {
|
|
4735
|
-
return res.sendError( 'No data found', 204 );
|
|
4736
|
-
}
|
|
4737
|
-
|
|
4738
4733
|
let clientDetails = await clientService.findOne( { clientId: checklistDetails.client_id } );
|
|
4739
4734
|
|
|
4740
4735
|
if ( !clientDetails ) {
|
|
4741
4736
|
return res.sendError( 'No client found', 204 );
|
|
4742
4737
|
}
|
|
4743
4738
|
|
|
4744
|
-
checklistDetails = { ...checklistDetails.toObject()
|
|
4739
|
+
checklistDetails = { ...checklistDetails.toObject() };
|
|
4745
4740
|
|
|
4746
4741
|
|
|
4747
4742
|
let scheduleDateTime = dayjs( checklistDetails.submitTime );
|
|
@@ -4760,6 +4755,7 @@ export async function downloadChecklist( req, res ) {
|
|
|
4760
4755
|
}
|
|
4761
4756
|
}
|
|
4762
4757
|
checklistDetails['brandName'] = clientDetails?.clientName;
|
|
4758
|
+
// checklistDetails['submitTime_string'] = dayjs( checklistDetails.submitTime_string, 'hh mm A, DD MMM YYYY' ).format( 'DD MMMM YYYY | hh:mm A' );
|
|
4763
4759
|
checklistDetails.questionAnswers.forEach( ( section ) => {
|
|
4764
4760
|
section.questions.forEach( ( question ) => {
|
|
4765
4761
|
question.remarks = question.remarks == null || question.remarks == 'null' ? '' : question.remarks;
|