diff --git a/app/Models/PTCOShareDetailsModel.php b/app/Models/PTCOShareDetailsModel.php index 43272ff2..385645ed 100644 --- a/app/Models/PTCOShareDetailsModel.php +++ b/app/Models/PTCOShareDetailsModel.php @@ -93,8 +93,8 @@ class PTCOShareDetailsModel extends Model ->join('policy_transaction pt', 'pt_co.pt_id = pt.id') ->join('clients c', 'pt.client_id = c.id') ->where('pt_co.is_active', 1) - ->where('MONTH(pt.created_at)', $month) - ->where('YEAR(pt.created_at)', $year) + ->where('MONTH(pt.month)', $month) + ->where('YEAR(pt.month)', $year) ->where('pt_co.insurer_id', $insurer_id) ->where('pt_co.insurer_branch_id', $insurer_branch_id) ->where('pt_co.statement_id is null') diff --git a/app/Views/insurer_statement_list.php b/app/Views/insurer_statement_list.php index 7362ac63..4407c302 100644 --- a/app/Views/insurer_statement_list.php +++ b/app/Views/insurer_statement_list.php @@ -688,14 +688,27 @@ $(document).ready(function(){ autoclose: true }); + $('.payment_date').datepicker({ format: 'dd-mm-yyyy', autoclose: true }); + // Get today's date +var today = new Date(); + +// Calculate the minimum date (60 days before today) +var minDate = new Date(); +minDate.setDate(today.getDate() - 180); + +// Calculate the maximum date (60 days after today) +var maxDate = new Date(); +maxDate.setDate(today.getDate() + 180); $('#invoice_date_modal').datepicker({ format: 'dd-mm-yyyy', - autoclose: true + autoclose: true, + startDate: minDate, + endDate: maxDate }); // var invoice_date_modal = flatpickr("#invoice_date_modal", {