@@ -109,6 +109,7 @@ class base {
109109 let totalSpent = 0 ;
110110 let spent = 0 ;
111111 let spentFree = 0 ;
112+ let spentHalfPrice = 0 ;
112113 let users = { } ;
113114 let projects = { } ;
114115 let times = [ ] ;
@@ -120,6 +121,10 @@ class base {
120121 if ( undefined === spentFreeLabels ) {
121122 spentFreeLabels = [ ] ;
122123 }
124+ let spentHalfPriceLabels = this . config . get ( 'halfPriceLabels' ) ;
125+ if ( undefined === spentHalfPriceLabels ) {
126+ spentHalfPriceLabels = [ ] ;
127+ }
123128
124129 [ 'issues' , 'mergeRequests' ] . forEach ( type => {
125130 this . report [ type ] . forEach ( issue => {
@@ -146,14 +151,24 @@ class base {
146151 spent += time . seconds ;
147152 //if(time.parent.labels)
148153 let free = false ;
154+ let halfPrice = false ;
149155 time . parent . labels . forEach ( label => {
150156 spentFreeLabels . forEach ( freeLabel => {
151157 free |= ( freeLabel == label ) ;
152158 } ) ;
153159 } ) ;
160+ time . parent . labels . forEach ( label => {
161+ spentHalfPriceLabels . forEach ( halfPriceLabel => {
162+ halfPrice |= ( halfPriceLabel == label ) ;
163+ } ) ;
164+ } ) ;
165+
154166 if ( free ) {
155167 spentFree += time . seconds ;
156168 }
169+ if ( halfPrice ) {
170+ spentHalfPrice += time . seconds ;
171+ }
157172 times . push ( time ) ;
158173 } ) ;
159174 issue . timesWarnings . forEach ( warning => timesWarnings . push ( warning ) ) ;
@@ -190,6 +205,7 @@ class base {
190205 this . totalEstimate = totalEstimate ;
191206 this . spent = spent ;
192207 this . spentFree = spentFree ;
208+ this . spentHalfPrice = spentHalfPrice ;
193209 this . totalSpent = totalSpent ;
194210 this . timesWarnings = timesWarnings ;
195211 }
0 commit comments