# 報價單>新增>暫存
* Insert Table
- [ ] 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有值才要執行。
- [ ] 6.1.7 若(ebl_quote.quote_type = 'SPE' AND module = 'EXP') AND (exp_shipment WHERE company_id = ? AND shipment_id = $ebl_quote.shipment_id 資料存在),則INSERT/UPDATE exp_ship_instruction_plan,見附表十四,檢查exp_ship_instruction_plan WHERE company_id = ? AND shipment_id = ? AND flight_no = $ebl_quote.NVL(flight_no, voyage_no) AND lsp_id = $ebl_quote.lsp_id,若資料不存在,則INSERT,否則UPDATE。
- [ ] 6.1.8 若(ebl_quote.quote_type = 'SPE' AND module = 'IMP') AND (pre_shipment WHERE company_id = ? AND pre_shipment_id = $ebl_quote.pre_shipment_id 資料存在),則INSERT/UPDATE pre_shipment_plan,見附表十五,檢查pre_shipment_plan WHERE company_id = ? AND pre_shipment_id = ? AND flight_no = $ebl_quote.NVL(flight_no, voyage_no) AND lsp_id = $ebl_quote.lsp_id,若資料不存在,則INSERT,否則UPDATE。
* Input
```
// 不包含費用項目、路線、路線.費用
{
// 基本資料
basicData: {
companyId,
quoteId,
module
shipBy,
seaType,
area,
site,
lspQuoteId,
oaDays,
fscSscCharges,
rfqId,
quoteType,
quoteStatus,
quoteEffectiveDate,
quoteExpireDate,
quoteDate,
quoteWho,
quoteWhoPhone,
quoteWhoEmail,
remark,
attachment: [{
"id": 0,
"fileName": "測試大小.js",
"key": null,
"path": "/tmp/WresZsu6nj.js",
"percent": 100,
"type": "text/javascript",
"trackingNo1": null,
"attType": null,
"companyId": null,
"createWho": null,
"createDate": null,
"fileNum": null
}]
}
// 新航線與包機才有
// 運送資訊
transportInfo: {
invId,
poId,
trackingNo,
preshipmentId,
shipmentId,
shipToId,
shipToCompany,
supplierId,
supplierName,
carrier,
flightNo,
vesselCompany,
vesselName,
voyageNo,
etd,
eta,
fromPort,
toPort,
hawbId,
urgentId,
charter_fee,
currency,
}
// 年季度跟其他可以一起儲存
location: {
fromLocation,
fromLocationType,
toLocation,
toLocationType,
fromCountry,
toCountry,
fromArea,
toArea,
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,
quoteProcess,
feeQty,
feeCodeQty,
carrier,
vesselCompany,
routeType,
guaranteedSpace,
boeClosingDate,
etd,
eta,
p2pDays,
p2dDays,
remark1,
remark2,
remark3,
quoteId,
quoteStatus,
}
feePart: [
{
item,
isConfirm,
reject_reason,
feePartId,
feeId,
price_range: {報價級距>級距、收費單位},
freeTime,
highSeasonFrom,
highSeasonTo,
forecastQtyTot,
forecastQtyMin,
forecastQtyMax,
weightType,
chargeType,
remark1,
remark2,
remark,
}
]
}
```
* Output
```
// 使用 APIResult
{
success: 0, // 可不用塞
successMsg: [
{
msg: 'msg.030', // 新增成功!
params: {}
},
],
fail: 0, // 可不用塞
failMsg: []
}
```