Skip to content

Commit

Permalink
fix: occurrence-check command
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusantguerrero committed Nov 11, 2024
1 parent 66508d1 commit 2c18c17
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace App\Domains\Imports;
namespace App\Domains\AppCore\Imports;

use Maatwebsite\Excel\Concerns\Importable;
use Maatwebsite\Excel\Concerns\SkipsEmptyRows;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithChunkReading;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithLimit;
use Maatwebsite\Excel\Concerns\Importable;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\SkipsEmptyRows;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithChunkReading;

abstract class ImportConcern implements SkipsEmptyRows, ToModel, WithChunkReading, WithHeadingRow, WithLimit, WithMapping
{
Expand Down
4 changes: 2 additions & 2 deletions app/Domains/Budget/Imports/BudgetImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Domains\Budget\Imports;

use App\Domains\Budget\Models\BudgetMonth;
use App\Domains\Imports\ImportConcern;
use Carbon\Carbon;
use Insane\Journal\Models\Core\Category;
use App\Domains\Budget\Models\BudgetMonth;
use App\Domains\AppCore\Imports\ImportConcern;

class BudgetImport extends ImportConcern
{
Expand Down
2 changes: 1 addition & 1 deletion app/Domains/Housing/Imports/OccurrenceImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Domains\Housing\Imports;

use App\Models\User;
use App\Domains\Imports\ImportConcern;
use App\Domains\AppCore\Imports\ImportConcern;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Domains\Housing\Data\OccurrenceData;
use App\Domains\Housing\Actions\RegisterOccurrence;
Expand Down
14 changes: 12 additions & 2 deletions app/Domains/Transaction/Actions/SearchTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace App\Domains\Transaction\Actions;

use Exception;
use function Illuminate\Log\log;
use Illuminate\Support\Facades\Log;

use App\Domains\Transaction\Models\Transaction;
use App\Domains\Transaction\Models\TransactionLine;

Expand Down Expand Up @@ -33,11 +37,17 @@ public function hasValidConditions($conditions) {
if (!$condition) {
continue;
}
try {
foreach ($condition as $param) {
if ($param && $param['operator'] && $param['value']) {
if ($param && $param['operator'] && $param['value']) {
return true;
}
}

}
} catch (Exception $e) {
print_r($param);
Log::error($e);
continue;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Domains/Transaction/Imports/TransactionsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Domains\Transaction\Imports;

use App\Domains\Imports\ImportConcern;
use App\Domains\AppCore\Imports\ImportConcern;
use App\Domains\Transaction\Actions\MapYnabToLoger;
use Illuminate\Contracts\Queue\ShouldQueue;
use Insane\Journal\Models\Core\Transaction;
Expand Down
1 change: 1 addition & 0 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Insane\Journal\Models\Core\Transaction;
use App\Domains\Journal\Policies\CategoryPolicy;
use App\Domains\Journal\Policies\TransactionPolicy;
use Insane\Journal\Models\Accounting\Reconciliation;
use App\Domains\AppCore\Policies\FinanceAccountPolicy;
use App\Domains\Transaction\Policies\ReconciliationPolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
Expand Down

0 comments on commit 2c18c17

Please sign in to comment.