feat: 매입 일괄 업데이트 API 추가
- 매입유형 일괄 변경 API (POST /purchases/bulk-update-type) - 세금계산서 수취 일괄 설정 API (POST /purchases/bulk-update-tax-received) - FormRequest 검증 클래스 추가 - Swagger 문서 추가
This commit is contained in:
@@ -264,6 +264,44 @@ public function summary(array $params): array
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 매입유형 일괄 변경
|
||||
*
|
||||
* @param array<int> $ids
|
||||
*/
|
||||
public function bulkUpdatePurchaseType(array $ids, string $purchaseType): int
|
||||
{
|
||||
$tenantId = $this->tenantId();
|
||||
$userId = $this->apiUserId();
|
||||
|
||||
return Purchase::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->whereIn('id', $ids)
|
||||
->update([
|
||||
'purchase_type' => $purchaseType,
|
||||
'updated_by' => $userId,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 세금계산서 수취 일괄 설정
|
||||
*
|
||||
* @param array<int> $ids
|
||||
*/
|
||||
public function bulkUpdateTaxReceived(array $ids, bool $taxInvoiceReceived): int
|
||||
{
|
||||
$tenantId = $this->tenantId();
|
||||
$userId = $this->apiUserId();
|
||||
|
||||
return Purchase::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->whereIn('id', $ids)
|
||||
->update([
|
||||
'tax_invoice_received' => $taxInvoiceReceived,
|
||||
'updated_by' => $userId,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 매입번호 자동 생성
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user