mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on credit rules for bank transactions
This commit is contained in:
parent
0bca8b6074
commit
bd94f7bb65
@ -50,6 +50,13 @@ class ProcessBankRules extends AbstractService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// $payment.amount => "Payment Amount", float
|
||||||
|
// $payment.transaction_reference => "Payment Transaction Reference", string
|
||||||
|
// $invoice.amount => "Invoice Amount", float
|
||||||
|
// $invoice.number => "Invoice Number", string
|
||||||
|
// $client.id_number => "Client ID Number", string
|
||||||
|
// $client.email => "Client Email", string
|
||||||
|
// $invoice.po_number => "Invoice Purchase Order Number", string
|
||||||
private function matchCredit()
|
private function matchCredit()
|
||||||
{
|
{
|
||||||
$this->invoices = Invoice::query()->where('company_id', $this->bank_transaction->company_id)
|
$this->invoices = Invoice::query()->where('company_id', $this->bank_transaction->company_id)
|
||||||
@ -97,6 +104,20 @@ class ProcessBankRules extends AbstractService
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($rule['search_key'] == '$invoice.po_number') {
|
||||||
|
|
||||||
|
$invoicePONumbers = Invoice::query()->where('company_id', $this->bank_transaction->company_id)
|
||||||
|
->whereIn('status_id', [1,2,3])
|
||||||
|
->where('is_deleted', 0)
|
||||||
|
->where('po_number', $this->bank_transaction->description)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
if($invoicePONumbers->count() > 0) {
|
||||||
|
$matches++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if ($rule['search_key'] == '$invoice.amount') {
|
if ($rule['search_key'] == '$invoice.amount') {
|
||||||
|
|
||||||
$this->invoices = Invoice::query()->where('company_id', $this->bank_transaction->company_id)
|
$this->invoices = Invoice::query()->where('company_id', $this->bank_transaction->company_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user