var productMappingModule = (function () { 


    $('.product-select-box').on('change',function(){

        var str = $(this).val();
        if(str) {

            
            $.ajax({
            url: base_url+'fetchAjaxData/fetchmappingDetail.php?key='+str,
            dataType: "json",
            type: 'GET',        
            success: function(data) {
               console.log(data);
                $("#pur_rate").val(data[0].purchase_rate);
                //$("#sale_rate").val(data[0].sale_rate);               
            },
            error: function() {
                console.log('An error has occurred');
            },
            
         });
        }
        else {
            console.log("please at lest one product");
        }
    });
    

})();