diff --git a/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.ts b/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.ts index 499298b..b72a693 100644 --- a/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.ts +++ b/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.ts @@ -153,8 +153,21 @@ export class BeneficiaryDrugIssueReportComponent implements OnInit, DoCheck { getResponseOfSearchThenDo() { const criteria: any = []; - criteria.push({ Filter_Name: 'Start_Date', value: this.startDate }); - criteria.push({ Filter_Name: 'End_Date', value: this.endDate }); + const formatLocalDate = (d: any) => { + const dt = new Date(d); + const dd = String(dt.getDate()).padStart(2, '0'); + const mm = String(dt.getMonth() + 1).padStart(2, '0'); + const yyyy = dt.getFullYear(); + return `${dd}-${mm}-${yyyy}`; + }; + criteria.push({ + Filter_Name: 'Start_Date', + value: formatLocalDate(this.startDate), + }); + criteria.push({ + Filter_Name: 'End_Date', + value: formatLocalDate(this.endDate), + }); this.exportToxlsx(criteria); } exportToxlsx(criteria: any) { diff --git a/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.ts b/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.ts index 8744184..060e2d3 100644 --- a/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.ts +++ b/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.ts @@ -166,8 +166,21 @@ export class ConsumptionReportComponent implements OnInit, DoCheck { getResponseOfSearchThenDo() { const criteria: any = []; - criteria.push({ Filter_Name: 'Start_Date', value: this.startDate }); - criteria.push({ Filter_Name: 'End_Date', value: this.endDate }); + const formatLocalDate = (d: any) => { + const dt = new Date(d); + const dd = String(dt.getDate()).padStart(2, '0'); + const mm = String(dt.getMonth() + 1).padStart(2, '0'); + const yyyy = dt.getFullYear(); + return `${dd}-${mm}-${yyyy}`; + }; + criteria.push({ + Filter_Name: 'Start_Date', + value: formatLocalDate(this.startDate), + }); + criteria.push({ + Filter_Name: 'End_Date', + value: formatLocalDate(this.endDate), + }); this.exportToxlsx(criteria); } exportToxlsx(criteria: any) { diff --git a/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.ts b/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.ts index 1da4760..7909587 100644 --- a/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.ts +++ b/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.ts @@ -165,8 +165,21 @@ export class DailyStockDetailsReportComponent implements OnInit, DoCheck { getResponseOfSearchThenDo() { const criteria: any = []; - criteria.push({ Filter_Name: 'Start_Date', value: this.startDate }); - criteria.push({ Filter_Name: 'End_Date', value: this.endDate }); + const formatLocalDate = (d: any) => { + const dt = new Date(d); + const dd = String(dt.getDate()).padStart(2, '0'); + const mm = String(dt.getMonth() + 1).padStart(2, '0'); + const yyyy = dt.getFullYear(); + return `${dd}-${mm}-${yyyy}`; + }; + criteria.push({ + Filter_Name: 'Start_Date', + value: formatLocalDate(this.startDate), + }); + criteria.push({ + Filter_Name: 'End_Date', + value: formatLocalDate(this.endDate), + }); this.exportToxlsx(criteria); } exportToxlsx(criteria: any) { diff --git a/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.ts b/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.ts index ba55130..b3e91da 100644 --- a/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.ts +++ b/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.ts @@ -165,8 +165,21 @@ export class DailyStockSummaryReportComponent implements OnInit, DoCheck { getResponseOfSearchThenDo() { const criteria: any = []; - criteria.push({ Filter_Name: 'Start_Date', value: this.startDate }); - criteria.push({ Filter_Name: 'End_Date', value: this.endDate }); + const formatLocalDate = (d: any) => { + const dt = new Date(d); + const dd = String(dt.getDate()).padStart(2, '0'); + const mm = String(dt.getMonth() + 1).padStart(2, '0'); + const yyyy = dt.getFullYear(); + return `${dd}-${mm}-${yyyy}`; + }; + criteria.push({ + Filter_Name: 'Start_Date', + value: formatLocalDate(this.startDate), + }); + criteria.push({ + Filter_Name: 'End_Date', + value: formatLocalDate(this.endDate), + }); this.exportToxlsx(criteria); } exportToxlsx(criteria: any) { diff --git a/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.ts b/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.ts index 03dda08..7b6cdbe 100644 --- a/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.ts +++ b/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.ts @@ -142,8 +142,21 @@ export class ExpiryReportComponent implements OnInit, DoCheck { getResponseOfSearchThenDo() { const criteria: any = []; - criteria.push({ Filter_Name: 'Start_Date', value: this.startDate }); - criteria.push({ Filter_Name: 'End_Date', value: this.endDate }); + const formatLocalDate = (d: any) => { + const dt = new Date(d); + const dd = String(dt.getDate()).padStart(2, '0'); + const mm = String(dt.getMonth() + 1).padStart(2, '0'); + const yyyy = dt.getFullYear(); + return `${dd}-${mm}-${yyyy}`; + }; + criteria.push({ + Filter_Name: 'Start_Date', + value: formatLocalDate(this.startDate), + }); + criteria.push({ + Filter_Name: 'End_Date', + value: formatLocalDate(this.endDate), + }); this.exportToxlsx(criteria); } exportToxlsx(criteria: any) { diff --git a/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.ts b/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.ts index de44dca..5f11054 100644 --- a/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.ts +++ b/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.ts @@ -168,8 +168,21 @@ export class InwardStockReportComponent implements OnInit, DoCheck { getResponseOfSearchThenDo() { const criteria: any = []; - criteria.push({ Filter_Name: 'Start_Date', value: this.startDate }); - criteria.push({ Filter_Name: 'End_Date', value: this.endDate }); + const formatLocalDate = (d: any) => { + const dt = new Date(d); + const dd = String(dt.getDate()).padStart(2, '0'); + const mm = String(dt.getMonth() + 1).padStart(2, '0'); + const yyyy = dt.getFullYear(); + return `${dd}-${mm}-${yyyy}`; + }; + criteria.push({ + Filter_Name: 'Start_Date', + value: formatLocalDate(this.startDate), + }); + criteria.push({ + Filter_Name: 'End_Date', + value: formatLocalDate(this.endDate), + }); this.exportToxlsx(criteria); } exportToxlsx(criteria: any) { diff --git a/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.ts b/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.ts index d36eab4..79a118b 100644 --- a/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.ts +++ b/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.ts @@ -118,7 +118,17 @@ export class ShortExpiryReportComponent implements OnInit, DoCheck { getResponseOfSearchThenDo() { const criteria: any = []; - criteria.push({ Filter_Name: 'Start_Date', value: this.startDate }); + const formatLocalDate = (d: any) => { + const dt = new Date(d); + const dd = String(dt.getDate()).padStart(2, '0'); + const mm = String(dt.getMonth() + 1).padStart(2, '0'); + const yyyy = dt.getFullYear(); + return `${dd}-${mm}-${yyyy}`; + }; + criteria.push({ + Filter_Name: 'Start_Date', + value: formatLocalDate(this.startDate), + }); this.exportToxlsx(criteria); } exportToxlsx(criteria: any) { diff --git a/src/app/app-modules/inventory/reports/transit-report/transit-report.component.ts b/src/app/app-modules/inventory/reports/transit-report/transit-report.component.ts index c18e289..3dca64e 100644 --- a/src/app/app-modules/inventory/reports/transit-report/transit-report.component.ts +++ b/src/app/app-modules/inventory/reports/transit-report/transit-report.component.ts @@ -143,8 +143,21 @@ export class TransitReportComponent implements OnInit, DoCheck { getResponseOfSearchThenDo() { const criteria: any = []; - criteria.push({ Filter_Name: 'Start_Date', value: this.startDate }); - criteria.push({ Filter_Name: 'End_Date', value: this.endDate }); + const formatLocalDate = (d: any) => { + const dt = new Date(d); + const dd = String(dt.getDate()).padStart(2, '0'); + const mm = String(dt.getMonth() + 1).padStart(2, '0'); + const yyyy = dt.getFullYear(); + return `${dd}-${mm}-${yyyy}`; + }; + criteria.push({ + Filter_Name: 'Start_Date', + value: formatLocalDate(this.startDate), + }); + criteria.push({ + Filter_Name: 'End_Date', + value: formatLocalDate(this.endDate), + }); this.exportToxlsx(criteria); } exportToxlsx(criteria: any) {