mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-30 21:21:09 -04:00 
			
		
		
		
	fix date range issue in reports
This commit is contained in:
		| @ -162,6 +162,14 @@ export default { | ||||
|         return this.$t('validation.required') | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     dateRangeUrl () { | ||||
|       return `${this.siteURL}?from_date=${moment( | ||||
|         this.formData.from_date | ||||
|       ).format('YYYY-MM-DD')}&to_date=${moment(this.formData.to_date).format( | ||||
|         'YYYY-MM-DD' | ||||
|       )}` | ||||
|     } | ||||
|   }, | ||||
|  | ||||
|   watch: { | ||||
| @ -173,17 +181,14 @@ export default { | ||||
|  | ||||
|   mounted() { | ||||
|     this.siteURL = `/reports/profit-loss/${this.getSelectedCompany.unique_hash}` | ||||
|     this.url = `${this.siteURL}?from_date=${moment( | ||||
|       this.formData.from_date | ||||
|     ).format('YYYY-MM-DD')}&to_date=${moment(this.formData.to_date).format( | ||||
|       'YYYY-MM-DD' | ||||
|     )}` | ||||
|     this.url = this.dateRangeUrl | ||||
|   }, | ||||
|  | ||||
|   methods: { | ||||
|     getThisDate(type, time) { | ||||
|       return moment()[type](time).toString() | ||||
|     }, | ||||
|  | ||||
|     getPreDate(type, time) { | ||||
|       return moment().subtract(1, time)[type](time).toString() | ||||
|     }, | ||||
| @ -257,7 +262,7 @@ export default { | ||||
|         return true | ||||
|       } | ||||
|  | ||||
|       this.url = `${this.siteURL}?from_date=${this.formData.from_date}&to_date=${this.formData.to_date}` | ||||
|       this.url = this.dateRangeUrl | ||||
|       return true | ||||
|     }, | ||||
|  | ||||
| @ -268,7 +273,7 @@ export default { | ||||
|  | ||||
|       window.open(this.getReportUrl + '&download=true') | ||||
|       setTimeout(() => { | ||||
|         this.url = `${this.siteURL}?from_date=${this.formData.from_date}&to_date=${this.formData.to_date}` | ||||
|         this.url = this.dateRangeUrl | ||||
|       }, 200) | ||||
|     }, | ||||
|   }, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user