FIX_PAYOUT_ISSUES_STATUS&BROKER_ID

This commit is contained in:
velz 2025-12-16 15:23:06 +05:30
parent f853004fd8
commit 0eea675a9f
2 changed files with 5 additions and 3 deletions

View File

@ -439,7 +439,7 @@ class PayoutController extends BaseController
$agentCode = $agent["agent_code"]; $agentCode = $agent["agent_code"];
$today = date("Ymd"); $today = date("Ymd");
$likePattern = "INV/$agentCode/$today/%"; $likePattern = "NIIB/$agentCode/$today/%";
$count = $this->invoiceModel $count = $this->invoiceModel
->like("invoice_no", $likePattern) ->like("invoice_no", $likePattern)
@ -447,7 +447,7 @@ class PayoutController extends BaseController
$nextNumber = $count + 1; $nextNumber = $count + 1;
return "INV/$agentCode/$today/$nextNumber"; return "NIIB/$agentCode/$today/$nextNumber";
} }
// private function generateInvoiceNumber() // private function generateInvoiceNumber()

View File

@ -23,6 +23,7 @@ class InvoiceModel extends Model
'created_by', 'created_by',
'updated_at', 'updated_at',
'payout_status', 'payout_status',
'broker_id'
]; ];
// Timestamps // Timestamps
@ -219,7 +220,8 @@ class InvoiceModel extends Model
if ($flag == 1) { // Add mode if ($flag == 1) { // Add mode
// EXCLUDE all policies that exist in partner_invoice_items // EXCLUDE all policies that exist in partner_invoice_items
$builder->where("pt.id NOT IN (SELECT policy_id FROM partner_invoice_items)", null, false); $builder->where("pp.id NOT IN (SELECT policy_id FROM partner_invoice_items)", null, false);
$builder->where("pt.policy_no NOT IN (SELECT policy_no FROM partner_invoice_items)", null, false);
} }
if ($flag == 2) { // Edit mode if ($flag == 2) { // Edit mode