refs #2611 Reconciliation edit added transaction list..

This commit is contained in:
Cüneyt Şentürk 2022-09-05 15:58:36 +03:00
parent ba762c001e
commit 2421bd9a8e
4 changed files with 20 additions and 3 deletions

View File

@ -15,6 +15,7 @@ class UpdateReconciliation extends Job implements ShouldUpdate
$reconcile = (int) $this->request->get('reconcile');
$transactions = $this->request->get('transactions');
$this->model->transactions = $transactions;
$this->model->reconciled = $reconcile;
$this->model->save();

View File

@ -28,6 +28,7 @@ class Reconciliation extends Model
protected $casts = [
'closing_balance' => 'double',
'reconciled' => 'boolean',
'transactions' => 'array',
];
/**

View File

@ -19,9 +19,15 @@ return new class extends Migration
Type::addType('double', FloatType::class);
}
// Document Items
Schema::table('document_items', function(Blueprint $table) {
$table->double('quantity', 12, 2)->change();
});
// Reconciliations
Schema::table('reconciliations', function (Blueprint $table) {
$table->text('transactions')->nullable()->after('closing_balance');
});
}
/**

View File

@ -83,13 +83,22 @@
@endif
<td class="ltr:pl-6 rtl:pr-6 py-4 text-center text-sm font-medium">
@php $type = $item->isIncome() ? 'income' : 'expense'; @endphp
@php
$type = $item->isIncome() ? 'income' : 'expense';
$name = $type . '_' . $item->id;
$checked = $item->reconciled;
if (! $reconciliation->reconciled && array_key_exists($name, $reconciliation->transactions)) {
$checked = $reconciliation->transactions[$name];
}
@endphp
<x-form.input.checkbox name="{{ $type . '_' . $item->id }}"
label=""
id="transaction-{{ $item->id . '-'. $type }}"
:value="$item->amount_for_account"
:checked="$item->reconciled"
:checked="$checked"
data-field="transactions"
v-model="form.transactions.{{ $type . '_' . $item->id }}"
class="text-purple focus:outline-none focus:ring-purple focus:border-purple"