Skip to content

Commit

Permalink
Roll back matching rules
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo124 committed Oct 22, 2024
1 parent 4414a44 commit f26feb6
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion app/Services/Bank/ProcessBankRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,26 @@ public function run()
}
}

private function matchCredit()
{
$this->invoices = Invoice::query()->where('company_id', $this->bank_transaction->company_id)
->whereIn('status_id', [1,2,3])
->where('is_deleted', 0)
->get();

$invoice = $this->invoices->first(function ($value, $key) {
return str_contains($this->bank_transaction->description, $value->number) || str_contains(str_replace("\n", "", $this->bank_transaction->description), $value->number);
});

if ($invoice) {
$this->bank_transaction->invoice_ids = $invoice->hashed_id;
$this->bank_transaction->status_id = BankTransaction::STATUS_MATCHED;
$this->bank_transaction->save();
return;
}

}

// $payment.amount
// $payment.transaction_reference
// $payment.custom1
Expand All @@ -73,7 +93,7 @@ public function run()
// $client.custom2
// $client.custom3
// $client.custom4
private function matchCredit()
private function matchCreditXX()
{
$match_set = [];

Expand Down

0 comments on commit f26feb6

Please sign in to comment.