refs #2611 Reconciliation edit added transaction list..
This commit is contained in:
parent
ba762c001e
commit
2421bd9a8e
@ -15,6 +15,7 @@ class UpdateReconciliation extends Job implements ShouldUpdate
|
|||||||
$reconcile = (int) $this->request->get('reconcile');
|
$reconcile = (int) $this->request->get('reconcile');
|
||||||
$transactions = $this->request->get('transactions');
|
$transactions = $this->request->get('transactions');
|
||||||
|
|
||||||
|
$this->model->transactions = $transactions;
|
||||||
$this->model->reconciled = $reconcile;
|
$this->model->reconciled = $reconcile;
|
||||||
$this->model->save();
|
$this->model->save();
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ class Reconciliation extends Model
|
|||||||
protected $casts = [
|
protected $casts = [
|
||||||
'closing_balance' => 'double',
|
'closing_balance' => 'double',
|
||||||
'reconciled' => 'boolean',
|
'reconciled' => 'boolean',
|
||||||
|
'transactions' => 'array',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,9 +19,15 @@ return new class extends Migration
|
|||||||
Type::addType('double', FloatType::class);
|
Type::addType('double', FloatType::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Document Items
|
||||||
Schema::table('document_items', function(Blueprint $table) {
|
Schema::table('document_items', function(Blueprint $table) {
|
||||||
$table->double('quantity', 12, 2)->change();
|
$table->double('quantity', 12, 2)->change();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Reconciliations
|
||||||
|
Schema::table('reconciliations', function (Blueprint $table) {
|
||||||
|
$table->text('transactions')->nullable()->after('closing_balance');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,13 +83,22 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
<td class="ltr:pl-6 rtl:pr-6 py-4 text-center text-sm font-medium">
|
<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 }}"
|
<x-form.input.checkbox name="{{ $type . '_' . $item->id }}"
|
||||||
label=""
|
label=""
|
||||||
id="transaction-{{ $item->id . '-'. $type }}"
|
id="transaction-{{ $item->id . '-'. $type }}"
|
||||||
:value="$item->amount_for_account"
|
:value="$item->amount_for_account"
|
||||||
:checked="$item->reconciled"
|
:checked="$checked"
|
||||||
data-field="transactions"
|
data-field="transactions"
|
||||||
v-model="form.transactions.{{ $type . '_' . $item->id }}"
|
v-model="form.transactions.{{ $type . '_' . $item->id }}"
|
||||||
class="text-purple focus:outline-none focus:ring-purple focus:border-purple"
|
class="text-purple focus:outline-none focus:ring-purple focus:border-purple"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user