Exemplo n.º 1
0
    public GCMRateQuote GetRateFromUSF()
    {
        GCMRateQuote gcmRateQuote = new GCMRateQuote();

        GetResultObjectFromUSFReddaway(ref gcmRateQuote);

        bool isSpc = false;

        if (acctInfo.acctNum.Equals("0875353"))
        {
            isSpc = true;
        }

        double overlengthFee = 0.0;

        overlengthFee = HelperFuncs.getUSF_OverlengthFee(ref quoteData.m_lPiece);

        gcmRateQuote.TotalPrice += overlengthFee;

        //DB.Log("USF overlength fee", overlengthFee.ToString());

        // Get Overlenth Fee
        //HelperFuncs.GetOverlengthFee(ref quoteData.m_lPiece, ref overlengthFee, 96, 216, 288, 100, 150, 200);

        /*
         * 8-12 feet   96 to  144         $120
         * 12-16 feet  144 to 192      $300
         * 16-20 feet   192 to 240        $600
         * 20 feet plus   240+     $1200
         */

        #region Accessorials additions

        if (gcmRateQuote != null && gcmRateQuote.TotalPrice > 0)
        {
            if (quoteData.AccessorialsObj.LGPU)
            {
                if (isSpc.Equals(true))
                {
                    gcmRateQuote.TotalPrice += 50;
                }
                else
                {
                    gcmRateQuote.TotalPrice += 65;
                }
            }

            if (quoteData.AccessorialsObj.LGDEL)
            {
                if (isSpc.Equals(true))
                {
                    gcmRateQuote.TotalPrice += 50;
                }
                else
                {
                    gcmRateQuote.TotalPrice += 65;
                }
            }

            if (quoteData.AccessorialsObj.INSDEL)
            {
                gcmRateQuote.TotalPrice += 55;
            }

            if (quoteData.AccessorialsObj.APTPU)
            {
                if (isSpc.Equals(false))
                {
                    gcmRateQuote.TotalPrice += 15;
                }
            }

            if (quoteData.AccessorialsObj.APTDEL)
            {
                if (isSpc.Equals(false))
                {
                    gcmRateQuote.TotalPrice += 15;
                }
            }
        }

        //DB.Log("USFReddawayPrepaid gcmRateQuote.TotalPrice after", gcmRateQuote.TotalPrice.ToString());

        double totalShipWeight = quoteData.totalWeight;

        //DB.Log("USFReddawayPrepaid totalShipWeight", quoteData.totalWeight.ToString());

        //for (int i = 0; i < lineItems.Length; i++)
        //{
        //    totalShipWeight += lineItems[i].Weight;
        //}


        if (quoteData.AccessorialsObj.RESDEL || quoteData.AccessorialsObj.CONDEL)
        {
            double resDelCharge = (totalShipWeight / 100) * 7.2;
            if (resDelCharge < 130)
            {
                gcmRateQuote.TotalPrice += 130;
            }
            else
            {
                gcmRateQuote.TotalPrice += resDelCharge;
            }
        }
        if (quoteData.AccessorialsObj.RESPU || quoteData.AccessorialsObj.CONPU)
        {
            double resPickCharge = (totalShipWeight / 100) * 7.2;
            if (resPickCharge < 130)
            {
                gcmRateQuote.TotalPrice += 130;
            }
            else
            {
                gcmRateQuote.TotalPrice += resPickCharge;
            }
        }

        if (quoteData.isHazmat.Equals(true))
        {
            gcmRateQuote.TotalPrice += 20.5;
        }

        #endregion

        return(gcmRateQuote);
    }