Language: JavaScript
Label: safe
CWE: CWE-352 \u2014 Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.

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();
    
};