@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    Layout = "_LooperLayout";
}

@section Style {
    <style type="text/css">
        .cards tbody tr {
            float: left;
            width: 19rem;
            margin: 0.5rem;
            border: 0.0625rem solid rgba(0, 0, 0, .125);
            border-radius: .25rem;
            box-shadow: 0.25rem 0.25rem 0.5rem rgba(0, 0, 0, 0.25);
        }

        .cards tbody td {
            display: block;
        }

        .cards thead {
            display: none;
        }

        .cards td:before {
            content: attr(data-label);
            position: relative;
            float: left;
            color: #808080;
            min-width: 4rem;
            margin-left: 0;
            margin-right: 1rem;
            text-align: left;
        }

        tr.selected td:before {
            color: #CCC;
        }

        .table .avatar {
            width: 50px;
        }

        .cards .avatar {
            width: 150px;
            height: 150px;
            margin: 15px;
        }
    </style>
}
@section Script {
    <script src="~/assets/vendor/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="~/assets/vendor/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="~/assets/vendor/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script>
    <script src="~/assets/javascript/pages/dataTables.bootstrap.js"></script>
    <script src="~/assets/vendor/datepicker/js/bootstrap-datepicker.min.js"></script>
    <script src="~/assets/vendor/datepicker/locales/bootstrap-datepicker.zh-TW.min.js"></script>
    <script src="~/assets/vendor/sortablejs/Sortable.min.js"></script>
    <script src="~/assets/vendor/nestable2/jquery.nestable.min.js"></script>
    <script src="~/assets/javascript/custom/projectlist.js" asp-append-version="true"></script>
}

<!-- .page-inner -->
<div class="page-inner">
    <!-- .page-title-bar -->
    <header class="page-title-bar">
        <!-- .breadcrumb -->
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item active">
                    <a href="#"><i class="breadcrumb-icon fa fa-angle-left mr-2"></i> 專案報價單清單</a>
                </li>
            </ol>
        </nav><!-- /.breadcrumb -->
        <!-- title -->
        <h1 class="page-title"> 專案報價單清單 </h1>
        <p class="text-muted">  </p><!-- /title -->
    </header><!-- /.page-title-bar -->
    
    <div class="page-section">
        <div class="row">
            <div class="col-lg-12">
                <!-- #accordion2 -->
                <div id="accordion1" class="card-expansion">
                    <!-- .card -->
                    <div class="card card-expansion-item">
                        <div class="card-header border-0" id="headingOne1">
                            <button id="adv-search-btn" class="btn btn-reset d-flex justify-content-between w-100" data-toggle="collapse" data-target="#collapseOne1" aria-expanded="true" aria-controls="collapseOne1"><span>進階搜尋</span> <span class="collapse-indicator"><i class="fa fa-fw fa-chevron-down"></i></span></button>
                        </div>

                        <div>
                            <div id="collapseOne1" class="collapse show" aria-labelledby="headingOne1" data-parent="#accordion1">
                                <div class="card-body pt-0">
                                    
                                    <div class="row">
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label class="control-label" for="dateStart">起</label>
                                                <input id="dateStart" type="text" class="form-control flatpickr-input active" data-toggle="flatpickr" data-date-format="m.y" data-monthselect="true" readonly="readonly">
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label class="control-label" for="dateEnd">迄</label>
                                                <input id="dateEnd" type="text" class="form-control flatpickr-input active" data-toggle="flatpickr" data-date-format="m.y" data-monthselect="true" readonly="readonly">
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="dept_select">單位</label>
                                                <select class="custom-select custom-select-sm" id="dept_select" name="dept_select" required="">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="search_btn" style="display: block;">&nbsp; &nbsp;</label>
                                                <button type="button" class="btn btn-info btn-sm" id="search_btn">篩選</button>
                                            </div>
                                        </div>
                                    </div>
                                    
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- .page-section -->
    <div class="page-section">
        <button type="button" id="projectNewBtn" class="btn btn-primary btn-floated" title="Add new client"><i class="fa fa-plus"></i></button>
        <!-- .card -->
        <div class="card card-fluid">
            <!-- .card-body -->
            <div class="card-body">
                <!-- .table -->
                <table id="dt-responsive" class="table dt-responsive nowrap w-100">
                    <thead>
                        <tr>
                            <th> 專案建立時間 </th>
                            <th> 專案名稱 </th>
                            <th> 客戶公司 </th>
                            <th> 備註 </th>
                            <th>  </th>
                        </tr>
                    </thead>

                </table><!-- /.table -->
            </div><!-- /.card-body -->
        </div><!-- /.card -->
    </div><!-- /.page-section -->
</div><!-- /.page-inner -->
<!-- Keep in mind that modals should be placed outsite of page sidebar -->
<!-- .modal -->
<form id="clientProjectForm" name="clientProjectForm">
    <div class="modal fade" id="clientProjectModal" tabindex="-1" role="dialog" aria-labelledby="clientProjectModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog modal-lg" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="clientProjectModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">Client name</span> <input id="modelTitle" type="text" class="form-control form-control-lg" placeholder="專案資料維護" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="project_method" />
                    <input type="hidden" id="project_uid" />
                    <!-- .form-row -->
                    <div class="form-row">

                        <div class="col-md-12" id="project_name_div">
                            <div class="form-group">
                                <label for="project_name">專案名稱</label> <input type="text" id="project_name" maxlength="60" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-12" id="prm_project_serial">
                            <!-- .form-group -->
                            <div class="form-group">
                                <label class="control-label" for="company_select">客戶公司</label> <select id="company_select" class="form-control">
                                </select>
                            </div><!-- /.form-group -->
                            
                        </div>
                      
                        <div class="col-md-12" id="project_year_month_div">
                            <div class="form-group">
                                <label for="project_ps">備註</label> <input type="text" id="project_ps" maxlength="32" class="form-control">
                            </div>
                        </div>
                        
                        

                    </div><!-- /.form-row -->

                    
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="projectSaveBtn" class="btn btn-primary">儲存</button> <button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal">關閉</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!-- .modal -->
<form id="clientQuotationListForm" name="clientQuotationListForm">
    <div class="modal fade" id="clientQuotationListModal" tabindex="-1" role="dialog" aria-labelledby="clientQuotationListModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog modal-lg" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="clientNewModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">報價單列表</span> <input id="QuotationTitle" type="text" class="form-control form-control-lg" placeholder="報價單目列表" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="quotation_project_uid" />
                    <input type="hidden" id="quotation_company_uid" />
                    <!-- .page-section -->
                    <div class="page-section">
                        <button type="button" id="QuotationListNewBtn" class="btn btn-primary btn-floated position-absolute" title="Add new client"><i class="fa fa-plus"></i></button>
                        
                        <div class="section-block">
                            <div class="col-lg-12">
                                <div id="project_info_div" class="alert alert-info" role="alert">
                                    專案名稱:
                                    客戶名稱:
                                </div>
                            </div>
                        </div>
                        <!-- .card -->
                        <div class="card card-fluid">
                            <!-- .card-body -->
                            <div class="card-body">
                                <!-- .table -->
                                <table id="dt-responsive-quotation" class="table dt-responsive nowrap w-100">
                                    <thead>
                                        <tr>
                                            <th> 報價單名稱 </th>
                                            <th> 異動時間 </th>
                                            <th> 窗口 </th>
                                            <th style="width: 30px;">  </th>
                                        </tr>
                                    </thead>

                                </table><!-- /.table -->
                            </div><!-- /.card-body -->
                        </div><!-- /.card -->
                    </div><!-- /.page-section -->
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="QuotationSaveBtn" style="visibility:hidden;" class="btn btn-primary">儲存</button> <button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal">關閉</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->
<!--歷史版本-->
<!-- .modal -->
<form id="clientHistoryListForm" name="clientHistoryListForm">
    <div class="modal fade" id="clientHistoryListModal" tabindex="-1" role="dialog" aria-labelledby="clientHistoryListModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog modal-lg" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="clientNewModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">歷史異動列表</span> <input id="HistoryTitle" type="text" class="form-control form-control-lg" placeholder="歷史異動列表" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="now_version" />
                    <!-- .page-section -->
                    <div class="page-section">

                        <!-- .card -->
                        <div class="card card-fluid">
                            <!-- .card-body -->
                            <div class="card-body">
                                <!-- .table -->
                                <table id="dt-responsive-history" class="table dt-responsive nowrap w-100">
                                    <thead>
                                        <tr>
                                            <th style="width: 100px;">  </th>
                                            <th> 建立日期 </th>
                                            <th> 報價單名稱 </th>
                                            <th> 版本號 </th>
                                        </tr>
                                    </thead>

                                </table><!-- /.table -->
                            </div><!-- /.card-body -->
                        </div><!-- /.card -->
                    </div><!-- /.page-section -->
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal">關閉</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!-- .modal -->
<form id="clientModelQuotationForm" name="clientModelQuotationForm">
    <div class="modal fade" id="clientModelQuotationModal" tabindex="-1" role="dialog" aria-labelledby="clientModelQuotationModalLabel" data-backdrop="static" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog modal-xl" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="quotationModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">報價單內容</span> <input id="quotationTitle_name" type="text" class="form-control form-control-lg" value="" placeholder="報價單內容" readonly="readonly" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="quotation_method" />
                    <input type="hidden" id="quotation_uid" />
                    <input type="hidden" id="quotation_version" />
                    <!-- .form-group -->
                    <div class="form-group" id="quotation_editType_div">
                        <label>報價單編輯方式 (儲存後無法變更)</label>
                        <div class="custom-control custom-radio mb-1">
                            <input type="radio" class="custom-control-input" name="rdGroup3" id="quotation_custom" checked> <label class="custom-control-label" for="quotation_custom">自訂</label>
                        </div>
                        <div class="custom-control custom-radio mb-1">
                            <input type="radio" class="custom-control-input" name="rdGroup3" id="quotation_temp"> <label class="custom-control-label" for="quotation_temp">範本</label>
                            <div class="custom-control-hint">
                                <div class="form-row">
                                    <div class="col-md-4">
                                        <div class="form-group">
                                            <label for="modelProject_select">類型</label>
                                            <select class="custom-select custom-select-sm" id="modelProject_select" name="modelProject_select" required="">
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label for="modelQuotation_select">範本</label>
                                            <select class="custom-select custom-select-sm" id="modelQuotation_select" name="modelQuotation_select" required="">
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-2">
                                        <div class="form-group">
                                            <label for="search_btn" style="display: block;">&nbsp; &nbsp;</label>
                                            <button type="button" class="btn btn-info btn-sm" id="applyTemp_btn">套用範本</button>
                                        </div>
                                    </div>
                                </div>
                                
                                
                            </div>
                        </div>
                    </div><!-- /.form-group -->
                    
                    <!-- .form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input id="quotation_date" type="text" class="form-control flatpickr-input" data-toggle="flatpickr" data-date-format="Y/m/d" readonly="readonly" placeholder="報價日期"><label for="quotation_date">報價日期</label>
                            <input type="hidden" id="quotation_date_old" />
                        </div>
                    </div><!-- /.form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input id="quotation_range" type="text" class="form-control flatpickr-input active" data-toggle="flatpickr" data-mode="range" data-date-format="Y/m/d" data-default-dates="['today', 'today']" readonly="readonly" placeholder="報價單有效期限">
                            <label for="quotation_range">報價單有效期限</label>
                            <input type="hidden" id="quotation_expStart" />
                            <input type="hidden" id="quotation_expEnd" />
                            <input type="hidden" id="quotation_expStart_old" />
                            <input type="hidden" id="quotation_expEnd_old" />
                        </div>
                    </div>
                    <!-- .form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="quotation_name" class="form-control" value="" placeholder="報價單名稱" maxlength="85" required=""> <label for="quotation_name">報價單名稱</label>
                            <input type="hidden" id="quotation_name_old" />
                        </div>
                    </div><!-- /.form-group -->
                    <div class="form-group">
                        <label for="contactPerson_uid">窗口</label>
                        <select class="custom-select custom-select-sm" id="contactPerson_uid" name="contactPerson_uid" required="">
                        </select>
                        <input type="hidden" id="contactPerson_uid_old" />
                    </div>
                    <!-- grid row -->
                    <div id="quotatiion_div" class="row">
                        <div id="modelItem_div" class="col-lg-12">
                        </div>
                        <div class="card-body border-top">
                            <button id="addModelMainItemBtn" type="button" class="btn btn-primary btn-lg btn-block">新增工作主項目</button>
                        </div>


                        
                    </div>
                    <!-- .form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="quotation_noTaxTotal" class="form-control" value="" placeholder="專案總價" maxlength="16" required="" readonly="readonly" /> <label for="quotation_noTaxTotal">專案總價</label>
                            <input type="hidden" id="quotation_noTaxTotal_old" />
                        </div>
                    </div><!-- /.form-group -->
                    <!-- .form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="quotation_specTotal" class="form-control" value="" placeholder="專案優惠總價" maxlength="14" required="" /> <label for="quotation_specTotal">專案優惠總價</label>
                            <input type="hidden" id="quotation_specTotal_old" />
                        </div>
                    </div><!-- /.form-group -->
                    <!-- .form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="quotation_tax" class="form-control" value="" placeholder="加值營業稅 VAT (5%)" maxlength="12" required="" /> <label for="quotation_tax">加值營業稅 VAT (5%)</label>
                            <input type="hidden" id="quotation_tax_old" />
                        </div>
                    </div><!-- /.form-group -->
                    <!-- .form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="quotation_grandTotal" class="form-control" value="" placeholder="總計 Grand Total" maxlength="15" required="" /> <label for="quotation_grandTotal">總計 Grand Total</label>
                            <input type="hidden" id="quotation_grandTotal_old" />
                        </div>
                    </div><!-- /.form-group -->
                    <div class="form-group">
                        <label for="quotation_sa">製作及維護服務協議條款 (##客戶公司## 與 ##我們公司## 這兩串文字請勿異動) </label>
                        <textarea class="form-control" id="quotation_sa" rows="6" placeholder="製作及維護服務協議條款"></textarea>
                        <textarea class="form-control" id="quotation_sa_old" rows="6" style="display:none;" placeholder="製作及維護服務協議條款"></textarea>
                    </div>
                    <!-- grid row -->
                    <div id="payment_div" class="row">
                        <!-- grid column -->
                        <div class="col-lg-12">
                            <!-- .card -->
                            <div class="card card-fluid">
                                <div class="card-header border-bottom-0"> 付款方式 </div><!-- .nestable -->
                                <div id="payment_group" class="dd" data-toggle="sortable" data-max-depth="1" data-type="payment_group">
                                    <!-- .dd-list -->
                                    <ol class="dd-list">
                                    </ol><!-- /.dd-list -->
                                </div><!-- /.nestable -->
                                <!-- .card-footer -->
                                <div class="card-footer">
                                    <a href="javascript: void(0);" id="addPaymentBtn" data-type="addPayment" class="card-footer-item justify-content-start"><span><i class="fa fa-plus-circle mr-1"></i> 新增付款方式</span></a>
                                </div><!-- /.card-footer -->
                            </div><!-- /.card -->
                        </div><!-- /grid column -->
                    </div>
                    <!-- grid row -->
                    <div id="invoice_div" class="row">
                        <!-- grid column -->
                        <div class="col-lg-12">
                            <!-- .card -->
                            <div class="card card-fluid">
                                <div class="card-header border-bottom-0"> 發票開立品項 </div><!-- .nestable -->
                                <div id="invoice_group" class="dd" data-toggle="sortable" data-max-depth="1" data-type="payment_group">
                                    <!-- .dd-list -->
                                    <ol class="dd-list">
                                    </ol><!-- /.dd-list -->
                                </div><!-- /.nestable -->
                                <!-- .card-footer -->
                                <div class="card-footer">
                                    <a href="javascript: void(0);" id="addInvoiceBtn" data-type="addInvoice" class="card-footer-item justify-content-start"><span><i class="fa fa-plus-circle mr-1"></i> 新增發票 </span></a>
                                </div><!-- /.card-footer -->
                            </div><!-- /.card -->
                        </div><!-- /grid column -->
                    </div>
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="modelQuotationDialogSaveBtn" class="btn btn-primary">Save</button><button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->


<!--主項目-->
<!-- .modal -->
<form id="clientModelMainItemForm" name="clientModelMainItemForm">
    <div class="modal fade" id="modelMainItemModal" tabindex="-1" role="dialog" aria-labelledby="modelMainItemModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="modelMainItemModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">主項目</span> <input id="group_mainitem" type="text" class="form-control form-control-lg" value="" placeholder="主項目" readonly="readonly" required="">
                    </h6>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="modelMainItem_method" />
                    <input type="hidden" id="modelMainItem_uid" />
                    <input type="hidden" id="parent_mainItem_uid" />

                    <!-- .form-group -->
                    <div class="form-group">
                        <label class="control-label" for="modelMainItem_name">主項目名稱</label> <input id="modelMainItem_name" maxlength="32" type="text" class="form-control" />
                    </div><!-- /.form-group -->
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="modelMainItem_ac" class="form-control" value="0" placeholder="AC" maxlength="5" required=""> <label for="modelSubItem_number">AC (輸入10代表 10% AC)</label>
                        </div>
                    </div>

                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="modelMainItemDialogSaveBtn" class="btn btn-primary">Save</button> <button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!--子項目-->
<!-- .modal -->
<form id="clientModelSubItemForm" name="clientModelSubItemForm">
    <div class="modal fade" id="modelSubItemModal" tabindex="-1" role="dialog" aria-labelledby="modelSubItemModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="modelSubItemModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">次項目</span> <input id="group_Subitem" type="text" class="form-control form-control-lg" value="" placeholder="次項目" readonly="readonly" required="">
                    </h6>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="modelSubItem_method" />
                    <input type="hidden" id="modelSubItem_uid" />
                    <input type="hidden" id="parent_Item_uid" />
                    <input type="hidden" id="model_parent_data_uid" />
                    <!-- .form-group -->
                    <div class="form-group">
                        <label class="control-label" for="modelSubItem_name">次項目名稱</label> <input id="modelSubItem_name" maxlength="32" type="text" class="form-control" />
                    </div><!-- /.form-group -->
                    <div class="form-group">
                        <label for="tf6">製作說明</label>
                        <textarea class="form-control" id="modelSubItem_descript" rows="5"></textarea>
                    </div>
                    <div class="form-group">
                        <label for="modal_subItem_price">單價</label> <!-- .input-group -->
                        <div class="input-group">
                            <label class="input-group-prepend" for="modelSubItem_price"><span class="badge">$</span></label> <input type="text" class="form-control" maxlength="8" id="modelSubItem_price">
                        </div><!-- /.input-group -->
                    </div>
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="modelSubItem_unitType" class="form-control" value="" placeholder="單位" maxlength="6" required=""> <label for="modelSubItem_unitType">單位</label>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="modelSubItem_number" class="form-control" value="" placeholder="數量" maxlength="10" required=""> <label for="modelSubItem_number">數量</label>
                        </div>
                    </div>
                    <!-- .list-group-item -->
                    <div class="list-group-item d-flex justify-content-between align-items-center">
                        <span>是否加上AC</span> <!-- .switcher-control -->
                        <label class="switcher-control switcher-control-lg"><input type="checkbox" id="modelSubItem_hasAC" class="switcher-input"> <span class="switcher-indicator"></span> <span class="switcher-label-on">是</span> <span class="switcher-label-off">否</span></label> <!-- /.switcher-control -->
                    </div><!-- /.list-group-item -->
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="modelSubItemDialogSaveBtn" class="btn btn-primary">Save</button> <button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!--付款方式-->
<!-- .modal -->
<form id="clientModelPaymentForm" name="clientModelPaymentForm">
    <div class="modal fade" id="paymentModal" tabindex="-1" role="dialog" aria-labelledby="modelPaymentModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="modelMainItemModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">付款方式</span> <input id="group_Payment" type="text" class="form-control form-control-lg" value="" placeholder="付款方式" readonly="readonly" required="">
                    </h6>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="payment_method" />
                    <input type="hidden" id="payment_uid" />

                    <div class="form-group">
                        <label for="paymentMethod_select">單位</label>
                        <select class="custom-select custom-select-sm" id="paymentMethod_select" name="paymentMethod_select" required="">
                            <option value="">請選擇</option>
                            <option value="cheque">支票</option>
                            <option value="telegraphic">電匯</option>
                            <option value="paycash">一次付清</option>
                            <option value="downpayment">頭期款</option>
                            <option value="lastpayment">尾款</option>
                            <option value="custom">手動輸入</option>

                        </select>
                    </div>
                    <div class="form-group">
                        <div class="form-label-group">
                            <input type="text" id="payment_descript" class="form-control" value="" placeholder="付款說明" maxlength="90" required=""> <label for="payment_descript">付款說明</label>
                        </div>
                    </div>

                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="paymentModalDialogSaveBtn" class="btn btn-primary">Save</button> <button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!--發票開立品項-->
<!-- .modal -->
<form id="clientModelInvoiceForm" name="clientModelInvoiceForm">
    <div class="modal fade" id="invoiceModal" tabindex="-1" role="dialog" aria-labelledby="modelInvoiceModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="modelInvoiceModalLabel" class="modal-title inline-editable">
                        <span class="sr-only">發票開立品項</span> <input id="group_Invoice" type="text" class="form-control form-control-lg" value="" placeholder="發票開立品項" readonly="readonly" required="">
                    </h6>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="invoice_method" />
                    <input type="hidden" id="invoice_uid" />

                    <!-- .form-group -->
                    <div class="form-group">
                        <label class="control-label" for="invoice_name">品項</label> <input id="invoice_name" maxlength="32" type="text" class="form-control" />
                    </div><!-- /.form-group -->

                    <div class="form-group">
                        <label for="invoice_type">發票月份樣式</label> <select id="invoice_type" class="custom-select d-block w-100">
                            <option value="date"> 日期 </option>
                            <option value="text"> 文字敘述 </option>
                        </select>
                    </div>

                    <div class="form-group" id="invoice_type_date">
                        <label class="control-label" for="invoice_date">發票開立月份</label>
                        <input id="invoice_date" type="text" class="form-control flatpickr-input active" data-toggle="flatpickr" data-date-format="m.y" data-monthselect="true" readonly="readonly">
                    </div>

                    <!-- .form-group -->
                    <div class="form-group" id="invoice_type_text">
                        <label class="control-label" for="invoice_text">發票開立時間說明</label> <input id="invoice_text" maxlength="20" type="text" class="form-control" />
                    </div><!-- /.form-group -->

                    <!-- .form-group -->
                    <div class="form-group">
                        <label class="control-label" for="invoice_noTaxMoney">開立金額(未稅)</label> <input id="invoice_noTaxMoney" maxlength="12" type="text" class="form-control" />
                    </div><!-- /.form-group -->
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="invoiceModalDialogSaveBtn" class="btn btn-primary">Save</button> <button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!--另存到此專案-->
<!-- .modal -->
<form id="clientSavetosameForm" name="clientSavetosameForm">
    <div class="modal fade" id="clientSaveToSameModal" tabindex="-1" role="dialog" aria-labelledby="clientSaveToSameModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="clientProjectModalLabel" class="modal-title inline-editable">
                        <span class="sr-only"></span> <input id="modelSaveToSameTitle" type="text" class="form-control form-control-lg" placeholder="另存為新報價單至此專案" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="save_to_same_quotation_uid" />
                    <input type="hidden" id="save_to_same_quotation_version" />
                    <div class="form-label-group">
                        <input type="text" id="save_to_same_quotation_name" class="form-control" value="" placeholder="新報價單名稱" maxlength="45" required=""> <label for="save_to_same_quotation_name">新報價單名稱</label>
                    </div>
                    
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="save_to_same_SaveBtn" class="btn btn-primary">儲存</button> <button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal">關閉</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!--另存到別專案-->
<!-- .modal -->
<form id="clientSavetootherForm" name="clientSavetootherForm">
    <div class="modal fade" id="clientSaveToOtherModal" tabindex="-1" role="dialog" aria-labelledby="clientSaveToOtherModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="clientProjectModalLabel" class="modal-title inline-editable">
                        <span class="sr-only"></span> <input id="modelSaveToOtherTitle" type="text" class="form-control form-control-lg" placeholder="另存為新報價單至其他專案" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="save_to_other_quotation_uid" />
                    <input type="hidden" id="save_to_other_quotation_version" />
                    <div class="form-label-group">
                        <input type="text" id="save_to_other_quotation_name" class="form-control" value="" placeholder="新報價單名稱" maxlength="45" required=""> <label for="save_to_other_quotation_name">新報價單名稱</label>
                    </div>
                    <br />
                    <div class="form-group">
                        <label for="project_select">專案名稱</label>
                        <select class="custom-select custom-select-sm" id="project_select" name="project_select" required="">
                        </select>
                    </div>
                    
                    <div class="form-group">
                        <label for="contactPerson_select">窗口</label>
                        <select class="custom-select custom-select-sm" id="contactPerson_select" name="contactPerson_select" required="">
                        </select>
                    </div>
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="save_to_other_SaveBtn" class="btn btn-primary">儲存</button> <button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal">關閉</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->

<!--另存到新專案-->
<!-- .modal -->
<form id="clientSavetonewForm" name="clientSavetonewForm">
    <div class="modal fade" id="clientSaveToNewModal" tabindex="-1" role="dialog" aria-labelledby="clientSaveToNewModalLabel" data-backdrop="static"
         data-keyboard="false" aria-hidden="true">
        <!-- .modal-dialog -->
        <div class="modal-dialog" role="document">
            <!-- .modal-content -->
            <div class="modal-content">
                <!-- .modal-header -->
                <div class="modal-header">
                    <h6 id="clientProjectModalLabel" class="modal-title inline-editable">
                        <span class="sr-only"></span> <input id="modelSaveToNewTitle" type="text" class="form-control form-control-lg" placeholder="另存為新報價單至新專案" required="">
                    </h6>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                </div><!-- /.modal-header -->
                <!-- .modal-body -->
                <div class="modal-body">
                    <input type="hidden" id="save_to_new_quotation_uid" />
                    <input type="hidden" id="save_to_new_quotation_version" />
                    <div class="form-label-group">
                        <input type="text" id="save_to_new_quotation_name" class="form-control" value="" placeholder="新報價單名稱" maxlength="45" required=""> <label for="save_to_other_quotation_name">新報價單名稱</label>
                    </div>
                    <br/>
                    <div class="form-label-group">
                        <input type="text" id="save_to_new_project_name" class="form-control" value="" placeholder="新專案名稱" maxlength="45" required=""> <label for="save_to_other_quotation_name">新專案名稱</label>
                    </div>
                    <br />
                    <div class="form-group">
                        <label for="project_select">客戶公司</label>
                        <select class="custom-select custom-select-sm" id="company_new_select" name="company_new_select" required="">
                        </select>
                    </div>

                    <div class="form-group">
                        <label for="contactPerson_select">窗口</label>
                        <select class="custom-select custom-select-sm" id="contactPerson_new_select" name="contactPerson_new_select" required="">
                        </select>
                    </div>
                </div><!-- /.modal-body -->
                <!-- .modal-footer -->
                <div class="modal-footer">
                    <button type="button" id="save_to_new_SaveBtn" class="btn btn-primary">儲存</button> <button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal">關閉</button>
                </div><!-- /.modal-footer -->
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</form><!-- /.modal -->