---
# System prepended metadata

title: 詢價>點擊報價

---

# 詢價>點擊報價
> Reference: \SA-LSP2\SA-DOC\帳務作業\詢價單\LSP2_RFQ_QUOTE, \SA-LSP2\SA-DOC\帳務作業\報價\LSP2_QUOTE_ADD&EDIT
> DataBase Source: PGDB (AUO schema)
> Reference Controller: LspRFQ2Controller.java>line 66(develop)
> Company: C0107
> LSP: F0070

* 資料來源 (\SA-LSP2\SA-DOC\帳務作業\詢價單\LSP2_RFQ_QUERY)
```
SELECT * FROM V_EBL_RFQ2_VS_LSP
 WHERE ((COMPANY_ID = 'C0107') AND (LSP_ID = 'F0070') AND
       (RFQ_STATUS IN ('SUBMITTED', 'ABOLISHED')) AND
       (RFQ_SEND_DATE IS NOT NULL) AND (LOCATION_ITEM = 1))
```
* 檢查
```
1. (ebl_rfq2.rfq_deadline > sysdate)若不成立 → msg.065
2. (ebl_rfq2.rfq_status = 'SUBMITTED')若不成立 → msg.066 (詢價單狀態為 [ {status} ] 不可報價!)
3. SELECT lsp_status
    FROM ebl_rfq2_vs_lsp
     WHERE company_id = 'C0107'
     AND rfq_id = 'R230416274'
     AND negotiation_times = 10
     AND lsp_id = 'F0070'
     AND ROWNUM = 1
     lsp_status = 'ACCEPTED'若不成立 → msg.339
```

# 取得報價資料API
* Input
```
{
    rfqId: 'R230416274',     // 報價單號
    negotiationTimes: 10,    // 議價回合
}
```
* Output
```
// 不包含費用項目、路線、路線.費用
{
    // 基本資料
    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,
        feeIdCount,
        feePartIdCount,
        quoteProcess,
        importStatus,
        importMsg,
        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,
    }],

    // 新航線與包機才有
    // 運送資訊
    transportInfo: {
        invId,
        poId,
        trackingNo,
        preshipmentId,
        shipmentId,
        shipToId,
        shipToCompany,
        supplierId,
        supplierName,
        carrier,
        flightNo,
        vesselCompany,
        vesselName,
        voyageNo,
        etd,
        eta,
        fromPort,
        toPort,
        hawbId,
        urgentId,
        charter_fee,
        currency,
    }
}
```
# 取得報價費用相關API

1. 年季度，取得單一航線費用資料
* Input
```
{
    rfqId: 'R230416274',     // 報價單號
    negotiationTimes: 10,    // 議價回合
    locationItem: 1,         // 路線項次
}
```
* Output
```
{
    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,
    }
    feePart: [
        {
            item,
            isConfirm,
            reject_reason,
            feePartId,
            feeId,
            price_range: {報價級距>級距、收費單位},
            freeTime,
            highSeasonFrom,
            highSeasonTo,
            forecastQtyTot,
            forecastQtyMin,
            forecastQtyMax,
            weightType,
            chargeType,
            remark1,
            remark2,
            remark,
            
        }
    ]
}
```
2. 非年季度，取得全部費用資料
* Input
```
{
    rfqId: 'R230416274',     // 報價單號
    negotiationTimes: 10,    // 議價回合
}
```
* Output
```
{
    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,
            
        }
    ]
}