refactor: improve formatting consistency in various models and services
This commit is contained in:
parent
b70a40af4d
commit
3f77a9436d
@ -2,10 +2,8 @@
|
||||
|
||||
namespace App\Services\Admin\Finance;
|
||||
|
||||
use App\Enums\CashTransactionType;
|
||||
use App\Enums\EmployeeAdvanceStatus;
|
||||
use App\Models\CashAccount;
|
||||
use App\Models\CashTransaction;
|
||||
use App\Models\EmployeeAdvance;
|
||||
use App\Services\Concerns\HandlesCashTransactions;
|
||||
use App\Services\NotificationService;
|
||||
@ -17,6 +15,7 @@
|
||||
class EmployeeAdvanceService
|
||||
{
|
||||
use HandlesCashTransactions;
|
||||
|
||||
public function getAll(array $filters = []): Collection
|
||||
{
|
||||
return EmployeeAdvance::select('id', 'employee_id', 'amount', 'paid_amount', 'description', 'due_date', 'status', 'created_at')
|
||||
|
||||
@ -2,9 +2,7 @@
|
||||
|
||||
namespace App\Services\Admin\Finance;
|
||||
|
||||
use App\Enums\CashTransactionType;
|
||||
use App\Models\CashAccount;
|
||||
use App\Models\CashTransaction;
|
||||
use App\Models\Expense;
|
||||
use App\Services\Concerns\HandlesCashTransactions;
|
||||
use App\Services\Concerns\RegistersMedia;
|
||||
|
||||
@ -2,11 +2,8 @@
|
||||
|
||||
namespace App\Services\Admin\Finance;
|
||||
|
||||
use App\Enums\CashTransactionType;
|
||||
use App\Enums\PayrollPeriodStatus;
|
||||
use App\Enums\PayrollStatus;
|
||||
use App\Models\CashAccount;
|
||||
use App\Models\CashTransaction;
|
||||
use App\Models\Payroll;
|
||||
use App\Models\PayrollPeriod;
|
||||
use App\Services\Concerns\HandlesCashTransactions;
|
||||
@ -19,6 +16,7 @@
|
||||
class PayrollPeriodService
|
||||
{
|
||||
use HandlesCashTransactions;
|
||||
|
||||
public function getAll(array $filters = []): Collection
|
||||
{
|
||||
return PayrollPeriod::select('id', 'year', 'month', 'status', 'closed_at', 'created_at')
|
||||
|
||||
@ -241,5 +241,4 @@ private function buildItemRows(array $items, string $stockType, $now, int &$subt
|
||||
];
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
use App\Enums\CashTransactionType;
|
||||
use App\Models\CashAccount;
|
||||
use App\Models\CashTransaction;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
trait HandlesCashTransactions
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Services\Concerns;
|
||||
|
||||
use App\Enums\ProductStockQuality;
|
||||
use App\Models\ProductVariant;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
trait HasStockAdjustment
|
||||
@ -26,7 +27,7 @@ private function adjustVariantStock(int $variantId, int $quantity, int $sign, st
|
||||
$field = self::QUALITY_STOCK_MAP[$stockType] ?? 'stock';
|
||||
|
||||
$this->adjustStock(
|
||||
model: app(\App\Models\ProductVariant::class)->newQuery()->findOrFail($variantId),
|
||||
model: app(ProductVariant::class)->newQuery()->findOrFail($variantId),
|
||||
field: $field,
|
||||
quantity: $quantity,
|
||||
sign: $sign,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user