connect details read from dial route #2znd43c

This commit is contained in:
Sevan Nerse
2022-06-02 00:12:48 +03:00
parent 8cc8fcfd92
commit 05b2fec17c
5 changed files with 70 additions and 33 deletions

View File

@ -470,22 +470,10 @@ class Transaction extends Model
'permission' => 'create-banking-transactions',
'attributes' => [
'id' => 'index-transactions-more-actions-connect-' . $this->id,
'@click' => 'onConnect(\'' . route('transactions.dial', $this->id) . '\')',
],
];
$transaction = $this->load('account')->toJson();
$currency = $this->currency->toJson();
if ($this->contact->exists) {
$document = $this->contact->invoices()->notPaid()->where('currency_code', $this->currency_code)->with(['media', 'totals', 'transactions'])->get()->toJson();
$connect['attributes']['@click'] = 'onConnect()';
} else {
$document = \App\Models\Document\Document::invoice()->notPaid()->where('currency_code', $this->currency_code)->with(['media', 'totals', 'transactions'])->get()->toJson();
$connect['attributes']['@click'] = 'onConnect()';
}
$actions[] = $connect;
$actions[] = [