From ad9dfe2c2a16178c6e2045c3ef306b6315cf3fc7 Mon Sep 17 00:00:00 2001 From: pro Date: Fri, 23 Jan 2026 09:50:19 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EB=B0=94=EB=A1=9C=EB=B9=8C=20=EC=84=B8?= =?UTF-8?q?=EA=B8=88=EA=B3=84=EC=82=B0=EC=84=9C=20=EB=B0=9C=ED=96=89=20API?= =?UTF-8?q?=20=EB=A0=88=EA=B1=B0=EC=8B=9C=20=EC=BD=94=EB=93=9C=EC=99=80=20?= =?UTF-8?q?=EB=8F=99=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - InvoicerParty에 ContactID 필드 추가 (기본값: cbx0913) - TaxRegID, BizType, BizClass, TEL, HP 등 누락 필드 추가 - InvoiceeParty에도 동일한 필드 추가 - TaxInvoiceTradeLineItem에 PurchaseExpiry, Information, Description 추가 - 레거시 barobill_config.php와 동일한 구조로 맞춤 Co-Authored-By: Claude Opus 4.5 --- .../Controllers/Barobill/EtaxController.php | 44 ++++++++++++++----- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Barobill/EtaxController.php b/app/Http/Controllers/Barobill/EtaxController.php index 96fcab38..7caf145e 100644 --- a/app/Http/Controllers/Barobill/EtaxController.php +++ b/app/Http/Controllers/Barobill/EtaxController.php @@ -357,12 +357,12 @@ private function issueTaxInvoice(array $invoiceData): array $taxType = $vat == 0 ? 2 : 1; $taxInvoice = [ - 'IssueDirection' => 1, - 'TaxInvoiceType' => 1, - 'ModifyCode' => '', - 'TaxType' => $taxType, - 'TaxCalcType' => 1, - 'PurposeType' => 2, + 'IssueDirection' => 1, // 1: 정발행 + 'TaxInvoiceType' => 1, // 1: 세금계산서 + 'ModifyCode' => '', // 수정사유코드 (신규발행시 빈값) + 'TaxType' => $taxType, // 1: 과세, 2: 영세, 3: 면세 + 'TaxCalcType' => 1, // 1: 소계합계 + 'PurposeType' => 2, // 2: 청구 'WriteDate' => date('Ymd', strtotime($invoiceData['supplyDate'] ?? date('Y-m-d'))), 'AmountTotal' => number_format($supplyAmt, 0, '', ''), 'TaxTotal' => number_format($vat, 0, '', ''), @@ -372,33 +372,55 @@ private function issueTaxInvoice(array $invoiceData): array 'Note' => '0', 'Credit' => number_format($total, 0, '', ''), 'Remark1' => $invoiceData['memo'] ?? '', + 'Remark2' => '', + 'Remark3' => '', + 'Kwon' => '', + 'Ho' => '', + 'SerialNum' => '', 'InvoicerParty' => [ 'MgtNum' => $mgtKey, 'CorpNum' => $this->corpNum, + 'TaxRegID' => '', // 종사업장번호 'CorpName' => $invoiceData['supplierName'] ?? '', 'CEOName' => $invoiceData['supplierCeo'] ?? '', 'Addr' => $invoiceData['supplierAddr'] ?? '', + 'BizType' => '', // 업태 + 'BizClass' => '', // 종목 + 'ContactID' => $invoiceData['supplierContactId'] ?? 'cbx0913', // 바로빌 담당자 ID (필수) 'ContactName' => $invoiceData['supplierContact'] ?? '', + 'TEL' => $invoiceData['supplierTel'] ?? '', + 'HP' => '', 'Email' => $invoiceData['supplierEmail'] ?? '', ], 'InvoiceeParty' => [ + 'MgtNum' => '', 'CorpNum' => str_replace('-', '', $invoiceData['recipientBizno'] ?? ''), + 'TaxRegID' => '', 'CorpName' => $invoiceData['recipientName'] ?? '', 'CEOName' => $invoiceData['recipientCeo'] ?? '', 'Addr' => $invoiceData['recipientAddr'] ?? '', + 'BizType' => '', + 'BizClass' => '', + 'ContactID' => '', 'ContactName' => $invoiceData['recipientContact'] ?? '', + 'TEL' => $invoiceData['recipientTel'] ?? '', + 'HP' => '', 'Email' => $invoiceData['recipientEmail'] ?? '', ], + 'BrokerParty' => [], // 위수탁 거래시에만 사용 'TaxInvoiceTradeLineItems' => ['TaxInvoiceTradeLineItem' => []], ]; foreach ($invoiceData['items'] ?? [] as $item) { $taxInvoice['TaxInvoiceTradeLineItems']['TaxInvoiceTradeLineItem'][] = [ - 'Name' => $item['name'] ?? '', - 'ChargeableUnit' => $item['qty'] ?? '1', - 'UnitPrice' => number_format(floatval($item['unitPrice'] ?? 0), 0, '', ''), - 'Amount' => number_format(floatval($item['supplyAmt'] ?? 0), 0, '', ''), - 'Tax' => number_format(floatval($item['vat'] ?? 0), 0, '', ''), + 'PurchaseExpiry' => '', // 공제기한 + 'Name' => $item['name'] ?? '', // 품명 + 'Information' => $item['spec'] ?? '', // 규격 + 'ChargeableUnit' => $item['qty'] ?? '1', // 수량 + 'UnitPrice' => number_format(floatval($item['unitPrice'] ?? 0), 0, '', ''), // 단가 + 'Amount' => number_format(floatval($item['supplyAmt'] ?? 0), 0, '', ''), // 공급가액 + 'Tax' => number_format(floatval($item['vat'] ?? 0), 0, '', ''), // 부가세 + 'Description' => $item['description'] ?? '', // 비고 ]; }