Calculadora de peso facturable
Calcule el peso facturable de cualquiera de sus envíos de carga, en todos los modos, transportistas y países con la calculadora a continuación.
<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; } @media (max-width: 767px) { .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%; } } .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; } </style>
<div class="chargeable-weight-calculator ups-container"><div class=inner-container><div class=mode-selection-container><h2 class=mode-selection-label>Seleccione un modo</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-analytics ups-radio-custom"id=iaf-mode value=iaf-mode checked> <label class=ups-radio-custom-label for=iaf-mode><div class=mode-label>Carga aérea internacional<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-analytics ups-radio-custom"id=naaf-mode value=naaf-mode> <label class=ups-radio-custom-label for=naaf-mode><div class=mode-label>Carga aérea en América del Norte<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-analytics ups-radio-custom"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-analytics ups-radio-custom"id=oceanlcl-mode value=oceanlcl-mode> <label class=ups-radio-custom-label for=oceanlcl-mode><div class=mode-label>LCL marítimo<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>Dimensiones calculadas por</h2><ul class=category-btn-grp><li><span id=cargo-details-btn class="category-btn category-active">Detalles de la carga</span><li><span id=shipment-details-btn class=category-btn>Totales de envíos</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-analytics ups-radio-custom"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-analytics ups-radio-custom"id=radio-cargoDetails-1 value=LB_INCH> <label class="ups-radio-custom-label updateForm"for=radio-cargoDetails-1>lb/in</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>Tipo</label><div class="ups-input_wrapper ups-dropdown_wrapper"><select class=ups-dropdown name=selectCargoItems><option value=Loose/Boxes>Cajas sueltas<option value=Pallets>Paletas</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>Cantidad</label><span id=errorCargoQuantity class=error-msg>La cantidad debe ser menos de 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>Peso (<span id=cargo-weight-unit class=cargo-weight-unit>kg</span>)</label><span id=errorCargoWeight class=error-msg>El peso debe ser menos de 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>Largo (<span id=cargo-length-unit class=cargo-length-unit>cm</span>)</label> <span id=errorCargoLength class=error-msg>El largo debe ser menos de 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>Ancho (<span id=cargo-width-unit class=cargo-width-unit>cm</span>)</label> <span id=errorCargoWidth class=error-msg>El ancho debe ser menos de 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>Altura (<span id=cargo-height-unit class=cargo-height-unit>cm</span>)</label> <span id=errorCargoHeightKGCM class=error-msg>La altura debe ser menos de 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> Añadir otro artículo de carga</a></div><ul class=result-calculation><li class=value><p>Cantidad total<h4><span id=cargo-total-quantity>0</span></h4><li class=value><p>Volumen 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>Peso bruto<h4><span id=cargo-total-weight>0 </span><span id=cargo-total-weight-unit>kg</span></h4><li class=value><p>Peso dimensional<h4><span id=cargo-dimensional-weight>0 </span><span id=cargo-dimensional-weight-unit>kg</span></h4><li class=value><p>Peso facturable estimado<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/ft <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>Tipo</label><div class="ups-input_wrapper ups-dropdown_wrapper"><select class=ups-dropdown name=selectCargoItems><option value=Loose/Boxes>Cajas sueltas<option value=Pallets>Paletas</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>Cantidad total</label><span id=errorShipmentQuantity class=error-msg>La cantidad debe ser menos de 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>Peso total (<span id=shipment-weight-unit>kg</span>)</label><span id=errorShipmentWeight class=error-msg>El peso debe ser menos de 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>Volumen total (<span id=shipment-volume-unit>m</span><sup>3</sup>)</label><span id=errorShipmentVolume class=error-msg>El volumen debe ser menos de 999999999</span></div></ul></div></div></div><ul class=result-calculation><li class=value><p>Cantidad total<h4><span id=shipment-total-quantity>0</span></h4><li class=value><p>Volumen 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>Peso bruto<h4><span id=shipment-total-weight>0 </span><span id=shipment-total-weight-unit>kg</span></h4><li class=value><p>Peso dimensional<h4><span id=shipment-dimensional-weight>0 </span><span id=shipment-dimensional-weight-unit>kg</span></h4><li class=value><p>Peso facturable estimado<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>Obtenga una cotización exacta</h2></div><div class=banner-body-content><p>Para trasladar su carga, ingrese los detalles de su envío en la plataforma de envíos de UPS<sup>®</sup> Forwarding Hub y transferiremos estas dimensiones.</div></div><div class=banner-btn><p><a class="ups-analytics ups-cta ups-cta-primary"href=https://scsapps.ups.com/forwardinghub/ar/es/quotes/ aria-label="Get an Exact Quote"data-utg-link-name=Ship_Your_Freight data-utg-onsite-ad-position=1 id=submit target=_blank>Envíe su carga<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>¿Listo para enviar su carga marítima?</h2></div><div class=banner-body-content><p>Para trasladar su carga, ingrese los detalles de su envío en la plataforma de envíos de UPS<sup>®</sup> Forwarding Hub y transferiremos estas dimensiones.</div></div><div class=banner-btn><p><a class="ups-analytics ups-cta ups-cta-primary"href=https://scsapps.ups.com/forwardinghub/ar/es/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>Envíe su carga<span class="icon ups-icon-right-arrow"aria-hidden=true></span></a></div></div></div><div class=disclaimer><small><em>Nota: Esta calculadora y contenido educativo solo tienen fines informativos y de cotización. UPS no garantiza la exactitud de la calculadora ni del contenido educativo. Los presupuestos no serán vinculantes en ningún caso para UPS, a menos que UPS lo acuerde específicamente por escrito. El peso y los costos reales pueden variar y están sujetos a cambios sin previo aviso.</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/ar/es/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");
})
</script>
¿Qué es el peso facturable?
En el envío de carga, el peso que se le cobra puede no coincidir con el peso real de su envío. Esto se debe a que los proveedores de logística deben tener en cuenta tanto el peso como el espacio a la hora de decidir las tarifas. Para determinar un sistema eficaz y justo, los proveedores de logística utilizan el concepto de “peso facturable”.
El peso facturable es el valor mayor entre el peso real y el peso dimensional. Este sistema ayuda a los proveedores de logística a gestionar su espacio de forma eficiente y a cobrar a los clientes de forma justa en función tanto del peso como del volumen. Para evitar gastos de envío inesperados, nuestra herramienta gratuita de cálculo del peso facturable puede ayudarle a determinar el peso facturable de sus mercancías. Esta calculadora utiliza estándares del sector para calcular el peso, pero los cálculos reales pueden variar según el transportista.
Peso real frente a peso dimensional (peso volumétrico)
Peso real: se trata simplemente de cuánto pesa su envío cuando lo coloca en una báscula. El peso real también puede denominarse peso bruto.
peso dimensional (peso volumétrico): refleja el volumen de su envío, o la cantidad de espacio que ocupa su envío en relación con su peso real. El peso dimensional convierte el volumen en un equivalente de peso, estableciendo un peso mínimo para el espacio que ocupa un envío. El método utilizado para calcular este peso varía según el modo de transporte o la ruta comercial, usando un factor dimensional.
Los transportistas utilizan el peso dimensional para ayudar a manejar el equilibrio entre el tamaño y el peso que es necesario tener en cuenta al llenar los contenedores de envío.
El costo de un envío se determina en función del peso real o el peso dimensional, el que sea mayor.
Cómo calcular el peso dimensional
Para calcular el peso dimensional, mida su envío redondeando cada medida al número entero más próximo. A continuación, divida el volumen (unidades x largo x ancho x altura) por el factor dimensional apropiado.
El factor dimensional depende del modo de envío y los detalles. Para empezar ahora, genere un presupuesto en el UPS® Forwarding Hub. Ingrese las especificaciones de su envío y lo calcularemos por usted.
Cálculo: mida las dimensiones de su carga: largo, ancho y alto.
Use la fórmula: (unidades x largo x ancho x alto)/factor dimensional
Ejemplo práctico: enviar almohadas frente a enviar tuercas y tornillos
Imagine que envía una caja grande llena de almohadas. El peso real es bajo, pero la caja es grande. En este caso, se utilizará el peso dimensional para tener en cuenta el espacio que ocuparán las almohadas.
Por otro lado, si envía una caja pequeña llena de tuercas y tornillos, el peso real será elevado, pero la caja no ocupará mucho espacio. En este caso, es probable que el peso real sea mayor que el peso dimensional, así es que eso es lo que se le cobrará.