feat(API): 경동 견적 계산 개선 및 stock_transactions 관계 문서 갱신
- FormulaEvaluatorService: 완제품 미등록 상태에서도 경동 전용 계산 진행, product_model/finishing_type/installation_type 변수 추가 - LOGICAL_RELATIONSHIPS.md: stock_transactions 모델 관계 반영 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1596,31 +1596,34 @@ private function calculateKyungdongBom(
|
||||
['var' => 'QTY', 'desc' => '수량', 'value' => $QTY, 'unit' => 'EA'],
|
||||
['var' => 'bracket_inch', 'desc' => '브라켓 인치', 'value' => $bracketInch, 'unit' => '인치'],
|
||||
['var' => 'product_type', 'desc' => '제품 타입', 'value' => $productType, 'unit' => ''],
|
||||
['var' => 'product_model', 'desc' => '모델코드', 'value' => $inputVariables['product_model'] ?? 'KSS01', 'unit' => ''],
|
||||
['var' => 'finishing_type', 'desc' => '마감타입', 'value' => $inputVariables['finishing_type'] ?? 'SUS', 'unit' => ''],
|
||||
['var' => 'installation_type', 'desc' => '설치타입', 'value' => $inputVariables['installation_type'] ?? '벽면형', 'unit' => ''],
|
||||
],
|
||||
]);
|
||||
|
||||
// Step 2: 완제품 조회
|
||||
// Step 2: 완제품 조회 (경동 전용 계산은 완제품 없이도 동작)
|
||||
$finishedGoods = $this->getItemDetails($finishedGoodsCode, $tenantId);
|
||||
|
||||
if (! $finishedGoods) {
|
||||
if ($finishedGoods) {
|
||||
$this->addDebugStep(2, '완제품선택', [
|
||||
'code' => $finishedGoods['code'],
|
||||
'name' => $finishedGoods['name'],
|
||||
'item_category' => $finishedGoods['item_category'] ?? 'N/A',
|
||||
]);
|
||||
} else {
|
||||
// 경동 전용: 완제품 미등록 상태에서도 견적 계산 진행
|
||||
$finishedGoods = [
|
||||
'code' => $finishedGoodsCode,
|
||||
'name' => $finishedGoodsCode,
|
||||
'item_category' => 'estimate',
|
||||
];
|
||||
$this->addDebugStep(2, '완제품선택', [
|
||||
'code' => $finishedGoodsCode,
|
||||
'error' => '완제품을 찾을 수 없습니다.',
|
||||
'note' => '경동 전용 계산 - 완제품 미등록 상태로 진행',
|
||||
]);
|
||||
|
||||
return [
|
||||
'success' => false,
|
||||
'error' => __('error.finished_goods_not_found', ['code' => $finishedGoodsCode]),
|
||||
'debug_steps' => $this->debugSteps,
|
||||
];
|
||||
}
|
||||
|
||||
$this->addDebugStep(2, '완제품선택', [
|
||||
'code' => $finishedGoods['code'],
|
||||
'name' => $finishedGoods['name'],
|
||||
'item_category' => $finishedGoods['item_category'] ?? 'N/A',
|
||||
]);
|
||||
|
||||
// KyungdongFormulaHandler 인스턴스 생성
|
||||
$handler = new KyungdongFormulaHandler;
|
||||
|
||||
@@ -1646,6 +1649,11 @@ private function calculateKyungdongBom(
|
||||
// 브라켓 크기 결정
|
||||
$bracketSize = $handler->calculateBracketSize($weight, $bracketInch);
|
||||
|
||||
// 핸들러가 필요한 키 보장 (inputVariables에서 전달되지 않으면 기본값)
|
||||
$productModel = $inputVariables['product_model'] ?? 'KSS01';
|
||||
$finishingType = $inputVariables['finishing_type'] ?? 'SUS';
|
||||
$installationType = $inputVariables['installation_type'] ?? '벽면형';
|
||||
|
||||
$calculatedVariables = array_merge($inputVariables, [
|
||||
'W0' => $W0,
|
||||
'H0' => $H0,
|
||||
@@ -1658,6 +1666,9 @@ private function calculateKyungdongBom(
|
||||
'BRACKET_SIZE' => $bracketSize,
|
||||
'bracket_inch' => $bracketInch,
|
||||
'product_type' => $productType,
|
||||
'product_model' => $productModel,
|
||||
'finishing_type' => $finishingType,
|
||||
'installation_type' => $installationType,
|
||||
]);
|
||||
|
||||
$this->addDebugStep(3, '변수계산', [
|
||||
|
||||
Reference in New Issue
Block a user