@@ -62,7 +62,7 @@ export default Component.extend(FormMixin, {
62626363    if  ( this . taxInfo  !==  null )  { 
6464      return  sumBy ( this . tickets . toArray ( ) , 
65-         ticket  =>  ( ticket . ticketPriceWithTax  ||  0 )  *  ( ticket . orderQuantity  ||  0 ) 
65+         ticket  =>  ( ( ticket . ticketPriceWithTax  ||  0 )   -   ( ticket . discount   ||   0 ) )  *  ( ticket . orderQuantity  ||  0 ) 
6666      ) ; 
6767    } 
6868    return  sumBy ( this . tickets . toArray ( ) , 
@@ -123,9 +123,7 @@ export default Component.extend(FormMixin, {
123123        this . set ( 'invalidPromotionalCode' ,  true ) ; 
124124      } 
125125      try  { 
126-         let  discountCode  =  await  this . store . findRecord ( 'discount-code' ,  this . promotionalCode ,  { 
127-           include : 'tickets' 
128-         } ) ; 
126+         let  discountCode  =  await  this . store . queryRecord ( 'discount-code' ,  {  eventIdentifier : this . event . id ,  code : this . promotionalCode  } ) ; 
129127        let  discountCodeEvent  =  await  discountCode . get ( 'event' ) ; 
130128        if  ( this . currentEventIdentifier  ===  discountCodeEvent . identifier )  { 
131129          let  discountType  =  discountCode . get ( 'type' ) ; 
@@ -151,6 +149,7 @@ export default Component.extend(FormMixin, {
151149          this . set ( 'invalidPromotionalCode' ,  true ) ; 
152150        } 
153151      }  catch  ( e )  { 
152+         console . warn ( e ) ; 
154153        if  ( this . invalidPromotionalCode )  { 
155154          this . set ( 'invalidPromotionalCode' ,  true ) ; 
156155        } 
0 commit comments