@@ -41,7 +41,6 @@ export class ProductOrdersComponent implements OnInit, OnDestroy {
4141 showOrderDetails :boolean = false ;
4242 orderToShow :any ;
4343 dateRange = new FormControl ( ) ;
44- selectedDate :any ;
4544 countries : any [ ] = countries ;
4645 preferred :boolean = false ;
4746 loading_more : boolean = false ;
@@ -90,10 +89,6 @@ export class ProductOrdersComponent implements OnInit, OnDestroy {
9089
9190 ngOnInit ( ) {
9291 this . loading = true ;
93- let today = new Date ( ) ;
94- today . setMonth ( today . getMonth ( ) - 1 ) ;
95- this . selectedDate = today . toISOString ( ) ;
96- this . dateRange . setValue ( 'month' ) ;
9792
9893 let order_button = document . getElementById ( 'order-button' )
9994 let invoices_button = document . getElementById ( 'bill-button' )
@@ -159,7 +154,6 @@ export class ProductOrdersComponent implements OnInit, OnDestroy {
159154 let options = {
160155 "filters" : this . filters ,
161156 "partyId" : this . partyId ,
162- "selectedDate" : this . selectedDate ,
163157 "orders" : this . orders ,
164158 "role" : this . role
165159 }
@@ -205,29 +199,6 @@ export class ProductOrdersComponent implements OnInit, OnDestroy {
205199 }
206200 }
207201
208- filterOrdersByDate ( ) {
209- if ( this . dateRange . value == 'month' ) {
210- let today = new Date ( ) ;
211- today . setDate ( 1 ) ;
212- today . setMonth ( today . getMonth ( ) - 1 ) ;
213- this . selectedDate = today . toISOString ( ) ;
214- } else if ( this . dateRange . value == 'months' ) {
215- let today = new Date ( ) ;
216- today . setDate ( 1 ) ;
217- today . setMonth ( today . getMonth ( ) - 3 ) ;
218- this . selectedDate = today . toISOString ( ) ;
219- } else if ( this . dateRange . value == 'year' ) {
220- let today = new Date ( ) ;
221- today . setDate ( 1 ) ;
222- today . setMonth ( 0 ) ;
223- today . setFullYear ( today . getFullYear ( ) - 1 ) ;
224- this . selectedDate = today . toISOString ( ) ;
225- } else {
226- this . selectedDate = undefined
227- }
228- this . getOrders ( false ) ;
229- }
230-
231202 getTotalPrice ( items :any [ ] ) {
232203 let totalPrice = [ ] ;
233204 let insertCheck = false ;
0 commit comments