File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -511,12 +511,13 @@ <h3>Persons:</h3>
511511 const totalDiff = ( itemsPrice - personsPrice ) . formatPrice ( ) ;
512512 const text = data . persons . flatMap ( person => [
513513 `${ person . name } : ${ calculatePersonTotal ( person ) . formatPrice ( ) } ${ person . paid ? ' (paid)' : '' } ` ,
514- ...( ! detailed ? [ ] :
515- // keep order from data.items array
516- data . items . map ( item => [ item , getAmount ( person , item ) ] )
517- . filter ( e => e [ 1 ] != 0 )
518- . map ( ( [ item , amount ] ) => ` - ${ item . name } ${ amount == 1 ? '' : ` (${ amount } )` } : ${ ( item . price * amount ) . formatPrice ( ) } ` )
519- )
514+ ...( ! detailed ? [ ] : [
515+ // keep order from data.items array
516+ ...data . items . map ( item => [ item , getAmount ( person , item ) ] )
517+ . filter ( e => e [ 1 ] != 0 )
518+ . map ( ( [ item , amount ] ) => ` - ${ item . name } ${ amount == 1 ? '' : ` (${ amount . formatPrice ( ) } )` } : ${ ( item . price * amount ) . formatPrice ( ) } ` ) ,
519+ "" ,
520+ ] )
520521 ] ) . join ( "\n" ) + (
521522 totalDiff > 0 ? `\nUnknown: ${ totalDiff } ` :
522523 totalDiff < 0 ? `\nExtra: ${ - totalDiff } ` :
You can’t perform that action at this time.
0 commit comments