Calculateur de poids facturable

Calculez le poids facturable de vos expéditions de fret, tous modes, transporteurs et pays confondus, avec la calculatrice ci-dessous.

Obtenez une estimation

<style>.chargeable-weight-calculator .inner-container { box-shadow: 0px 4px 12px -3px rgba(0, 0, 0, 0.05), 0px 2px 5px 0px rgba(0, 0, 0, 0.14); padding: 24px; } .chargeable-weight-calculator .category-selection { display: flex; position: relative; align-items: baseline; gap: 4px; } input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } input[type="number"] { -moz-appearance: textfield; } h2.mode-selection-label, h2.category-label { font-size: 20px; font-weight: 500; margin-bottom: 15px; } .ups-checkbox-group label:before, .ups-radio-group label:before { content: ""; width: 1.5rem; height: 1.5rem; position: absolute; border: 0.0625rem solid #5f5753; background-color: #fff; left: 0; } .ups-radio-group .ups-radio-custom-label:before { border-radius: 50%; } .chargeable-weight-calculator .ups-radio-group label { display: flex; padding-left: 2rem; position: relative; } .chargeable-weight-calculator .ups-radio-group label .mode-label { width: 90%; } .chargeable-weight-calculator .ups-radio-group .ups-radio-custom:checked+label:before { border: 8px solid #0662BB; } .category-selection .category-btn-grp { display: flex; border: 1px solid #0662BB; border-radius: 30px; padding: 11px 2px; height: 48px; cursor: pointer; list-style-type: none; margin: 0; margin-bottom: 1rem; } .category-btn { border: none; border-radius: 30px; padding: 10px; background: transparent; font-weight: 400; color: #5f5753; } .category-active { color: #fff !important; background: #0662BB !important; } .chargeable-weight-calculator .mode-selection .radio-container .ups-form_group.ups-radio-group { flex-direction: row; } .mode-selection-container { margin-bottom: 50px; } .mode-selection { max-width: 24%; width: 100%; box-shadow: 0 3px 6px #00000029; padding: 15px 10px; border: 2px solid transparent; border-radius: 4px; font-family: 'UPSROBOTO'; font-weight: 500; } .mode-selection:has(input:checked) { border: 2px solid #0662BB; } .chargeable-weight-calculator .radio-container .ups-form_group.ups-radio-group { display: flex; flex-direction: row; gap: 1rem; } .radio-container .ups-form_group .ups-buttonList_wrapper label p { margin-bottom: 0; } .chargeable-weight-calculator .package-details { display: flex; position: relative; gap: 20px; } .chargeable-weight-calculator .package-details.errorMargin { margin-bottom: 30px; } .chargeable-weight-calculator .package-details .dropdown-container { max-width: 160px; width: 100%; } .chargeable-weight-calculator ul.input-controls-container { list-style-type: none; display: flex; padding-left: 0; gap: 8px; margin: 0; } .close-package-details.icon.ups-icon-close { position: absolute; right: -20px; top: 15px; cursor: pointer; } .scn-cta-preicon { border: 2px solid; padding: 0px 5px; border-radius: 50%; } .scn-cta-preicon:hover { text-decoration: none; } ul.result-calculation { list-style-type: none; display: flex; background: #f2f1ef; padding: 20px; margin-top: 2rem; border-radius: 4px; } li.value { width: 25%; } .value p { font-size: 16px; color: #5f5753; font-weight: 500; } .value h4 { font-size: 32px; font-weight: 400; color: #000; } .cargo-details, .shipment-details { display: none; width: 100%; } .is-visible { display: block !important; } .error-msg { color: #df2901; font-size: 14px; font-weight: 500; margin: 5px 0; display: none; } .chargeable-weight-calculator .ups-component.promo-teaser { padding-top: 1rem; padding-bottom: 1rem; } .disclaimer { margin-top: 10px; color: #757575; line-height: 16px; } .cross-icon { font-size: 12px; padding: 18px 0; } .ups-input_wrapper.ups-buttonList_wrapper.mode-selection { position: relative; font-family: 'roboto'; } input.ups-radio-custom { position: absolute; } .ups-form_group { position: relative; margin-bottom: 1rem; } .ups-form_group.ups-dropdown-control { position: relative; } .ups-dropdown-control label.ups-form_label { position: absolute; top: 0.125rem; font-size: 0.75rem; font-weight: 500; padding: 0; left: 0.75rem; color: #5f5753; z-index: 5; line-height: 1.5rem; } select.ups-dropdown { padding: 1.5rem 2rem 0.5rem 0.75rem; } .banner-wrapper { display: flex; background-image: linear-gradient(304.78deg, #326a9f -12.16%, #397ab7 61.1%); color: #fff; padding: 1.5rem 4rem; align-items: center; gap: 2rem; } .banner-header h2 { font-size: 2rem; } .banner-btn { width: 25%; text-align: right; } .ups-form_group.ups-input .ups-input_wrapper input { padding: 1.5rem 2rem 0.5rem 0.75rem; background: transparent; } .ups-form_group.ups-input .ups-input_wrapper label { position: absolute; color: var(--gray-1); inset-inline-start: .5rem; top: 2rem; transform: translateY(-50%); transition: all .3s; z-index: -1; } .ups-form_group.ups-input .ups-input_wrapper input:focus+label, .ups-form_group.ups-input .ups-input_wrapper input.has-value+label { top: .25rem; transform: none; font-size: .75rem; font-weight: 500; } @media (max-width: 767px) { .banner-wrapper { display: block; } .banner-btn { width: auto; } .chargeable-weight-calculator .radio-container .ups-form_group.ups-radio-group { flex-direction: column; } .mode-selection, .chargeable-weight-calculator .package-details .dropdown-container { max-width: 100%; } .chargeable-weight-calculator .category-selection, .chargeable-weight-calculator .package-details, .chargeable-weight-calculator ul.input-controls-container { flex-direction: column; } .close-package-details.icon.ups-icon-close { right: -20px; } ul.result-calculation { flex-wrap: wrap; } li.value { width: 50%; } } </style>
<div class="chargeable-weight-calculator ups-container"><div class=inner-container><div class=mode-selection-container><h2 class=mode-selection-label>Sélectionnez un mode</h2><div class=radio-container><fieldset aria-label="Mode Selection"class="ups-form_group ups-radio-group"role=radiogroup><div class="ups-input_wrapper ups-buttonList_wrapper mode-selection"><input data-name=mode-selection-group name=mode-selection type=radio class="ups-radio-custom ups-analytics"id=iaf-mode value=iaf-mode checked> <label class=ups-radio-custom-label for=iaf-mode><div class=mode-label>Fret aérien international<br><br><span class="dim iaf">1:6000</span></div><img alt=""src=https://www.ups.com/assets/resources/webcontent/supplychain/images/ups-international-shipping-plane-globe.svg style=width:56px></label></div><div class="ups-input_wrapper ups-buttonList_wrapper mode-selection"><input data-name=mode-selection-group name=mode-selection type=radio class="ups-radio-custom ups-analytics" id=naaf-mode value=naaf-mode> <label class=ups-radio-custom-label for=naaf-mode><div class=mode-label>Fret aérien nord-américain<br><br><span class="dim naaf">1:5000</span></div><img alt=""src=https://www.ups.com/assets/resources/webcontent/supplychain/images/ups-international-shipping-plane-globe.svg style=width:56px></label></div><div class="ups-input_wrapper ups-buttonList_wrapper mode-selection"><input data-name=mode-selection-group name=mode-selection type=radio class="ups-radio-custom ups-analytics"id=express-mode value=express-mode> <label class=ups-radio-custom-label for=express-mode><div class=mode-label>Express<br><br><span class="dim express">1:5000</span></div><img alt=""src=https://www.ups.com/assets/resources/webcontent/supplychain/images/express-icon.svg style=width:56px></label></div><div class="ups-input_wrapper ups-buttonList_wrapper mode-selection"><input data-name=mode-selection-group name=mode-selection type=radio class="ups-radio-custom ups-analytics"id=oceanlcl-mode value=oceanlcl-mode> <label class=ups-radio-custom-label for=oceanlcl-mode><div class=mode-label>Groupage (LCL) maritime<br><br><span class="dim ocean">1:1000</span></div><img alt=""src=https://www.ups.com/assets/resources/webcontent/supplychain/images/ups-ocean-ship.svg style=width:56px></label></div></fieldset></div></div><div class=category-selection><h2 class=category-label>Dimensions calculées par</h2><ul class=category-btn-grp><li><span id=cargo-details-btn class="category-btn category-active">Détails du chargement</span><li><span id=shipment-details-btn class=category-btn>Totaux de l’envoi</span></ul></div><div class=calculator-details><div class="cargo-details is-visible"data-type=Cargo><div class=radio-container><fieldset aria-label="Unit Selection"class="ups-form_group ups-radio-group"role=radiogroup><div class="ups-input_wrapper ups-buttonList_wrapper"><input data-name=radio_group name=cargoDetails type=radio class="ups-radio-custom ups-analytics"id=radio-cargoDetails-0 value=KG_M checked> <label class="ups-radio-custom-label updateForm"for=radio-cargoDetails-0>kg/cm </label></div><div class="ups-input_wrapper ups-buttonList_wrapper"><input data-name=radio_group name=cargoDetails type=radio class="ups-radio-custom ups-analytics"id=radio-cargoDetails-1 value=LB_INCH> <label class="ups-radio-custom-label updateForm"for=radio-cargoDetails-1>lb/po </label></div></fieldset></div><div class=caculation-result-section><div class=cargo-details-package-container><div class=package-details id=cargo-package-details><input id=hiddenInput type=hidden class="validateKeypress hidden"><div class=dropdown-container><div class="ups-form_group ups-dropdown-control"data-plugin=formDropdown><label class=ups-form_label for=dropdown1>Type</label><div class="ups-input_wrapper ups-dropdown_wrapper"><select class=ups-dropdown name=selectCargoItems><option value=Loose/Boxes>Boîtes en vrac<option value=Pallets>Palettes</select></div></div></div><ul class=input-controls-container><li class="ups-form_group ups-input"data-plugin=inputControl><div class="ups-input_wrapper ups-text_wrapper"><input data-name=Quantity data-name="Number of Pieces"name=cargo-quantity type=number class="ups-form_input validateKeypress validatekeydown"min=0 data-maxlength=999 data-type=quantity><label class=ups-form_label for=quantity>Quantité</label><span id=errorCargoQuantity class=error-msg>La quantité doit être inférieure à 9999</span></div></li><span class="icon cross-icon ups-icon-close"></span><li class="ups-form_group ups-input"data-plugin=inputControl><div class="ups-input_wrapper ups-text_wrapper"><input data-name=Weight data-name="Weight Per Piece"name=cargo-weight type=number class="ups-form_input validateKeypress validatekeydown"min=0 data-maxlength=99999 data-type=weight><label class=ups-form_label for=weight>Poids (<span id=cargo-weight-unit class=cargo-weight-unit>kg</span>)</label><span id=errorCargoWeight class=error-msg>Le poids doit être inférieur à 99999</span></div><li class="ups-form_group ups-input"data-plugin=inputControl><div class="ups-input_wrapper ups-text_wrapper"><input data-name=Length data-name="Input length"name=cargo-length type=number class="ups-form_input validateKeypress validatekeydown"min=0 data-maxlength=999 data-type=length><label class=ups-form_label for=length>Longueur (<span id=cargo-length-unit class=cargo-length-unit>cm</span>)</label> <span id=errorCargoLength class=error-msg>La longueur doit être inférieure à 999</span></div></li><span class="icon cross-icon ups-icon-close"></span><li class="ups-form_group ups-input"data-plugin=inputControl><div class="ups-input_wrapper ups-text_wrapper"><input data-name=Width data-name="Input width"name=cargo-width type=number class="ups-form_input validateKeypress validatekeydown"min=0 data-maxlength=999 data-type=width><label class=ups-form_label for=width>Largeur (<span id=cargo-width-unit class=cargo-width-unit>cm</span>)</label> <span id=errorCargoWidth class=error-msg>La largeur doit être inférieure à 999</span></div></li><span class="icon cross-icon ups-icon-close"></span><li class="ups-form_group ups-input"data-plugin=inputControl><div class="ups-input_wrapper ups-text_wrapper"><input data-name=height data-name="Input height"name=cargo-height-kgcm type=number class="ups-form_input validateKeypress validatekeydown"min=0 data-maxlength=999 data-type=height><label class=ups-form_label for=height>Hauteur (<span id=cargo-height-unit class=cargo-height-unit>cm</span>)</label> <span id=errorCargoHeightKGCM class=error-msg>La hauteur doit être inférieure à 999</span></div></ul></div></div></div><div class=add-item-cta><a class="ups-analytics ups-cta ups-cta-secondary"href=javascript:; onclick=addCargoItem()><span class=scn-cta-preicon>+</span> Ajouter un autre article dans le chargement</a></div><ul class=result-calculation><li class=value><p>Quantité totale<h4><span id=cargo-total-quantity>0</span></h4><li class=value><p>Volume total<h4><span id=cargo-total-volume>0 </span><span id=cargo-total-volume-unit>m</span><sup>3</sup></h4><li class=value><p>Poids brut<h4><span id=cargo-total-weight>0 </span><span id=cargo-total-weight-unit>kg</span></h4><li class=value><p>Poids volumétrique<h4><span id=cargo-dimensional-weight>0 </span><span id=cargo-dimensional-weight-unit>kg</span></h4><li class=value><p>Est. du poids facturable<h4><span id=cargo-est-chargeable-weight>0 </span><span id=cargo-est-charge-weight-unit>kg</span></h4></ul></div><div class=shipment-details><div class=radio-container><fieldset aria-label="Unit Selection"class="ups-form_group ups-radio-group"role=radiogroup><div class="ups-input_wrapper ups-buttonList_wrapper"><input data-name=radio_group name=shipmentDetails type=radio class="ups-analytics ups-radio-custom"id=radio-shipmentDetails-0 value=KG_M3 checked> <label class=ups-radio-custom-label for=radio-shipmentDetails-0>kg/m<sup>3</sup></label></div><div class="ups-input_wrapper ups-buttonList_wrapper"><input data-name=radio_group name=shipmentDetails type=radio class="ups-analytics ups-radio-custom"id=radio-shipmentDetails-1 value=LB_FT3 onclick=calculateShipmentTotalVolume(),calculateShipmentDimWeight(),calculateShipmentChargeableWeight()> <label class=ups-radio-custom-label for=radio-shipmentDetails-1>lb/pi<sup>3</sup></label></div></fieldset></div><div class=caculation-result-section><div class="ups-analytics shipment-details-package-container"><div class="package-details shipment"id=shipment-package-details><div class=dropdown-container><div class="ups-form_group ups-dropdown-control"data-plugin=formDropdown><label class=ups-form_label for=dropdown1>Type</label><div class="ups-input_wrapper ups-dropdown_wrapper"><select class=ups-dropdown name=selectCargoItems><option value=Loose/Boxes>Boîtes en vrac<option value=Pallets>Palettes</select></div></div></div><ul class=input-controls-container><li class="ups-form_group ups-input"data-plugin=inputControl><div class="ups-input_wrapper ups-text_wrapper"><input data-name=Quantity name=shipment-quantity type=number class=ups-form_input min=0 oninput=calculateShipmentTotalQuantity(),calculateShipmentTotalWeight() onkeypress=return/[0-9a-zA-Z]/i.test(event.key)><label class=ups-form_label for=quantity>Quantité totale</label><span id=errorShipmentQuantity class=error-msg>La quantité doit être inférieure à 999</span></div><li class="ups-form_group ups-input"data-plugin=inputControl><div class="ups-input_wrapper ups-text_wrapper"><input data-name=Weight name=shipment-weight type=number min=0 oninput=calculateShipmentTotalWeight() onkeypress=return/[0-9a-zA-Z]/i.test(event.key) id=ups-form_input><label class=ups-form_label for=weight>Poids total (<span id=shipment-weight-unit>kg</span>)</label><span id=errorShipmentWeight class=error-msg>Le poids doit être inférieur à 99999</span></div><li class="ups-form_group ups-input"data-plugin=inputControl><div class="ups-input_wrapper ups-text_wrapper"><input data-name=Volume name=shipment-volume type=number class=ups-form_input min=0 oninput=calculateShipmentTotalVolume(),calculateShipmentDimWeight(),calculateShipmentChargeableWeight() onkeypress=return/[0-9a-zA-Z]/i.test(event.key)><label class=ups-form_label for=volume>Volume total (<span id=shipment-volume-unit>m</span><sup>3</sup>)</label><span id=errorShipmentVolume class=error-msg>Le volume doit être inférieur à 999999999</span></div></ul></div></div></div><ul class=result-calculation><li class=value><p>Quantité totale<h4><span id=shipment-total-quantity>0</span></h4><li class=value><p>Volume total<h4><span id=shipment-total-volume>0 </span><span id=shipment-total-volume-unit>m</span><sup>3</sup></h4><li class=value><p>Poids brut<h4><span id=shipment-total-weight>0 </span><span id=shipment-total-weight-unit>kg</span></h4><li class=value><p>Poids volumétrique<h4><span id=shipment-dimensional-weight>0 </span><span id=shipment-dimensional-weight-unit>kg</span></h4><li class=value><p>Est. du poids facturable<h4><span id=shipment-est-charge-weight>0 </span><span id=shipment-est-charge-weight-unit>kg</span></h4></ul></div></div><div class=ups-banner id=chargeable-promo-banner><div class=banner-wrapper><div class=banner-body-container><div class=banner-header><h2>Obtenez une soumission exacte</h2></div><div class=banner-body-content><p>Pour expédier votre fret, saisissez simplement les détails de votre envoi dans la plateforme d’expédition Portail UPS<sup>®</sup> Forwarding Hub, et nous transférerons ces dimensions.</div></div><div class=banner-btn><p><a class="ups-analytics ups-cta ups-cta-primary"href=https://scsapps.ups.com/forwardinghub/ca/fr/quotes/ aria-label="Get an Exact Quote"data-utg-link-name=Ship_Your_Freight data-utg-onsite-ad-position=1 id=submit target=_blank>Expédiez vos marchandises<span class="icon ups-icon-right-arrow"aria-hidden=true></span></a></div></div></div><div class=ups-banner id=chargeable-promo-banner-ocean style=display:none><div class=banner-wrapper><div class=banner-body-container><div class=banner-header><h2>Prêt à expédier votre fret maritime?</h2></div><div class=banner-body-content><p>Pour expédier votre fret, saisissez simplement les détails de votre envoi dans la plateforme d’expédition Portail UPS<sup>®</sup> Forwarding Hub, et nous transférerons ces dimensions.</div></div><div class=banner-btn><p><a class="ups-analytics ups-cta ups-cta-primary"href=https://scsapps.ups.com/forwardinghub/ca/fr/quotes/ aria-label="Get an Exact Quote"data-utg-link-name=Ship_Your_Freight data-utg-onsite-ad-position=1 id=submit-ocean target=_blank>Expédiez vos marchandises<span class="icon ups-icon-right-arrow"aria-hidden=true></span></a></div></div></div><div class=disclaimer><small><em>Remarque : Cette calculatrice et ce contenu éducatif sont fournis à titre informatif et estimatif uniquement. UPS ne fait aucune déclaration quant à l’exactitude de la calculatrice ou du contenu éducatif. Les estimations ne seront en aucun cas contraignantes pour UPS, sauf accord écrit spécifique de la part d’UPS. Le poids et les coûts réels peuvent varier et sont sujets à changement sans préavis.</em></small></div></div></div>
<script>

    $(".ups-radio-custom").change(function () {

        if ($(this).parents(".cargo-details").hasClass('is-visible')) {

            $(".validateKeypress.hidden:last-child").trigger('blur');

            var parent = $(".validateKeypress.hidden:last").parents(".package-details");

            $(this).focus();

            calculateCargoDetails(parent);

        }

    });

    let DIMFactor = 6000;

    let selectedCargoUnit = document.querySelector("input[name='cargoDetails']:checked").value;

    let selectedShipmentUnit = document.querySelector("input[name='shipmentDetails']:checked").value;

    function cargoKGCM() {

        if (selectedMode == "iaf-mode") {

            DIMFactor = 6000;

        } else if (selectedMode == "naaf-mode" || selectedMode == "express-mode") {

            DIMFactor = 5000;

        } else {

            DIMFactor = 1000;

        }

        return DIMFactor;

    }

    function cargoLBIN() {

        if (selectedMode == "iaf-mode") {

            DIMFactor = 166;

        } else if (selectedMode == "naaf-mode" || selectedMode == "express-mode") {

            DIMFactor = 139;

        } else {

            DIMFactor = 40;

        }

        return DIMFactor;

    }

    function shipmentKGM() {

        if (selectedMode == "iaf-mode") {

            DIMFactor = 6000;

        } else if (selectedMode == "naaf-mode" || selectedMode == "express-mode") {

            DIMFactor = 5000;

        } else {

            DIMFactor = 1000;

        }

        return DIMFactor;

    }

    function shipmentLBFT() {

        if (selectedMode == "iaf-mode") {

            DIMFactor = 166;

        } else if (selectedMode == "naaf-mode" || selectedMode == "express-mode") {

            DIMFactor = 139;

        } else {

            DIMFactor = 40;

        }

        return DIMFactor;

    }

    function runDIMFunction() {

        selectedCargoUnit = document.querySelector("input[name='cargoDetails']:checked").value;

        selectedShipmentUnit = document.querySelector("input[name='shipmentDetails']:checked").value;

        let selectedCategoryId = document.getElementsByClassName("category-active")[0].id;

        let selectedUnit;

        if (selectedCategoryId == "shipment-details-btn") {

            selectedUnit = selectedShipmentUnit;

            if (selectedShipmentUnit == "KG_M3") {

                shipmentKGM();

            } else if (selectedShipmentUnit == "LB_FT3") {

                shipmentLBFT();

            }

        } else if (selectedCategoryId == "cargo-details-btn") {

            selectedUnit = selectedCargoUnit;

            if (selectedCargoUnit == "KG_M") {

                cargoKGCM();

            } else if (selectedCargoUnit == "LB_INCH") {

                cargoLBIN();

            }

        }

    }

    function reCalculatedTargetvalue() {

        let parent;

        if ($("#cargo-details-btn").hasClass("category-active")) {

            parent = $(".package-details:not(.shipment)")

            calculateCargoDetails();

        } else {

            parent = $(".package-details.shipment")

        }

    }

    let categoryBtn = document.getElementsByClassName("category-btn");

    let categoryCargoDetails = document.getElementsByClassName("cargo-details");

    let categoryShipmentDetails = document.getElementsByClassName("shipment-details");

    let categoryActive = document.getElementsByClassName("category-active");

    for (let j = 0; j < categoryBtn.length; j++) {

        categoryBtn[j].onclick = function () {

            for (element of categoryActive) {

                element.classList.remove("category-active");

                this.classList.add("category-active");

                runDIMFunction();

            }

            if (j == 1) {

                categoryCargoDetails[0].classList.remove("is-visible");

                categoryShipmentDetails[0].classList.add("is-visible");

            } else if (j == 0) {

                categoryShipmentDetails[0].classList.remove("is-visible");

                categoryCargoDetails[0].classList.add("is-visible");

            }

            let dimPermode = updateDIMonModes();

            reCalculatedTargetvalue();

        }

    }

    let modeSelection = document.getElementsByName("mode-selection");

    let selectedMode = document.querySelector("input[name='mode-selection']:checked").value;

    for (let i = 0; i < modeSelection.length; i++) {

        modeSelection[i].onclick = function () {

            selectedMode = document.querySelector("input[name='mode-selection']:checked").value;

            selectedCargoUnit = document.querySelector("input[name='cargoDetails']:checked").value;

            selectedShipmentUnit = document.querySelector("input[name='shipmentDetails']:checked").value;

            if (selectedMode == "express-mode") {

                document.getElementById("chargeable-promo-banner").style.display = "none"

                document.getElementById("chargeable-promo-banner-ocean").style.display = "none"

                runDIMFunction();

                if ($(".category-btn.category-active").attr('id') == 'shipment-details-btn') {

                    calculateShipmentTotalVolume();

                    calculateShipmentDimWeight();

                    calculateShipmentChargeableWeight();

                }

                let dimPermode = updateDIMonModes();

                reCalculatedTargetvalue()

            } else if (selectedMode == "oceanlcl-mode") {

                document.getElementById("chargeable-promo-banner").style.display = "none"

                document.getElementById("chargeable-promo-banner-ocean").style.display = "block"

                runDIMFunction();

                if ($(".category-btn.category-active").attr('id') == 'shipment-details-btn') {

                    calculateShipmentTotalVolume();

                    calculateShipmentDimWeight();

                    calculateShipmentChargeableWeight();

                }

                let dimPermode = updateDIMonModes();

                reCalculatedTargetvalue()

            } else {

                document.getElementById("chargeable-promo-banner").style.display = "block"

                document.getElementById("chargeable-promo-banner-ocean").style.display = "none"

                runDIMFunction();

                if ($(".category-btn.category-active").attr('id') == 'shipment-details-btn') {

                    calculateShipmentTotalVolume();

                    calculateShipmentDimWeight();

                    calculateShipmentChargeableWeight();

                }

                let dimPermode = updateDIMonModes();

                reCalculatedTargetvalue()

            }

        }

    }

    let cargoDetailsUnit = document.getElementsByName("cargoDetails");

    for (let i = 0; i < cargoDetailsUnit.length; i++) {

        cargoDetailsUnit[i].onclick = function () {

            $(".package-details:not(.shipment)").each((index, element) => {

                if (cargoDetailsUnit[i].value === "LB_INCH") {

                    $(element).find(".cargo-weight-unit").text("lb");

                    $(element).find(".cargo-length-unit").text("in");

                    $(element).find(".cargo-width-unit").text("in");

                    $(element).find(".cargo-height-unit").text("in");

                    document.getElementById("cargo-total-weight-unit").innerHTML = "lbs";

                    document.getElementById("cargo-total-volume-unit").innerHTML = "ft";

                    document.getElementById("cargo-est-charge-weight-unit").innerHTML = "lbs";

                    document.getElementById("cargo-dimensional-weight-unit").innerHTML = "lbs";

                    cargoLBIN();

                } else if (cargoDetailsUnit[i].value === "KG_M") {

                    $(element).find(".cargo-weight-unit").text("kg");

                    $(element).find(".cargo-length-unit").text("cm");

                    $(element).find(".cargo-width-unit").text("cm");

                    $(element).find(".cargo-height-unit").text("cm");

                    document.getElementById("cargo-total-weight-unit").innerHTML = "kg";

                    document.getElementById("cargo-total-volume-unit").innerHTML = "m";

                    document.getElementById("cargo-est-charge-weight-unit").innerHTML = "kg";

                    document.getElementById("cargo-dimensional-weight-unit").innerHTML = "kg";

                    cargoKGCM();

                }

            })

            let dimPermode = updateDIMonModes();

        }

    }

    let shipmentTotalUnit = document.getElementsByName("shipmentDetails");

    for (let i = 0; i < shipmentTotalUnit.length; i++) {

        shipmentTotalUnit[i].onclick = function () {

            if (shipmentTotalUnit[i].value === "LB_FT3") {

                document.getElementById("shipment-weight-unit").innerHTML = " lb";

                document.getElementById("shipment-volume-unit").innerHTML = " ft";

                document.getElementById("shipment-total-weight-unit").innerHTML = " lb";

                document.getElementById("shipment-total-volume-unit").innerHTML = " ft";

                document.getElementById("shipment-est-charge-weight-unit").innerHTML = " lb";

                document.getElementById("shipment-dimensional-weight-unit").innerHTML = " lb";

                selectedCargoUnit = document.querySelector("input[name='cargoDetails']:checked").value;

                selectedShipmentUnit = document.querySelector("input[name='shipmentDetails']:checked").value;

                shipmentLBFT();

                calculateShipmentTotalVolume();

                calculateShipmentDimWeight();

                calculateShipmentChargeableWeight();

            } else if (shipmentTotalUnit[i].value === "KG_M3") {

                document.getElementById("shipment-weight-unit").innerHTML = "kg";

                document.getElementById("shipment-volume-unit").innerHTML = "m";

                document.getElementById("shipment-total-weight-unit").innerHTML = "kg";

                document.getElementById("shipment-total-volume-unit").innerHTML = "m";

                document.getElementById("shipment-est-charge-weight-unit").innerHTML = "kg";

                document.getElementById("shipment-dimensional-weight-unit").innerHTML = " kg";

                selectedCargoUnit = document.querySelector("input[name='cargoDetails']:checked").value;

                selectedShipmentUnit = document.querySelector("input[name='shipmentDetails']:checked").value;

                shipmentKGM();

                calculateShipmentTotalVolume();

                calculateShipmentDimWeight();

                calculateShipmentChargeableWeight();

            }

            let dimPermode = updateDIMonModes();

        }

    }

    function addCargoItem() {

        const cargoPackageDetailsID = "cargo-package-details";

        let cargoPackageDetails = document.getElementById(cargoPackageDetailsID);

        let clonedElement = cargoPackageDetails.cloneNode(true);

        let newId = cargoPackageDetailsID + "_" + Date.now();

        clonedElement.id = newId;

        let closePackageDetails = document.createElement("div");

        closePackageDetails.className = "close-package-details icon ups-icon-close";

        /*--  $(clonedElement).find('.ups-form_group.ups-dropdown-control').formDropdown();  --*/

        closePackageDetails.addEventListener("click", function () {

            clonedElement.remove();

        });

        $(clonedElement).find('[data-type="width"]').val('');

        $(clonedElement).find('[data-type="length"]').val('');

        $(clonedElement).find('[data-type="height"]').val('');

        $(clonedElement).find('[data-type="quantity"]').val('');

        $(clonedElement).find('[data-type="weight"]').val('');

        $(clonedElement).removeClass("valid");

        $(clonedElement).find('.ups-form_group.ups-input').each((index, element) => {

            /*-- $(element).inputControl();  --*/

            $(element).find('.error-msg').hide();

        });

        $(clonedElement).find('#btn_dropdown_0').remove();

        $(clonedElement).find('#listbox_dropdown_0').remove();

        clonedElement.appendChild(closePackageDetails);

        $(".cargo-details-package-container").append(clonedElement);

    }

    let shipmentTotalQuantity;

    let shipmentQuantity = document.getElementsByName("shipment-quantity");

    function calculateShipmentTotalQuantity() {

        if (Number(shipmentQuantity[0].value) <= 999) {

            shipmentTotalQuantity = Number(shipmentQuantity[0].value)

            document.getElementById("shipment-total-quantity").innerHTML = shipmentTotalQuantity;

            document.getElementById("errorShipmentQuantity").style.display = "none";

            document.getElementById("errorShipmentQuantity").classList.remove('errorTrue')

        } else {

            document.getElementById("errorShipmentQuantity").style.display = "block";

            document.getElementById("shipment-total-quantity").innerHTML = 0;

            document.getElementById("errorShipmentQuantity").classList.add('errorTrue')

        }

    }

    let shipmentTotalWeight;

    let shipmentWeight = document.getElementsByName("shipment-weight");

    function calculateShipmentTotalWeight() {

        if (Number(shipmentWeight[0].value) <= 99999) {

            shipmentTotalWeight = Number(shipmentWeight[0].value);

            document.getElementById("shipment-total-weight").innerHTML = shipmentTotalWeight;

            document.getElementById("errorShipmentWeight").style.display = "none";

            document.getElementById("errorShipmentWeight").classList.remove('errorTrue')

        } else {

            document.getElementById("errorShipmentWeight").style.display = "block";

            document.getElementById("shipment-total-weight").innerHTML = 0;

            document.getElementById("errorShipmentWeight").classList.add('errorTrue')

        }

    }

    let shipmentTotalVolume;

    let shipmentVolume = document.getElementsByName("shipment-volume");

    function calculateShipmentTotalVolume() {

        if (Number(shipmentVolume[0].value) <= 999999999) {

            shipmentTotalVolume = Number(shipmentVolume[0].value);

            document.getElementById("shipment-total-volume").innerHTML = shipmentTotalVolume;

            document.getElementById("errorShipmentVolume").style.display = "none"

            document.getElementById("errorShipmentVolume").classList.remove('errorTrue')

        } else {

            document.getElementById("shipment-total-volume").innerHTML = 0;

            document.getElementById("shipment-est-charge-weight").innerHTML = 0;

            document.getElementById("errorShipmentVolume").style.display = "block"

            document.getElementById("errorShipmentVolume").classList.add('errorTrue')

        }

    }

    let shipmentDimWeight;

    function calculateShipmentDimWeight() {

        shipmentDimWeight = Number(shipmentTotalVolume / DIMFactor);

        if (selectedShipmentUnit == "KG_M3") {

            shipmentDimWeight = (shipmentDimWeight * 1000000).toFixed(2);

            document.getElementById("shipment-dimensional-weight").innerHTML = shipmentDimWeight;

        } else if (selectedShipmentUnit == "LB_FT3") {

            shipmentDimWeight = (shipmentDimWeight * 1728).toFixed(2);

            document.getElementById("shipment-dimensional-weight").innerHTML = shipmentDimWeight;

        }

    }

    function calculateShipmentChargeableWeight() {

        if (shipmentDimWeight > shipmentTotalWeight) {

            document.getElementById("shipment-est-charge-weight").innerHTML = Number(shipmentDimWeight) || 0;

        } else {

            document.getElementById("shipment-est-charge-weight").innerHTML = Number(shipmentTotalWeight) || 0;

        }

    }

    let cargoTotalQuantityGlobal = 0, cargoTotalQuantityShare = 0;

    function calculateCargoTotalQuantity() {

        let cargoQuantity = document.getElementsByName("cargo-quantity");

        let cargoTotalQuantity = 0;

        cargoQuantity.forEach(field => {

            let value = parseFloat(field.value) || 0;

            cargoTotalQuantity += value;

        })

        document.getElementById("cargo-total-quantity").innerHTML = Number(cargoTotalQuantity);

        cargoTotalQuantityShare = cargoTotalQuantity;

    }

    let cargoTotalWeightGlobal = 0;

    function calculateCargoTotalWeight() {

        let cargoWeight = document.getElementsByName("cargo-weight");

        let cargoTotalWeight = 0;

        cargoWeight.forEach(field => {

            let value = parseFloat(field.value) || 0;

            cargoTotalWeight += value;

        })

        document.getElementById("cargo-total-weight").innerHTML = Number(cargoTotalWeight * cargoTotalQuantityShare);

        cargoTotalQuantityGlobal = Number(cargoTotalWeight * cargoTotalQuantityShare);

    }

    let cargoDimWeight, cargoTotalVolume = 0;

    cargoDimWeight = Number(cargoTotalVolume / DIMFactor);

    let estCargoChargeableWeightCalculator = 0;

    function calculateCargoChargeableWeight() {

        if (cargoDimWeight > cargoTotalQuantityGlobal) {

            document.getElementById("cargo-est-charge-weight").innerHTML = Number(cargoDimWeight);

        } else {

            document.getElementById("cargo-est-charge-weight").innerHTML = Number(cargoTotalQuantityGlobal);

        }

    }

    const ajaxCall = (method, urls, data, redirect) => {

        let url = urls;

        const timestamp = new Date().getTime().toString();

        const calculatetime = timestamp

            .substr(timestamp.length - 6)

            .split('')

            .map(Number)

            ?.reduce(function (acc, val) {

                return acc + val;

            }, 0);

        const scskey = btoa(

            '2cb220c0-9972-41ed-bc6d-257433b6d0ae^' + timestamp + '|' + calculatetime

        );

        return $.ajax({

            cache: true,

            url: url,

            method: method,

            header: { 'SCS-API-KEY': scskey },

            data: data,

            beforeSend: function (jqXHR, settings) {

                jqXHR.setRequestHeader('scs-api-key', scskey

                );

            },

            success: function (data) {

                if (data.isValid) {

                    window.open(redirect + data.result, "_blank");

                }

            }

        });

    };

    function calculateVolumeTotal(fromUnit, toUnit, length, width, height) {

        let convertedLength = length;

        let convertedWidth = width;

        let convertedHeight = height;

        if (fromUnit && toUnit) {

            convertedLength = getConvertedValue(convertedLength, fromUnit, toUnit);

            convertedWidth = getConvertedValue(convertedWidth, fromUnit, toUnit);

            convertedHeight = getConvertedValue(convertedHeight, fromUnit, toUnit);

        }

        return convertedLength * convertedWidth * convertedHeight;

    }

    function calculateActualWeight(

        fromUnit,

        toUnit,

        numberOfUnits = 1,

        weight,

        totalWeight

    ) {

        let calculatedWeight = 0;

        if (numberOfUnits > 1) {

            calculatedWeight = numberOfUnits * weight;

        } else {

            calculatedWeight = totalWeight;

        }

        if (fromUnit && toUnit) {

            calculatedWeight = getConvertedValue(calculatedWeight, fromUnit, toUnit);

        }

        return calculatedWeight;

    }

    const unitFactors = {

        kg: { lbs: 1 / 2.20462 },

        lbs: { kg: 2.20462 },

        in: {

            ft: 12,

            m: 39.37,

            cm: 1 / 2.54

        },

        ft: { in: 1 / 12 },

        m: {

            in: 1 / 39.37,

            cm: 1 / 100

        },

        cm: { m: 100 }

    };

    const volumetricWeightFactor = {

        in: {

            kg: 366,

            lbs: 166

        },

        cm: {

            kg: 6000,

            lbs: 166

        },

        in_naaf: {

            kg: 306,

            lbs: 139

        },

        cm_naaf: {

            kg: 5000,

            lbs: 139

        },

        in_ocean: {

            kg: 61,

            lbs: 40

        },

        cm_ocean: {

            kg: 1000,

            lbs: 40

        }

    };

    function getConvertedValue(value, fromUnit, toUnit) {

        if (fromUnit && toUnit && fromUnit !== toUnit) {

            return value / unitFactors[fromUnit][toUnit];

        }

        return value;

    }

    function calculateDimensionalWeightOnMode(fromUnit, toUnit, volume) {

        let dimensionalWeight;

        if (fromUnit === 'in' && toUnit === 'kg') {

            dimensionalWeight = volume / volumetricWeightFactor.in.kg;

        } else if (fromUnit === 'cm' && toUnit === 'kg') {

            dimensionalWeight = volume / volumetricWeightFactor.cm.kg;

        } else if (fromUnit === 'in' && toUnit === 'lbs') {

            dimensionalWeight = volume / volumetricWeightFactor.in.lbs;

        }

        return dimensionalWeight;

    }

    function calculateDimensionalWeightOnOceanMode(fromUnit, toUnit, volume) {

        let dimensionalWeight;

        if (fromUnit === 'in' && toUnit === 'kg') {

            dimensionalWeight = volume / volumetricWeightFactor.in_ocean.kg;

        } else if (fromUnit === 'cm' && toUnit === 'kg') {

            dimensionalWeight = volume / volumetricWeightFactor.cm_ocean.kg;

        } else if (fromUnit === 'in' && toUnit === 'lbs') {

            dimensionalWeight = volume / volumetricWeightFactor.in_ocean.lbs;

        }

        return dimensionalWeight;

    }

    function calculateDimensionalWeightForNaaf(fromUnit, toUnit, volume) {

        let dimensionalWeight;

        if (fromUnit === 'in' && toUnit === 'kg') {

            dimensionalWeight = volume / volumetricWeightFactor.in_naaf.kg;

        } else if (fromUnit === 'cm' && toUnit === 'kg') {

            dimensionalWeight = volume / volumetricWeightFactor.cm_naaf.kg;

        } else if (fromUnit === 'in' && toUnit === 'lbs') {

            dimensionalWeight = volume / volumetricWeightFactor.in_naaf.lbs;

        }

        return dimensionalWeight;

    }

    const cubicMetersPerMetricTonDivisor = 1000;

    function roundNumber(value, precision = 2) {

        return Math.round(value * Math.pow(10, precision)) / Math.pow(10, precision);

    }

    $(document).on("blur", ".validateKeypress", function (e) {

        const parent = $(this).parents('.package-details');

        if ((!isNaN(parent.find('[data-type="width"]').val()) && parent.find('[data-type="width"]').val() > 0) &&

            (!isNaN(parent.find('[data-type="height"]').val()) && parent.find('[data-type="height"]').val() > 0) &&

            (!isNaN(parent.find('[data-type="length"]').val()) && parent.find('[data-type="length"]').val() > 0) &&

            (!isNaN(parent.find('[data-type="quantity"]').val()) && parent.find('[data-type="quantity"]').val() > 0) &&

            (!isNaN(parent.find('[data-type="weight"]').val()) && parent.find('[data-type="weight"]').val() > 0)) {

            parent.addClass('valid')

        } else {

            parent.removeClass('valid')

        }

        calculateCargoDetails(parent);

    });

    function calculateCargoDetails(parent = null) {

        var dimensionsUnit,

            weightUnit,

            dimensionalWeight,

            dimensionalWeightUnit,

            shipmentTypeVolumeDimensions,

            dimensionalWeightUnitInSelUnit,

            densityDimensionUnit, numOfPieces = 0, inputVolumeInOrCmCube = 0,

            totalVolume = 0, totalActualWeightInKg, totalDensity, totalVolForDensity = 0,

            displayActualWeight = 0, totalDimensioanlWeightInSelUnit, displayEstChargableWeight,

            selectedCargoUnit = document.querySelector("input[name='cargoDetails']:checked").value;

        if (selectedCargoUnit === 'LB_INCH') {

            dimensionsUnit = {

                from: 'in',

                to: 'ft'

            };

            densityDimensionUnit = {

                from: 'in',

                to: 'm'

            };

            weightUnit = {

                from: 'lbs',

                to: 'kg'

            };

            dimensionalWeightUnit = {

                from: 'in',

                to: 'kg'

            };

            dimensionalWeightUnitInSelUnit = {

                from: 'in',

                to: 'lbs'

            };

            shipmentTypeVolumeDimensions = {

                from: 'ft',

                to: 'in'

            };

        } else if (selectedCargoUnit === 'KG_M') {

            dimensionsUnit = {

                from: 'cm',

                to: 'm'

            };

            weightUnit = {

                from: 'kg',

                to: 'kg'

            };

            dimensionalWeightUnit = {

                from: 'cm',

                to: 'kg'

            };

            shipmentTypeVolumeDimensions = {

                from: 'm',

                to: 'cm'

            };

        }

        let CargoParent = $(".package-details:not(.shipment)");

        for (let i = 0; i < CargoParent.length; i++) {

            if ($(CargoParent[i]).hasClass('valid')) {

                const formControl = $(CargoParent[i]);

                const length = +formControl.find('[data-type="length"]').val();

                const width = +formControl.find('[data-type="width"]').val();

                const height = +formControl.find('[data-type="height"]').val();

                const inputWeightPerPiece = +formControl.find('[data-type="weight"]').val();

                const inputPieces = +formControl.find('[data-type="quantity"]').val();

                totalVolume +=

                    inputPieces *

                    calculateVolumeTotal(

                        dimensionsUnit.from,

                        dimensionsUnit.to,

                        length,

                        width,

                        height

                    );

                if (selectedCargoUnit === 'LB_INCH') {

                    totalVolForDensity +=

                        inputPieces *

                        calculateVolumeTotal(

                            dimensionsUnit.from,

                            dimensionsUnit.to,

                            length,

                            width,

                            height

                        );

                } else {

                    totalVolForDensity = totalVolume;

                }

                numOfPieces += inputPieces;

                $("#cargo-total-volume").text(roundNumber(totalVolForDensity));

                $("#cargo-total-quantity").text(roundNumber(numOfPieces));

                displayActualWeight += calculateActualWeight(

                    '',

                    '',

                    inputPieces,

                    inputWeightPerPiece,

                    inputWeightPerPiece

                );

                const actualWeightInKg = displayActualWeight;

                totalActualWeightInKg = actualWeightInKg;

                $("#cargo-total-weight").text(roundNumber(totalActualWeightInKg));

                actualWeightPerCubic = actualWeightInKg / totalVolForDensity;

                totalDensity =

                    cubicMetersPerMetricTonDivisor / actualWeightPerCubic;

                inputVolumeInOrCmCube += inputPieces * (length * width * height);

                if (selectedMode == "naaf-mode" || selectedMode == "express-mode") {

                    dimensionalWeight = calculateDimensionalWeightForNaaf(

                        dimensionalWeightUnit.from,

                        dimensionalWeightUnit.to,

                        inputVolumeInOrCmCube

                    )

                } else if (selectedMode == "iaf-mode") {

                    dimensionalWeight = calculateDimensionalWeightOnMode(

                        dimensionalWeightUnit.from,

                        dimensionalWeightUnit.to,

                        inputVolumeInOrCmCube

                    );

                } else {

                    dimensionalWeight = calculateDimensionalWeightOnOceanMode(

                        dimensionalWeightUnit.from,

                        dimensionalWeightUnit.to,

                        inputVolumeInOrCmCube)

                }

                totalDimensioanlWeightInKg = dimensionalWeight;

                if (selectedCargoUnit === 'LB_INCH') {

                    if (selectedMode == "naaf-mode" || selectedMode == "express-mode") {

                        dimensionalWeight = calculateDimensionalWeightForNaaf(

                            dimensionalWeightUnitInSelUnit.from,

                            dimensionalWeightUnitInSelUnit.to,

                            inputVolumeInOrCmCube

                        )

                    } else if (selectedMode == "iaf-mode") {

                        dimensionalWeight = calculateDimensionalWeightOnMode(

                            dimensionalWeightUnitInSelUnit.from,

                            dimensionalWeightUnitInSelUnit.to,

                            inputVolumeInOrCmCube

                        );

                    } else {

                        dimensionalWeight = calculateDimensionalWeightOnOceanMode(

                            dimensionalWeightUnitInSelUnit.from,

                            dimensionalWeightUnitInSelUnit.to,

                            inputVolumeInOrCmCube

                        );

                    }

                    totalDimensioanlWeightInSelUnit = dimensionalWeight;

                } else if (selectedCargoUnit === 'KG_M') {

                    totalDimensioanlWeightInSelUnit =

                        totalDimensioanlWeightInKg;

                }

                $("#cargo-dimensional-weight").text(roundNumber(totalDimensioanlWeightInSelUnit));

                displayEstChargableWeight = roundNumber(

                    calculateEstChargableWeight(

                        dimensionalWeight,

                        actualWeightInKg

                    )

                );

                $("#cargo-est-chargeable-weight").text(displayEstChargableWeight);

            }

        }

    }

    function calculateEstChargableWeight(dimensionalWeight, actualWeight) {

        return dimensionalWeight > actualWeight ? dimensionalWeight : actualWeight;

    }

    $("#submit, #submit-ocean").click(function (e) {

        e.preventDefault();

        var shipmentTotalsWeightUnit, shipmentTotalsDimensionalUnit, shipmentTotalsChargableWeightUnit, manual_dimensions = [], manual_volume = [], isShipmentTotalsSelected = false, shipmentTotalsActiveUnit = selectedShipmentUnit;

        const selectedCargoUnit = document.querySelector("input[name='cargoDetails']:checked").value

        var selectedCategory = $(".category-btn.category-active");

        if (selectedShipmentUnit == "KG_M3") {

            shipmentTotalsWeightUnit = 'kg';

            shipmentTotalsDimensionalUnit = 'm';

            shipmentTotalsChargableWeightUnit = 'kg';

        } else {

            shipmentTotalsWeightUnit = 'lb';

            shipmentTotalsDimensionalUnit = 'ft';

            shipmentTotalsChargableWeightUnit = 'kg';

        }

        if ($(".category-btn.category-active").attr('id') == 'cargo-details-btn') {

            if ($(".package-details:not(.valid):not(.shipment)").length > 0) {

                return false;

            }

            const formControl = $(".package-details:not(.shipment)");

            for (let i = 0; i < formControl.length; i++) {

                let cargoOBJ = {

                    inputPieces: $($(formControl)[i]).find('[data-type="quantity"]').val(),

                    inputWeightPerPiece: $($(formControl)[i]).find('[data-type="weight"]').val(),

                    inputLength: $($(formControl)[i]).find('[data-type="length"]').val(),

                    inputWidth: $($(formControl)[i]).find('[data-type="width"]').val(),

                    inputHeight: $($(formControl)[i]).find('[data-type="height"]').val(),

                    inputType: $($(formControl)[i]).find('select[name="selectCargoItems"]').val()

                }

                manual_dimensions.push(cargoOBJ)

            }

            isShipmentTotalsSelected = false;

        } else {

            if ($(".package-details.shipment").find('.errorTrue').length > 0) {

                return false;

            }

            manual_volume.push({

                packageType: $(".package-details.shipment").find('select[name="selectCargoItems"]').val(),

                totalQuantity: $(".package-details.shipment").find('input[name="shipment-quantity"]').val(),

                totalWeight: $(".package-details.shipment").find('input[name="shipment-weight"]').val(),

                totalVolume: $(".package-details.shipment").find('input[name="shipment-volume"]').val(),

            });

            isShipmentTotalsSelected = true;

        }

        var jsonObj = {

            shippingMode: {

                data: {

                    modeType: selectedMode == "oceanlcl-mode" ? 'ocean lcl' : 'air',

                    isSectionComplete: false

                }

            },

            cargoDetails: {

                data: {

                    shipmentTotalsActiveUnit,

                    activeUnit: selectedCargoUnit,

                    manual_dimensions,

                    manual_volume,

                    isShipmentTotalsSelected,

                    shipmentTotalsWeightUnit,

                    shipmentTotalsChargableWeightUnit,

                    shipmentTotalsDimensionalUnit

                }

            }

        }

        let jsonStr = JSON.stringify(jsonObj)

        var encodeJsonObj = btoa(jsonStr);

        ajaxCall("GET", "https://scsapps.ups.com/api/ufhapp/Marketing/QuoteTemplate?TemplateJson=" + encodeJsonObj, null, "https://scsapps.ups.com/forwardinghub/ca/fr/quotes/ngflow?marketingId=");

    });

    function validateInput(event, maxLength, allowDecimals = true) {

        let input = event.target.value;

        let key = event.key;

        if (key === "ArrowUp" || key === "ArrowDown") {

            return { action: false, event: 'keyboardIgnore' };

        }

        const regex = /^[0-9]$/;

        const isNumber = regex.test(key);

        const containsDecimal = input.includes('.');

        if (!allowDecimals && key === '.') {

            event.preventDefault();

            return { action: false, event: 'allowDecimals' };

        }

        if (key === '.' && containsDecimal) {

            event.preventDefault();

            return { action: false, event: 'extraDecimals' };

        }

        let effectiveMaxLength = maxLength;

        if (containsDecimal) {

            effectiveMaxLength += 2;

        }

        if ((input.length >= effectiveMaxLength && input > Number($(event.target).data('maxlength'))) || input < 1) {

            event.preventDefault();

            return { action: false, event: 'maxLength' };

        }

        if (!isNumber || (key === '.' && !containsDecimal)) {

            if (key === '.' && input.split('.').length > 1 && input.split('.')[1].length >= 2) {

                event.preventDefault();

                return { action: false, event: 'extraLength' };

            }

            return { action: true };

        }

        event.preventDefault();

        return { action: false, event: 'exception' };;

    }

    $(document).on("keyup", ".validatekeydown", function (e) {

        let response = {};

        if ($(this).data('type') === 'length') {

            response = validateInput(e, 5, true);

        } else if ($(this).data('type') === 'width') {

            response = validateInput(e, 5, true);

        } else if ($(this).data('type') === 'height') {

            response = validateInput(e, 5, true);

        } else if ($(this).data('type') === 'quantity') {

            response = validateInput(e, 3, false);

        } else if ($(this).data('type') === 'weight') {

            response = validateInput(e, 5, true);

        }

        let errorElm = $(this).parent('.ups-text_wrapper').find('.error-msg');

        if (response.event === 'keyboardIgnore') {

            e.stopImmediatePropagation();

        } else if (!response.action) {

            e.stopImmediatePropagation();

            if (response.event === 'extraDecimals') {

                errorElm.text($(this).data('name') + ' decimal is not allowed.');

            } else if (response.event === 'allowDecimals') {

                errorElm.text($(this).data('name') + ' only 1 decimal is allowed.');

            } else if (response.event === 'maxLength' || response.event === 'extraLength') {

                errorElm.text($(this).data('name') + ' should be less than ' + $(this).data('maxlength') + " & greater than 0.");

            } else if (response.event === 'invalidNumber') {

                errorElm.text($(this).data('name') + ' does not accept special characters or incorrect values.');

            } else if (response.event === 'exception') {

                errorElm.text('');

            }

            errorElm.show();

            $(this).parents('.package-details').addClass('errorMargin')

        } else {

            errorElm.hide();

            $(this).parents('.package-details').removeClass('errorMargin')

        }

    })

    function updateDIMonModes() {

        var DIMFactor;

        let selectedCargoUnit = document.querySelector(".is-visible input[name='cargoDetails']:checked")?.value || document.querySelector(".is-visible input[name='shipmentDetails']:checked")?.value;

        let selectedModeElement = document.querySelector("input[name='mode-selection']:checked");

        let selectedMode = selectedModeElement.value;

        if (selectedCargoUnit == "KG_M" || selectedCargoUnit == "KG_M3") {

            $(".iaf.dim").text('1:6000');

            $(".naaf.dim").text('1:5000');

            $(".express.dim").text('1:5000');

            $(".ocean.dim").text('1:1000');

        } else {

            $(".iaf.dim").text('166');

            $(".naaf.dim").text('139');

            $(".express.dim").text('139');

            $(".ocean.dim").text('40');

        }

    }

    $(".ups-form_group.ups-input .ups-input_wrapper input").on("change keyup paste", function () {

        let closest = $(this).closest(".ups-form_group.ups-input");

        closest.find("input").addClass("has-value");

    })

    document.getElementById("naaf-mode").addEventListener('click', async () => {

        const linkData = {

      link_type: 'Button',

      link_name: 'Experiment',

      link_page_id: 'Chargeable',

      content_block_id: 'mkt_tools',

      event_id: 21,

    };

        trackPageViewOrAction({

            data: linkData,

            actionType: 'link'

        });

        console.log(linkData);

    });

</script>

Qu’est-ce que le poids facturable?

En transport de fret, le poids facturé peut ne pas correspondre au poids réel de votre envoi. C’est parce que les prestataires logistiques doivent tenir compte à la fois du poids et de l’espace pour établir les tarifs. Pour définir un système efficace et équitable, les prestataires logistiques utilisent le concept de « poids facturable ».

Le poids facturable correspond au plus élevé entre le poids réel et le poids volumétrique. Ce système aide les prestataires logistiques à gérer efficacement leur espace et à facturer équitablement les clients en fonction du poids et du volume. Pour éviter des frais d’expédition inattendus, notre outil gratuit de calcul du poids facturable peut vous aider à déterminer le poids facturable de vos marchandises. Cet outil utilise les normes de l’industrie pour le calcul, mais les résultats peuvent varier selon le transporteur.

Poids réel contre poids volumétrique

Poids réel : C’est simplement le poids de votre envoi lorsqu’il est placé sur une balance. Le poids réel peut aussi être appelé poids brut.

Poids volumétrique : Il reflète le volume de votre envoi, ou l’espace occupé par votre envoi par rapport à son poids réel. Le poids volumétrique convertit le volume en un équivalent de poids, établissant un poids minimal pour l’espace cubique occupé par un envoi. La méthode utilisée pour calculer ce poids varie selon le mode de transport ou la route commerciale, à l’aide d’un facteur dimensionnel.

Les transporteurs utilisent le poids volumétrique pour gérer l’équilibre entre la taille et le poids nécessaires lors du remplissage des conteneurs d’expédition.

Le coût d’un envoi est déterminé en fonction du poids réel ou du poids volumétrique, selon lequel des deux est le plus élevé.

Comment calculer le poids volumétrique

Pour calculer le poids volumétrique, mesurez votre envoi en arrondissant chaque mesure au nombre entier le plus proche. Ensuite, divisez son volume (unités x longueur x largeur x hauteur) par le facteur dimensionnel approprié, souvent abrégé en « dim factor ».

Votre facteur dimensionnel dépend du mode et des détails de votre envoi. Pour commencer dès maintenant, créez une soumission sur Portail UPS® Forwarding Hub. Entrez les spécifications de votre envoi et nous ferons le calcul pour vous.

Calcul : Mesurez les dimensions de votre fret : longueur, largeur et hauteur.
Utilisez la formule : (Unités x L x l x H)/facteur dimensionnel

Exemple pratique – Expédition d’oreillers contre des boulons et des écrous

Imaginez que vous expédiez une grande boîte remplie d’oreillers. Le poids réel est faible, mais la boîte est grande. Dans ce cas, le poids volumétrique sera utilisé pour tenir compte de l’espace que les oreillers occuperont.

À l’inverse, si vous expédiez une petite boîte remplie de boulons et d’écrous, le poids réel sera élevé, mais la boîte ne prendra pas beaucoup de place. Dans ce cas, le poids réel sera probablement supérieur au poids volumétrique, donc c’est celui-ci qui sera facturé.

img-left

https://delivery-p55671-e392469.adobeaemcloud.com/adobe/assets/urn:aaid:aem:9fd2047f-0003-4a0c-baed-ba8b8814ca33

Prêt à réserver votre fret?

Sur notre plateforme d’expédition Portail UPS® Forwarding Hub, cette calculatrice de poids facturable est intégrée aux étapes rapides de soumission. C’est une des façons dont nous facilitons et accélérons l’expédition de votre fret en ligne avec l’un des plus grands transitaires de fret au monde.

Commencer en obtenant une soumission pour le fret aérien ou maritime