Language: JavaScript
Label: safe
CWE: CWE-829 \u2014 Inclusion of Functionality from Untrusted Control Sphere
The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.

Code:
BMS.ORDER.productQntCheck = function(selector, event) {

    // Count Sub total for each product. 
    var netSalesPrice = $(selector).closest("tr").find(".netSalesPrice").val();
    var Quantity = $(selector).val();
    var Discount = $(selector).closest("tr").find(".productDiscount").val();
    var SubtotalRow = $(selector).closest("tr").find("td.subtotalCol");

    // If the product quantity less then 1 then throw an error
    if(Quantity == 0) {

        // Display the error message
        Swal.fire({
            title: "Error!",
            text: "Product qunatity can not be zero (0)",
            icon: "error"
        });

        // Set product quantity 1
        $(selector).val(1);
        Quantity = 1;

    }

    // Display Subtotal for each product
    $(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(netSalesPrice,Discount) * Quantity).toFixed(2));

    // Call the grand total
    this.grandTotal();
    
};