<?php			  
$con_num = isset($_REQUEST["con_num"]) ? $_REQUEST["con_num"] : '';
$outdate = isset($_REQUEST["outdate"]) ? $_REQUEST["outdate"] : '';
$indate = isset($_REQUEST["indate"]) ? $_REQUEST["indate"] : '';
$orderman = isset($_REQUEST["orderman"]) ? $_REQUEST["orderman"] : '';
$outworkplace = isset($_REQUEST["outworkplace"]) ? $_REQUEST["outworkplace"] : '';
$outputplace = isset($_REQUEST["outputplace"]) ? $_REQUEST["outputplace"] : '';
$phone = isset($_REQUEST["phone"]) ? $_REQUEST["phone"] : '';
$receiver = isset($_REQUEST["receiver"]) ? $_REQUEST["receiver"] : '';
$comment = isset($_REQUEST["comment"]) ? $_REQUEST["comment"] : '';
$root = isset($_REQUEST["root"]) ? $_REQUEST["root"] : '';
$steel = isset($_REQUEST["steel"]) ? $_REQUEST["steel"] : '';
$motor = isset($_REQUEST["motor"]) ? $_REQUEST["motor"] : '';
$delivery = isset($_REQUEST["delivery"]) ? $_REQUEST["delivery"] : '';
$regist_state = isset($_REQUEST["regist_state"]) ? $_REQUEST["regist_state"] : '';
$bend_state = isset($_REQUEST["bend_state"]) ? $_REQUEST["bend_state"] : '';
$motor_state = isset($_REQUEST["motor_state"]) ? $_REQUEST["motor_state"] : '';

$is_deleted = isset($_REQUEST["is_deleted"]) ? $_REQUEST["is_deleted"] : '0' ;
$searchtag = isset($_REQUEST["searchtag"]) ? $_REQUEST["searchtag"] : null ;
$update_log = isset($_REQUEST["update_log"]) ? $_REQUEST["update_log"] : null ;

$screen = isset($_REQUEST["screen"]) ? $_REQUEST["screen"] : "" ;
$screen_state = isset($_REQUEST["screen_state"]) ? $_REQUEST["screen_state"] : '' ;
$screen_su = isset($_REQUEST["screen_su"]) ? $_REQUEST["screen_su"] : '' ;
$screen_m2 = isset($_REQUEST["screen_m2"]) ? $_REQUEST["screen_m2"] : '' ;

$slat = isset($_REQUEST["slat"]) ? $_REQUEST["slat"] : "" ;
$slat_state = isset($_REQUEST["slat_state"]) ? $_REQUEST["slat_state"] : '' ;
$slat_su = isset($_REQUEST["slat_su"]) ? $_REQUEST["slat_su"] : '' ;
$slat_m2 = isset($_REQUEST["slat_m2"]) ? $_REQUEST["slat_m2"] : '' ;

$updatecomment = isset($_REQUEST["updatecomment"]) ? $_REQUEST["updatecomment"] : '' ;

$secondord = isset($_REQUEST['secondord']) ? $_REQUEST['secondord'] : '';
$secondordman = isset($_REQUEST['secondordman']) ? $_REQUEST['secondordman'] : '';
$secondordmantel = isset($_REQUEST['secondordmantel']) ? $_REQUEST['secondordmantel'] : '';
$secondordnum = isset($_REQUEST['secondordnum']) ? $_REQUEST['secondordnum'] : '';
$prodCode = isset($_REQUEST['prodCode']) ? $_REQUEST['prodCode'] : '';
$warrantyNum = isset($_REQUEST['warrantyNum']) ? $_REQUEST['warrantyNum'] : '';
$orderdate = isset($_REQUEST['orderdate']) ? $_REQUEST['orderdate'] : '';
$lotNum = isset($_REQUEST['lotNum']) ? $_REQUEST['lotNum'] : '';

$etcList = isset($_REQUEST['etcList']) ? $_REQUEST['etcList'] : '{}';	

$screen_unapprovedList = isset($_REQUEST['screen_unapprovedList']) ? $_REQUEST['screen_unapprovedList'] : '{}';
$slat_unapprovedList = isset($_REQUEST['slat_unapprovedList']) ? $_REQUEST['slat_unapprovedList'] : '{}';
$motorList = isset($_REQUEST['motorList']) ? $_REQUEST['motorList'] : '{}';
$bendList = isset($_REQUEST['bendList']) ? $_REQUEST['bendList'] : '{}';    
$controllerList = isset($_REQUEST['controllerList']) ? $_REQUEST['controllerList'] : '{}';

$recordscreen = isset($_REQUEST['recordscreen']) ? $_REQUEST['recordscreen'] : '{}';	
$recordslat = isset($_REQUEST['recordslat']) ? $_REQUEST['recordslat'] : '{}';	
$recordbending = isset($_REQUEST['recordbending']) ? $_REQUEST['recordbending'] : '{}';	
$screenlist = isset($_REQUEST['screenlist']) ? $_REQUEST['screenlist'] : '{}';	
$slatlist = isset($_REQUEST['slatlist']) ? $_REQUEST['slatlist'] : '{}';	
$estimateList = isset($_REQUEST['estimateList']) ? $_REQUEST['estimateList'] : '{}';	
$estimateSlatList = isset($_REQUEST['estimateSlatList']) ? $_REQUEST['estimateSlatList'] : '{}';	
$COD = isset($_REQUEST['COD']) ? $_REQUEST['COD'] : '{}';	// 출고증
$recordslatMid = isset($_REQUEST['recordslatMid']) ? $_REQUEST['recordslatMid'] : '{}';
$recordscreenMid = isset($_REQUEST['recordscreenMid']) ? $_REQUEST['recordscreenMid'] : '{}';
$recordbendingMid = isset($_REQUEST['recordbendingMid']) ? $_REQUEST['recordbendingMid'] : '{}';
$warranty = isset($_REQUEST['warranty']) ? $_REQUEST['warranty'] : '';
$ordersheet = isset($_REQUEST['ordersheet']) ? $_REQUEST['ordersheet'] : '{}';
$ordersheet_slat = isset($_REQUEST['ordersheet_slat']) ? $_REQUEST['ordersheet_slat'] : '{}';

// 인정검사 관련 날짜 필드 - 빈 문자열은 NULL로 처리 (MySQL 8.0 Strict Mode 호환)
$ACIregDate = isset($_REQUEST["ACIregDate"]) && $_REQUEST["ACIregDate"] !== '' ? $_REQUEST["ACIregDate"] : null;
$ACIaskDate = isset($_REQUEST["ACIaskDate"]) && $_REQUEST["ACIaskDate"] !== '' ? $_REQUEST["ACIaskDate"] : null;
$ACIdoneDate = isset($_REQUEST["ACIdoneDate"]) && $_REQUEST["ACIdoneDate"] !== '' ? $_REQUEST["ACIdoneDate"] : null;
$ACImemo = isset($_REQUEST["ACImemo"]) ? $_REQUEST["ACImemo"] : '';

$iList = isset($_REQUEST['iList']) ? $_REQUEST['iList'] : '{}'; // 인정검사 자료
$recordjointbar = isset($_REQUEST['recordjointbar']) ? $_REQUEST['recordjointbar'] : '{}';	// 조인트바 중간검사
$ACIcheck = isset($_REQUEST["ACIcheck"]) ? $_REQUEST["ACIcheck"] : null;
$deliveryfeeList = isset($_REQUEST['deliveryfeeList']) ? $_REQUEST['deliveryfeeList'] : '{}';	// 배송비 json
$ACIgroupCode = $_REQUEST["ACIgroupCode"] ?? '';
$ACIgroupName = $_REQUEST["ACIgroupName"] ?? '';

// 매출과 관련된 견적에서 가져오는 변수 추가 25/04/22일자
$detailJson = isset($_REQUEST['detailJson']) ? $_REQUEST['detailJson'] : '{}';
$estimateTotal = isset($_REQUEST["estimateTotal"]) ? $_REQUEST["estimateTotal"] : 0;
$EstimateFirstSum = isset($_REQUEST["EstimateFirstSum"]) ? $_REQUEST["EstimateFirstSum"] : 0;
$EstimateUpdatetSum = isset($_REQUEST["EstimateUpdatetSum"]) ? $_REQUEST["EstimateUpdatetSum"] : 0;
$EstimateDiffer = isset($_REQUEST["EstimateDiffer"]) ? $_REQUEST["EstimateDiffer"] : 0;
$estimateSurang = isset($_REQUEST["estimateSurang"]) ? $_REQUEST["estimateSurang"] : 0;
$EstimateDiscountRate = isset($_REQUEST["EstimateDiscountRate"]) ? $_REQUEST["EstimateDiscountRate"] : '';
$EstimateDiscount = isset($_REQUEST["EstimateDiscount"]) ? $_REQUEST["EstimateDiscount"] : 0;
$EstimateFinalSum = isset($_REQUEST["EstimateFinalSum"]) ? $_REQUEST["EstimateFinalSum"] : 0;

$pjnum = isset($_REQUEST['pjnum']) ? $_REQUEST['pjnum'] : '';
$major_category = isset($_REQUEST['major_category']) ? $_REQUEST['major_category'] : '';
$position = isset($_REQUEST['position']) ? $_REQUEST['position'] : '';
$makeWidth = isset($_REQUEST['makeWidth']) ? $_REQUEST['makeWidth'] : '';
$makeHeight = isset($_REQUEST['makeHeight']) ? $_REQUEST['makeHeight'] : '';
$maguriWing = isset($_REQUEST['maguriWing']) ? $_REQUEST['maguriWing'] : '';
$inspectionFee = isset($_REQUEST['inspectionFee']) ? $_REQUEST['inspectionFee'] : 50000;
$accountDate = isset($_REQUEST['accountDate']) ? $_REQUEST['accountDate'] : date('Y-m-d');
$accountList = isset($_REQUEST['accountList']) ? $_REQUEST['accountList'] : '{}';
$ET_unapproved = isset($_REQUEST['ET_unapproved']) ? $_REQUEST['ET_unapproved'] : 0; // 견적 비인정 금액
$ET_total = isset($_REQUEST['ET_total']) ? $_REQUEST['ET_total'] : 0; // 견적 총 금액
$estimate_num = isset($_REQUEST['estimate_num']) ? $_REQUEST['estimate_num'] : ''; // 견적서 번호
$devMode = $_REQUEST['devMode'] ?? '' ; // 개발자모드
$displayText = $_REQUEST['displayText'] ?? '' ; // 발주서 출고증등 표시할 텍스트

// 주자재 부자재 체크 추가요청 25/06/29
$slatcheck = isset($_REQUEST['slatcheck']) ? $_REQUEST['slatcheck'] : '';
$partscheck = isset($_REQUEST['partscheck']) ? $_REQUEST['partscheck'] : '';
$requestBendingASSY = isset($_REQUEST['requestBendingASSY']) ? $_REQUEST['requestBendingASSY'] : '';
?>