Commit babc3a67 authored by Koolapong Kongpitak's avatar Koolapong Kongpitak
Browse files

Fixed UAT

Showing with 42 additions and 36 deletions
+42 -36
......@@ -125,6 +125,6 @@
<mat-progress-bar mode="indeterminate" *ngIf="showProgressBar"></mat-progress-bar>
<div class="norecfound" *ngIf="showNoRecord">No record found</div>
<mat-paginator [hidden]="!showPagination" [pageSizeOptions]="[10, 20, 50, 100]" showFirstLastButtons>
<mat-paginator [hidden]="!showPagination" [pageSizeOptions]="[minpage, 20, 50, 100]" showFirstLastButtons>
</mat-paginator>
</div>
\ No newline at end of file
......@@ -71,6 +71,7 @@ export class AutoTableHighlightComponent implements OnChanges {
@Input("stickyCol") stickyCol: string | Array<string>;
@Input("stickyEndCol") stickyEndCol: string | Array<string>;
@Input("hideColumns") hideColumns: Array<string> = [];
@Input("minpage") minpage: number = 10;
@ContentChildren(TemplateRef) templateRef;
@ViewChild("table") table: any;
......
......@@ -126,6 +126,6 @@
<mat-progress-bar mode="indeterminate" *ngIf="showProgressBar"></mat-progress-bar>
<div class="norecfound" *ngIf="showNoRecord">No record found</div>
<mat-paginator [hidden]="!showPagination" [pageSizeOptions]="[10, 20, 50, 100]" showFirstLastButtons>
<mat-paginator [hidden]="!showPagination" [pageSizeOptions]="[minpage, 20, 50, 100]" showFirstLastButtons>
</mat-paginator>
</div>
\ No newline at end of file
......@@ -66,6 +66,7 @@ export class AutoTableComponent implements OnChanges {
@Input("stickyCol") stickyCol: string | Array<string>;
@Input("stickyEndCol") stickyEndCol: string | Array<string>;
@Input("hideColumns") hideColumns: Array<string> = [];
@Input("minpage") minpage: number = 10;
@Output("editClick") editClick = new EventEmitter<any>();
@ContentChildren(TemplateRef) templateRef;
......@@ -109,12 +110,12 @@ export class AutoTableComponent implements OnChanges {
this.dataList.paginator = this.paginator;
}
this.dataList.sort = this.sort;
if (this.tableFooter && this.tableFooter.length > 0) {
setTimeout(() => {
this.setFooterItems(this.tableFooter)
}, 100);
}
this.dataList.filterPredicate = (data, filterObject: string): boolean => {
......@@ -162,30 +163,30 @@ export class AutoTableComponent implements OnChanges {
}
setFooterItems(footers: Array<any>) {
this.displayFooter = [];
this.displayFooter = this.headerList.map(h => {
let fieldName = h.FIELD_NAME;
let value, colspan;
let footer = footers.find(f => f.fieldName === fieldName);
if (footer && footer.show) {
if (!footer.value && h.DATA_TYPE === 'number') {
let sumValue = this.tableData.reduce((v, o) => parseFloat(o[fieldName]) === o[fieldName] ? v + parseFloat(o[fieldName]):v, 0);
value = sumValue || 0;
} else if (footer.value) {
value = footer.value;
} else {
value = null;
}
colspan = footer.colspan;
this.displayFooter = this.headerList.map(h => {
let fieldName = h.FIELD_NAME;
let value, colspan;
let footer = footers.find(f => f.fieldName === fieldName);
if (footer && footer.show) {
if (!footer.value && h.DATA_TYPE === 'number') {
let sumValue = this.tableData.reduce((v, o) => parseFloat(o[fieldName]) === o[fieldName] ? v + parseFloat(o[fieldName]) : v, 0);
value = sumValue || 0;
} else if (footer.value) {
value = footer.value;
} else {
value = null;
}
return { FIELD_NAME: fieldName, VALUE: value, COLSPAN: colspan || 1 };
})
colspan = footer.colspan;
}
return { FIELD_NAME: fieldName, VALUE: value, COLSPAN: colspan || 1 };
})
}
getFooterValue(fieldName) {
......@@ -269,6 +270,6 @@ export class AutoTableComponent implements OnChanges {
ArrangeShowColumn(data) {
this.displayedColumns = data.filter(v => this.hideColumns.indexOf(v.FIELD_NAME) < 0)
.map(v => v.FIELD_NAME);
.map(v => v.FIELD_NAME);
}
}
......@@ -249,7 +249,8 @@ export class SNSE069_MComponent implements OnInit {
P_COMPANY_CODE : this.global.GetTokenDetail("ssComCode"),
P_SEQ_NO_FROM : this.SData.SEQ_NO_FROM,
P_SEQ_NO_TO : this.SData.SEQ_NO_TO,
P_LOCATION_NO : location
P_LOCATION_NO : location,
P_FORM_ID: 'SNSE069_M'
}
this.http.getParams("AC", ["SNSE069_M_GenerateReport","PMS_RPT_ACC_SNSR022_M","PMS_RPT_ACC_SNSR023_M",fileName1,fileName2], reportParams)
......@@ -293,7 +294,8 @@ export class SNSE069_MComponent implements OnInit {
P_COMPANY_CODE : this.global.GetTokenDetail("ssComCode"),
P_SEQ_NO_FROM : this.SData.SEQ_NO_FROM,
P_SEQ_NO_TO : this.SData.SEQ_NO_TO,
P_LOCATION_NO : location
P_LOCATION_NO : location,
P_FORM_ID: 'SNSE069_M'
}
this.http.getParams("AC", ["SNSE069_M_GenerateReport","PMS_RPT_ACC_SNSR022_M","PMS_RPT_ACC_SNSR023_M",fileName1,fileName2], reportParams)
......
......@@ -73,7 +73,8 @@ export class SNSJ006_MComponent implements OnInit {
P_COMPANY_CODE : this.global.GetTokenDetail("ssComCode"),
P_SEQ_NO_FROM : item["SEQ_FROM"],
P_SEQ_NO_TO : item["SEQ_TO"],
P_LOCATION_NO : location
P_LOCATION_NO : location,
P_FORM_ID: 'SNSJ006_M'
}
let fileName1 = "SNSR022" + "_" + location + '_' + this.FormatDate() + "." + "PDF";
......
......@@ -51,7 +51,8 @@ export class SNSJ006_M2Component implements OnInit {
P_COMPANY_CODE: this.global.GetTokenDetail("ssComCode"),
P_SEQ_NO_FROM: item["SEQ_FROM"],
P_SEQ_NO_TO: item["SEQ_TO"],
P_LOCATION_NO: location
P_LOCATION_NO: location,
P_FORM_ID: 'SNSJ006_M2'
}
let fileName1 = "SNSR022" + "_" + location + '_' + this.FormatDate() + "." + "PDF";
let fileName2 = "SNSR023" + "_" + location + '_' + this.FormatDate() + "." + "PDF"
......
......@@ -30,10 +30,10 @@ export class SNSQ005_001Component implements OnInit {
@ViewChild("ShowDetail", { static: false }) dialogDetail;
public PageTitle: string;
public info: any = [];
public partData: any = [];
public ExiseTax: any = [];
public stockData: any = [];
public info: any = {};
public partData: any = {};
public ExiseTax: any = {};
public stockData: any = {};
public dataList: any = [];
public dataDetail: any = {};
......@@ -112,7 +112,7 @@ export class SNSQ005_001Component implements OnInit {
this.http.get("IC", "SNSQ005_GetPartInfo_G2", this.partData.PART_NO)
.subscribe(result => {
this.ExiseTax = result.Table[0];
this.ExiseTax = result.Table[0] || {};
})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment