# 報價單>年季度>建立報價單 * 檢查 ``` 3.1 檢查若勾選項次的”報價單號”已有值,則該筆建立失敗,錯誤訊息: msg.467。 ``` * Insert Table(同[報價單>新增>暫存](https://hackmd.io/8fXkdHvwTYmL8WPJsjYbRw)) - [ ] 6.1.1 INSERT ebl_quote,見附表八。 - [ ] 6.1.2 INSERT ebl_quote_location,見附表九。 - [ ] 6.1.3 INSERT ebl_quote_fee_part,附表十。 - [ ] 6.1.4 INSERT ebl_quote_fee_part_range,見附表十一。 - [ ] 6.1.5 INSERT file_archive,見附表十二。 - [ ] 6.1.6 UPDATE ebl_rfq2_vs_lsp WHERE company_id = ? AND lsp_id = ? AND rfq_id = ? AND negotiation_times = ? AND location_item = ?,見附表十三ebl_quote.rfq_id有值才要執行。 * Input ``` { // 基本資料 basicData: { companyId, quoteId, module shipBy, seaType, area, site, lspQuoteId, oaDays, fscSscCharges, rfqId, quoteType, quoteStatus, quoteEffectiveDate, quoteExpireDate, quoteDate, quoteWho, quoteWhoPhone, quoteWhoEmail, remark, attachment: [{ "fileName": "測試大小-61718.js", "key": 81068, "path": "/opt/toplogis_app/ebilling_file/C0107/ebilling/20230417/測試大小-61718.js", "trackingNo1": null, "attType": "OTH", "companyId": "C0107", "createWho": "sourcer", "createDate": "2023-04-17T17:16:03Z", "fileNum": 81068 }] } //報價項目 //有勾選的航線 quoteItems: [{ locationItem, feeId, feePartId, quoteProcess, importStatus, fromLocation, fromLocationType, toLocation, toLocationType, fromCountry, toCountry, fromArea, toArea, lspRole, fromCountryPort: ebl_port_group.country_id+port_id, toCountryPort: ebl_port_group.country_id+port_id, containerYard, containerYardType, transMode, loadingPort, dischargePort, incoterms, forecastWeight, forecastWeightUnit, forecastWeightRange, forecastCtr, forecastCtrUnit, forecastCtrRange, forecastShipments, forecastShipmentsRange, quoteId, quoteStatus, }], } ``` * Output ``` // 使用 APIResult { success: 0, // 可不用塞 successMsg: [ { msg: 'msg.141', // {successCount} 筆成功,{failedCount} 筆失敗! params: {} }, ], fail: 0, // 可不用塞 failMsg: [] } ```