feat: 修正庫存與撥補單邏輯並整合文件
1. 修復倉庫統計數據加總與樣式。 2. 修正可用庫存計算邏輯(排除不可銷售倉庫)。 3. 撥補單商品列表加入批號與效期顯示。 4. 修正撥補單儲存邏輯以支援精確批號轉移。 5. 整合 FEATURES.md 至 README.md。
This commit is contained in:
23
app/Modules/Procurement/Services/ProcurementService.php
Normal file
23
app/Modules/Procurement/Services/ProcurementService.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Procurement\Services;
|
||||
|
||||
use App\Modules\Procurement\Contracts\ProcurementServiceInterface;
|
||||
use App\Modules\Procurement\Models\PurchaseOrder;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class ProcurementService implements ProcurementServiceInterface
|
||||
{
|
||||
public function getPurchaseOrdersByDate(string $start, string $end, array $statuses = ['received', 'completed']): Collection
|
||||
{
|
||||
return PurchaseOrder::with(['vendor'])
|
||||
->whereIn('status', $statuses)
|
||||
->whereBetween('created_at', [$start . ' 00:00:00', $end . ' 23:59:59'])
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getPurchaseOrdersByIds(array $ids, array $with = []): Collection
|
||||
{
|
||||
return PurchaseOrder::whereIn('id', $ids)->with($with)->get();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user