<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>モードの選択</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>国際航空貨物<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>北米航空貨物<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>エクスプレス<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<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>寸法の計算方法:</h2><ul class=category-btn-grp><li><span id=cargo-details-btn class="category-btn category-active">貨物の詳細</span><li><span id=shipment-details-btn class=category-btn>シップメント合計</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>ポンド/インチ</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>タイプ</label><div class="ups-input_wrapper ups-dropdown_wrapper"><select class=ups-dropdown name=selectCargoItems><option value=Loose/Boxes>バラ積み/ボックス<option value=Pallets>パレット</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>数量</label><span id=errorCargoQuantity class=error-msg>数量には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>重量(<span id=cargo-weight-unit class=cargo-weight-unit>kg</span>)</label><span id=errorCargoWeight class=error-msg>重量には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>長さ(<span id=cargo-length-unit class=cargo-length-unit>cm</span>)</label> <span id=errorCargoLength class=error-msg>長さには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>幅(<span id=cargo-width-unit class=cargo-width-unit>cm</span>)</label> <span id=errorCargoWidth class=error-msg>幅には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>高さ(<span id=cargo-height-unit class=cargo-height-unit>cm</span>)</label> <span id=errorCargoHeightKGCM class=error-msg>高さには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></div><ul class=result-calculation><li class=value><p>合計数量<h4><span id=cargo-total-quantity>0</span></h4><li class=value><p>総容積<h4><span id=cargo-total-volume>0 </span><span id=cargo-total-volume-unit>m</span><sup>3</sup></h4><li class=value><p>総重量<h4><span id=cargo-total-weight>0 </span><span id=cargo-total-weight-unit>kg</span></h4><li class=value><p>容積重量<h4><span id=cargo-dimensional-weight>0 </span><span id=cargo-dimensional-weight-unit>kg</span></h4><li class=value><p>請求重量(概算)<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>タイプ</label><div class="ups-input_wrapper ups-dropdown_wrapper"><select class=ups-dropdown name=selectCargoItems><option value=Loose/Boxes>バラ積み/ボックス<option value=Pallets>パレット</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>合計数量</label><span id=errorShipmentQuantity class=error-msg>数量には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>総重量(<span id=shipment-weight-unit>kg</span>)</label><span id=errorShipmentWeight class=error-msg>重量には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>総容積(<span id=shipment-volume-unit>m</span><sup>3</sup>)</label><span id=errorShipmentVolume class=error-msg>容積には999999999より小さい値を指定してください</span></div></ul></div></div></div><ul class=result-calculation><li class=value><p>合計数量<h4><span id=shipment-total-quantity>0</span></h4><li class=value><p>総容積<h4><span id=shipment-total-volume>0 </span><span id=shipment-total-volume-unit>m</span><sup>3</sup></h4><li class=value><p>総重量<h4><span id=shipment-total-weight>0 </span><span id=shipment-total-weight-unit>kg</span></h4><li class=value><p>容積重量<h4><span id=shipment-dimensional-weight>0 </span><span id=shipment-dimensional-weight-unit>kg</span></h4><li class=value><p>請求重量(概算)<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>正確な見積もりを得る</h2></div><div class=banner-body-content><p>UPS<sup>®</sup> Forwarding Hub配送プラットフォームで、輸送を検討されている貨物の詳細をご記入いただくだけで、これらの寸法データを転送いたします。</div></div><div class=banner-btn><p><a class="ups-analytics ups-cta ups-cta-primary"href=https://scsapps.ups.com/forwardinghub/jp/ja/quotes/ aria-label="Get an Exact Quote"data-utg-link-name=Ship_Your_Freight data-utg-onsite-ad-position=1 id=submit target=_blank>貨物を発送する<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>今すぐ発送したい海上貨物がございますか?</h2></div><div class=banner-body-content><p>UPS<sup>®</sup> Forwarding Hub配送プラットフォームで、輸送を検討されている貨物の詳細をご記入いただくだけで、これらの寸法データを転送いたします。</div></div><div class=banner-btn><p><a class="ups-analytics ups-cta ups-cta-primary"href=https://scsapps.ups.com/forwardinghub/jp/ja/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>貨物を発送する<span class="icon ups-icon-right-arrow"aria-hidden=true></span></a></div></div></div><div class=disclaimer><small><em>注: こちらの計算ツールおよび参考情報は、情報提供とお見積りのみを目的としています。UPSは、計算ツールまたは参考情報の正確性について一切の保証をいたしません。UPSが書面で明示的に同意しない限り、いかなる状況においてもお見積りはUPSを拘束するものではありません。実重量および実際の費用は異なる可能性があり、予告なく変更されることがあります。</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/jp/ja/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>
請求重量とは?
貨物輸送では、ご請求の対象となる重量と貨物の実重量が一致しないことがあります。これは、物流業者が運賃を決定する際に、重量と貨物スペース(容量)の両方を考慮に入れる必要があるためです。効率的かつ公平なシステムを決定するために、物流業者は「請求重量」という概念を採用しています。
請求重量は、実重量と容積重量のうち大きい方になります。 このシステムを採用することで、物流業者は貨物スペースを効率的に管理し、重量と容積に基づいて顧客に公平に運賃を請求することができます。予想していなかった配送料の請求を避けるために、UPSの請求重量計算ツールをお使いください。お客様の貨物の請求重量を無料で計算いたします。この計算ツールは、業界水準を使って重量の計算を行いますが、実際の計算結果は運送業者によって異なることがあります。
実重量と容積重量(体積重量)
実重量: これは貨物を秤に載せたときの重さで、実重量は総重量とも呼ばれます。
容積重量(体積重量): これは、貨物の容積、つまり実重量に対して貨物が占めるスペースの量が反映された値です。容積重量は容積を重量に換算して、貨物が占める立方空間の最小重量を決定します。この重量の計算方法は輸送手段または取引レーンによって異なり、計算には容積係数が使われています。
運送業者は容積重量を使って、輸送コンテナに貨物を積み込む際に考慮しなければならない貨物のサイズと重量のバランスを管理しています。
貨物の輸送料金は、実重量または容積重量のいずれか大きい方に基づいて決定されます。
容積重量の計算方法
容積重量を計算するには、まず貨物のサイズを測定し、各測定値を最も近い整数に丸めます。次に、そのサイズ(個数 x 長さ x 幅 x 高さ)を、適切な寸法係数(dimensional factor、通常は略してdim係数と呼ばれます)で割ります。
dim係数は、貨物の輸送手段と詳細情報によって異なります。貨物の発送を検討されている方は、今すぐUPS® Forwarding Hubでお見積りをお申し込みください。貨物の仕様を記入していただくと、その料金が計算されます。
計算: 貨物の寸法を測定:(長さ、幅、高さ)。
次の式を使用:(個数 x 長さ x 幅 x 高さ)/dim係数
例 – 「枕」と「ナットとボルト」
枕を一杯詰めた大きな箱を発送すると想像してください。実重量は軽いですが、箱のサイズは大きくなります。この場合、枕が占める貨物スペースを考慮するために容積重量が使われます。
一方、ナットやボルトが詰まった小さな箱を発送する場合、実重量は重くなりますが、箱は貨物スペースをそれほど取りません。この場合、実重量は容積重量よりも高くなる可能性が高いため、実重量に基づいて料金が請求されます。