Skip to content

Commit 51ece6f

Browse files
committed
Use sanitized tariff number
1 parent 165fdc4 commit 51ece6f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShipping Customs/WooShippingCustomsFormViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ private extension WooShippingCustomsFormViewModel {
211211
quantity: $0.itemQuantity,
212212
value: Double($0.valuePerUnit) ?? 0,
213213
weight: Double($0.weightPerUnit) ?? 0,
214-
hsTariffNumber: $0.isValidTariffNumber ? $0.hsTariffNumber : "",
214+
hsTariffNumber: $0.isValidTariffNumber ? $0.sanitizedHSTariffNumber : "",
215215
originCountry: $0.selectedCountry?.code ?? "",
216216
productID: $0.itemProductID
217217
)

WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShipping Customs/WooShippingCustomsItemViewModel.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ final class WooShippingCustomsItemViewModel: ObservableObject {
5252
return HSTariffNumberValidator.isNumberValid(hsTariffNumber)
5353
}
5454

55+
var sanitizedHSTariffNumber: String {
56+
HSTariffNumberValidator.sanitize(hsTariffNumber)
57+
}
58+
5559
@Published var requiredInformationIsEntered: Bool = false
5660

5761
private var cancellables = Set<AnyCancellable>()

0 commit comments

Comments
 (0)