Fairoj : isuue fixes and signature changes
This commit is contained in:
parent
79c71aa4ae
commit
e15fed7636
@ -27,7 +27,7 @@ export class ContributeComponent implements OnInit {
|
|||||||
school: any = [];
|
school: any = [];
|
||||||
category: any = [];
|
category: any = [];
|
||||||
Total: any = [];
|
Total: any = [];
|
||||||
grandTotal: any = [];
|
grandTotal: number ;
|
||||||
finalData: any = [];
|
finalData: any = [];
|
||||||
schRquId:any ;
|
schRquId:any ;
|
||||||
sponsor_qty:any=[]
|
sponsor_qty:any=[]
|
||||||
@ -141,7 +141,11 @@ export class ContributeComponent implements OnInit {
|
|||||||
|
|
||||||
getSchoolReqList()
|
getSchoolReqList()
|
||||||
{
|
{
|
||||||
|
this.finalData=[]
|
||||||
|
this.whole_contribute_list=[]
|
||||||
|
this.Total=[]
|
||||||
|
this.grandTotal=0
|
||||||
|
this.sponsor_qty=[]
|
||||||
let url = `${environment.apiUrl}${'getSchoolReqList'}`;
|
let url = `${environment.apiUrl}${'getSchoolReqList'}`;
|
||||||
let data = this.Contribute.value;
|
let data = this.Contribute.value;
|
||||||
|
|
||||||
@ -197,7 +201,14 @@ export class ContributeComponent implements OnInit {
|
|||||||
let bal_qty=curr_data.qty-curr_data.received_qty
|
let bal_qty=curr_data.qty-curr_data.received_qty
|
||||||
if(e > bal_qty){
|
if(e > bal_qty){
|
||||||
alert("Given value is greater than Balance Qty")
|
alert("Given value is greater than Balance Qty")
|
||||||
|
|
||||||
if(this.finalData.length > 0){
|
if(this.finalData.length > 0){
|
||||||
|
let curr_final_data=this.finalData.filter(val=>val.req_id==curr_data.school_req_id)
|
||||||
|
if(curr_final_data.length >0){
|
||||||
|
if(curr_final_data.amount != ''){
|
||||||
|
this.grandTotal-=parseInt(curr_final_data[0].amount)
|
||||||
|
}
|
||||||
|
}
|
||||||
this.finalData=this.finalData.filter(val=>{
|
this.finalData=this.finalData.filter(val=>{
|
||||||
return val.req_id!=curr_data.school_req_id
|
return val.req_id!=curr_data.school_req_id
|
||||||
})
|
})
|
||||||
@ -205,13 +216,19 @@ export class ContributeComponent implements OnInit {
|
|||||||
// console.log(this.finalData);
|
// console.log(this.finalData);
|
||||||
}
|
}
|
||||||
this.sponsor_qty[i]=''
|
this.sponsor_qty[i]=''
|
||||||
this.Total[i]=''
|
this.Total[i]=0
|
||||||
// console.log(this.finalData)
|
// console.log(this.finalData)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
else if(e <= 0){
|
else if(e <= 0){
|
||||||
alert("Given value is Invalid")
|
alert("Given value is Invalid")
|
||||||
if(this.finalData.length > 0){
|
if(this.finalData.length > 0){
|
||||||
|
let curr_final_data=this.finalData.filter(val=>val.req_id==curr_data.school_req_id)
|
||||||
|
if(curr_final_data.length >0){
|
||||||
|
if(curr_final_data.amount != ''){
|
||||||
|
this.grandTotal-=parseInt(curr_final_data[0].amount)
|
||||||
|
}
|
||||||
|
}
|
||||||
this.finalData=this.finalData.filter(val=>{
|
this.finalData=this.finalData.filter(val=>{
|
||||||
return val.req_id!=curr_data.school_req_id
|
return val.req_id!=curr_data.school_req_id
|
||||||
})
|
})
|
||||||
@ -219,7 +236,7 @@ export class ContributeComponent implements OnInit {
|
|||||||
// console.log(this.finalData);
|
// console.log(this.finalData);
|
||||||
}
|
}
|
||||||
this.sponsor_qty[i]=''
|
this.sponsor_qty[i]=''
|
||||||
this.Total[i]=''
|
this.Total[i]=0
|
||||||
// console.log(this.finalData)
|
// console.log(this.finalData)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -267,7 +284,11 @@ export class ContributeComponent implements OnInit {
|
|||||||
|
|
||||||
getSchoolReqList2()
|
getSchoolReqList2()
|
||||||
{
|
{
|
||||||
|
this.finalData=[]
|
||||||
|
this.whole_contribute_list=[]
|
||||||
|
this.Total=[]
|
||||||
|
this.grandTotal=0
|
||||||
|
this.sponsor_qty=[]
|
||||||
let url = `${environment.apiUrl}${'getSchoolReqList'}`;
|
let url = `${environment.apiUrl}${'getSchoolReqList'}`;
|
||||||
let data = this.Contribute.value;
|
let data = this.Contribute.value;
|
||||||
this.restApi.post(url,data).subscribe(schDet=>
|
this.restApi.post(url,data).subscribe(schDet=>
|
||||||
@ -311,6 +332,11 @@ export class ContributeComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reset(){
|
reset(){
|
||||||
|
this.finalData=[]
|
||||||
|
this.whole_contribute_list=[]
|
||||||
|
this.Total=[]
|
||||||
|
this.grandTotal=0
|
||||||
|
this.sponsor_qty=[]
|
||||||
this.Contribute.reset();
|
this.Contribute.reset();
|
||||||
this.school=[]
|
this.school=[]
|
||||||
this.material_category=this.all_material_category
|
this.material_category=this.all_material_category
|
||||||
@ -342,7 +368,7 @@ export class ContributeComponent implements OnInit {
|
|||||||
this.router.navigate(['payment'])
|
this.router.navigate(['payment'])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.grandTotal ==''){
|
if(!this.grandTotal ){
|
||||||
alert("Please tell us the number of items you would like to contribute");
|
alert("Please tell us the number of items you would like to contribute");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -372,7 +398,7 @@ export class ContributeComponent implements OnInit {
|
|||||||
// if(flag == 1){
|
// if(flag == 1){
|
||||||
sessionStorage.setItem('contribute-selected-list',JSON.stringify(this.whole_contribute_list))
|
sessionStorage.setItem('contribute-selected-list',JSON.stringify(this.whole_contribute_list))
|
||||||
sessionStorage.setItem('contribute-params',JSON.stringify(data))
|
sessionStorage.setItem('contribute-params',JSON.stringify(data))
|
||||||
sessionStorage.setItem('contribute_final_total',this.grandTotal)
|
sessionStorage.setItem('contribute_final_total',String(this.grandTotal))
|
||||||
|
|
||||||
this.router.navigate(['payment'],{replaceUrl:true})
|
this.router.navigate(['payment'],{replaceUrl:true})
|
||||||
// }
|
// }
|
||||||
|
|||||||
@ -105,7 +105,7 @@ this.previousUrl = this.restApi.getPreviousUrl();
|
|||||||
this.matDialog.closeAll();
|
this.matDialog.closeAll();
|
||||||
}
|
}
|
||||||
registerDialog(){
|
registerDialog(){
|
||||||
this.closeDialog()
|
this.dialogRef.close();
|
||||||
this.matDialog.open(RegisterComponent,{
|
this.matDialog.open(RegisterComponent,{
|
||||||
"height":"600px",
|
"height":"600px",
|
||||||
"width":"550px",
|
"width":"550px",
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export class ProjectDetailComponent implements OnInit {
|
|||||||
finalData: any = [];
|
finalData: any = [];
|
||||||
Total: any=[];
|
Total: any=[];
|
||||||
whole_contribute_list: any;
|
whole_contribute_list: any;
|
||||||
grandTotal: any=[];
|
grandTotal: number;
|
||||||
general_devlop_amt: string;
|
general_devlop_amt: string;
|
||||||
gen_dev_fund_remarks: any;
|
gen_dev_fund_remarks: any;
|
||||||
dataStatus :boolean = true;
|
dataStatus :boolean = true;
|
||||||
@ -68,6 +68,12 @@ somethingChanged(e,i,item,mat_id,curr_data){
|
|||||||
if(e > bal_qty){
|
if(e > bal_qty){
|
||||||
alert("Given value is greater than Balance Qty")
|
alert("Given value is greater than Balance Qty")
|
||||||
if(this.finalData.length > 0){
|
if(this.finalData.length > 0){
|
||||||
|
let curr_final_data=this.finalData.filter(val=>val.req_id==curr_data.school_req_id)
|
||||||
|
if(curr_final_data.length >0){
|
||||||
|
if(curr_final_data.amount != ''){
|
||||||
|
this.grandTotal-=parseInt(curr_final_data[0].amount)
|
||||||
|
}
|
||||||
|
}
|
||||||
this.finalData=this.finalData.filter(val=>{
|
this.finalData=this.finalData.filter(val=>{
|
||||||
return val.req_id!=curr_data.school_req_id
|
return val.req_id!=curr_data.school_req_id
|
||||||
})
|
})
|
||||||
@ -75,13 +81,19 @@ somethingChanged(e,i,item,mat_id,curr_data){
|
|||||||
// console.log(this.finalData);
|
// console.log(this.finalData);
|
||||||
}
|
}
|
||||||
this.sponsor_qty[i]=''
|
this.sponsor_qty[i]=''
|
||||||
this.Total[i]=''
|
this.Total[i]=0
|
||||||
// console.log(this.finalData)
|
// console.log(this.finalData)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
else if(e <= 0){
|
else if(e <= 0){
|
||||||
alert("Given value is Invalid")
|
alert("Given value is Invalid")
|
||||||
if(this.finalData.length > 0){
|
if(this.finalData.length > 0){
|
||||||
|
let curr_final_data=this.finalData.filter(val=>val.req_id==curr_data.school_req_id)
|
||||||
|
if(curr_final_data.length >0){
|
||||||
|
if(curr_final_data.amount != ''){
|
||||||
|
this.grandTotal-=parseInt(curr_final_data[0].amount)
|
||||||
|
}
|
||||||
|
}
|
||||||
this.finalData=this.finalData.filter(val=>{
|
this.finalData=this.finalData.filter(val=>{
|
||||||
return val.req_id!=curr_data.school_req_id
|
return val.req_id!=curr_data.school_req_id
|
||||||
})
|
})
|
||||||
@ -89,7 +101,7 @@ somethingChanged(e,i,item,mat_id,curr_data){
|
|||||||
// console.log(this.finalData);
|
// console.log(this.finalData);
|
||||||
}
|
}
|
||||||
this.sponsor_qty[i]=''
|
this.sponsor_qty[i]=''
|
||||||
this.Total[i]=''
|
this.Total[i]=0
|
||||||
// console.log(this.finalData)
|
// console.log(this.finalData)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -133,8 +145,8 @@ finalSave(flag)
|
|||||||
this.router.navigate(['payment'])
|
this.router.navigate(['payment'])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.grandTotal ==''){
|
if(!this.grandTotal){
|
||||||
alert("Please Fill the amount");
|
alert("Please tell us the number of items you would like to contribute");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.contribute_type == '' ){
|
if(this.contribute_type == '' ){
|
||||||
@ -163,7 +175,7 @@ finalSave(flag)
|
|||||||
// if(flag == 1){
|
// if(flag == 1){
|
||||||
sessionStorage.setItem('contribute-selected-list',JSON.stringify(this.whole_contribute_list))
|
sessionStorage.setItem('contribute-selected-list',JSON.stringify(this.whole_contribute_list))
|
||||||
sessionStorage.setItem('contribute-params',JSON.stringify(data))
|
sessionStorage.setItem('contribute-params',JSON.stringify(data))
|
||||||
sessionStorage.setItem('contribute_final_total',this.grandTotal)
|
sessionStorage.setItem('contribute_final_total',String(this.grandTotal))
|
||||||
|
|
||||||
this.router.navigate(['payment'],{replaceUrl:true})
|
this.router.navigate(['payment'],{replaceUrl:true})
|
||||||
// }
|
// }
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user