Hey Expertise.
I want to check month wise.user have paid or due.
But I have facing some problem
My month name repeat two times. but I need month should be static and value will be change based on condition.
Below my screen shots
and my json response is;
| 0 | {…} |
|---|---|
| payment_id | 1 |
| renthistory_id | 2 |
| monthly_payment | 16000 |
| room_charge | 6000 |
| water | 0 |
| service | 0 |
| electricity | 0 |
| taxes | 0 |
| security | 0 |
| gas | 0 |
| others | 0 |
| single | 10000 |
| payment | 10000 |
| paymentDate | 26.7.2018 |
| duePaymnt | 0 |
| paymentDueDate | 0000-00-00 |
| paymentMode | Online |
| ChequeNo | |
| pay_month | 07 |
| pay_fullmonth | July |
| pay_year | 2018 |
| payment_status | 1 |
| 1 | {…} |
| payment_id | 2 |
| renthistory_id | 2 |
| monthly_payment | 16000 |
| room_charge | 6000 |
| water | 0 |
| service | 0 |
| electricity | 0 |
| taxes | 0 |
| security | 0 |
| gas | 0 |
| others | 0 |
| single | 10000 |
| payment | 10000 |
| paymentDate | 11.9.2018 |
| duePaymnt | 0 |
| paymentDueDate | 0000-00-00 |
| paymentMode | Online |
| ChequeNo | ABC123 |
| pay_month | 09 |
| pay_fullmonth | September |
| pay_year | 2018 |
| payment_status | 1 |
Html code
<div *ngFor="let item of test">
<ion-item>
January
<ion-badge item-end *ngIf="item.pay_month == 01" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 01">Due</ion-badge>
</ion-item>
<ion-item>
February
<ion-badge item-end *ngIf="item.pay_month == 02" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 02">Due</ion-badge>
</ion-item>
<ion-item>
March
<ion-badge item-end *ngIf="item.pay_month == 03" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 03">Due</ion-badge>
</ion-item>
<ion-item>
April
<ion-badge item-end *ngIf="item.pay_month == 04" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 04">Due</ion-badge>
</ion-item>
<ion-item>
May
<ion-badge item-end *ngIf="item.pay_month == 05" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 05">Due</ion-badge>
</ion-item>
<ion-item>
June
<ion-badge item-end *ngIf="item.pay_month == 06" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 06">Due</ion-badge>
</ion-item>
<ion-item>
July
<ion-badge item-end *ngIf="item.pay_month == 07" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 07">Due</ion-badge>
</ion-item>
<ion-item>
August
<ion-badge item-end *ngIf="item.pay_month == 08" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 08">Due</ion-badge>
</ion-item>
<ion-item>
September
<ion-badge item-end *ngIf="item.pay_month == 09" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 09">Due</ion-badge>
</ion-item>
<ion-item>
October
<ion-badge item-end *ngIf="item.pay_month == 10" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 10">Due</ion-badge>
</ion-item>
<ion-item>
November
<ion-badge item-end *ngIf="item.pay_month == 11" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 11">Due</ion-badge>
</ion-item>
<ion-item>
December
<ion-badge item-end *ngIf="item.pay_month == 11" color="green">Paid</ion-badge>
<ion-badge item-end *ngIf="item.pay_month != 11">Due</ion-badge>
</ion-item>
</div>
I want like this
Please help me out
Thanks in andvance

