fixed reconciliation jobs
This commit is contained in:
parent
873d25c742
commit
af685b6c17
@ -31,17 +31,12 @@ class CreateReconciliation extends Job
|
||||
public function handle()
|
||||
{
|
||||
\DB::transaction(function () {
|
||||
$reconcile = $this->request->get('reconcile');
|
||||
$reconcile = (int) $this->request->get('reconcile');
|
||||
$transactions = $this->request->get('transactions');
|
||||
|
||||
$this->reconciliation = Reconciliation::create([
|
||||
'company_id' => $this->request['company_id'],
|
||||
'account_id' => $this->request->get('account_id'),
|
||||
'started_at' => $this->request->get('started_at'),
|
||||
'ended_at' => $this->request->get('ended_at'),
|
||||
'closing_balance' => $this->request->get('closing_balance'),
|
||||
'reconciled' => $reconcile ? 1 : 0,
|
||||
]);
|
||||
$this->request->merge(['reconciled' => $reconcile]);
|
||||
|
||||
$this->reconciliation = Reconciliation::create($this->request->all());
|
||||
|
||||
if ($reconcile && $transactions) {
|
||||
foreach ($transactions as $key => $value) {
|
||||
|
@ -32,10 +32,10 @@ class UpdateReconciliation extends Job
|
||||
public function handle()
|
||||
{
|
||||
\DB::transaction(function () {
|
||||
$reconcile = $this->request->get('reconcile');
|
||||
$reconcile = (int) $this->request->get('reconcile');
|
||||
$transactions = $this->request->get('transactions');
|
||||
|
||||
$this->reconciliation->reconciled = $reconcile ? 1 : 0;
|
||||
$this->reconciliation->reconciled = $reconcile;
|
||||
$this->reconciliation->save();
|
||||
|
||||
if ($transactions) {
|
||||
@ -47,7 +47,7 @@ class UpdateReconciliation extends Job
|
||||
$t = explode('_', $key);
|
||||
|
||||
$transaction = Transaction::find($t[1]);
|
||||
$transaction->reconciled = $reconcile ? 1 : 0;
|
||||
$transaction->reconciled = $reconcile;
|
||||
$transaction->save();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user