<script type="text/javascript">

	function viewVendorPayments(event,route)
	{
		event.preventDefault();

		showLoader();
         
		$.get(route,function(data)
		{
			$('#table_view_vendor_payment').html(data);

			$('#md_view_vendor_payment').modal('show');

        	removeLoader();
    		
  		});

	}


	function showVendorPaymentUpdateModel(event,route,key_element)
	{
		event.preventDefault();

		showLoader();
         
		$.get(route,function(data)
		{
			$('#model_update_vendor_payment').html(data);

			$('#md_update_vendor_payment').modal('show');

			setFstDropdown();

	        // document.querySelector('.credit_list_'+key_element).fstdropdown.rebind();

			// setFstDropdown();
	        

	        // document.querySelector('.debit_list_'+key_element).fstdropdown.rebind();


        	removeLoader();
    		
  		});

	}

	function backOpenModel(open_model,close_model)
	{
		$(open_model).modal('show');

		$(close_model).modal('hide');
	}

	function paymentOptionWiseSubheadList(event,obj,key_element)
	{
		var route = "{{route('paymentoptionsubheads')}}";

		var formdata = {_token:token,'payment_option':$(obj).val()};

        showLoader();


		$.post(route, formdata, function(result)
		{
			$('.debit_list_'+key_element).html(result.debit_list);

    		setFstDropdown();

	        document.querySelector('.debit_list_'+key_element).fstdropdown.rebind();

	        $('.credit_list_'+key_element).html(result.credit_list);

    		setFstDropdown();

	        document.querySelector('.credit_list_'+key_element).fstdropdown.rebind();

        	removeLoader();

			
        },'json')
        .fail(function(data) {

        	removeLoader();

			       
		    
		  });	 
	}

	
	
</script>