mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 10:17:33 -04:00 
			
		
		
		
	Working on gateway fees
This commit is contained in:
		
							parent
							
								
									d1b8d771f6
								
							
						
					
					
						commit
						f1c464c4cf
					
				| @ -2404,7 +2404,7 @@ $LANG = array( | |||||||
|     'fee_amount' => 'Amount', |     'fee_amount' => 'Amount', | ||||||
|     'fee_percent' => 'Percent', |     'fee_percent' => 'Percent', | ||||||
|     'fees_tax_help' => 'Enable line item taxes to set fee tax rates.', |     'fees_tax_help' => 'Enable line item taxes to set fee tax rates.', | ||||||
|     'fees_sample' => 'For a :amount invoice the fees would be :total.', |     'fees_sample' => 'The fee for a :amount invoice would be :total.', | ||||||
| 
 | 
 | ||||||
| ); | ); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -203,9 +203,12 @@ | |||||||
|         var modalLabel = {!! json_encode(trans('texts.set_limits_fees')) !!}; |         var modalLabel = {!! json_encode(trans('texts.set_limits_fees')) !!}; | ||||||
|         $('#paymentLimitsModalLabel').text(modalLabel.replace(':gateway_type', gateway_type)); |         $('#paymentLimitsModalLabel').text(modalLabel.replace(':gateway_type', gateway_type)); | ||||||
| 
 | 
 | ||||||
|         limitsSlider.noUiSlider.set([settings.min_limit !== null ? settings.min_limit : 0, settings.max_limit !== null ? settings.max_limit : 100000]); | 		var min_limit = settings ? settings.min_limit : null; | ||||||
|  | 		var max_limit = settings ? settings.max_limit : null | ||||||
| 
 | 
 | ||||||
|         if (settings.min_limit !== null) { | 		limitsSlider.noUiSlider.set([min_limit !== null ? min_limit : 0, max_limit !== null ? max_limit : 100000]); | ||||||
|  | 
 | ||||||
|  |         if (min_limit !== null) { | ||||||
|             $('#payment-limit-min').removeAttr('disabled'); |             $('#payment-limit-min').removeAttr('disabled'); | ||||||
|             $('#payment-limit-min-enable').prop('checked', true); |             $('#payment-limit-min-enable').prop('checked', true); | ||||||
|         } else { |         } else { | ||||||
| @ -213,7 +216,7 @@ | |||||||
|             $('#payment-limit-min-enable').prop('checked', false); |             $('#payment-limit-min-enable').prop('checked', false); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (settings.max_limit !== null) { |         if (max_limit !== null) { | ||||||
|             $('#payment-limit-max').removeAttr('disabled'); |             $('#payment-limit-max').removeAttr('disabled'); | ||||||
|             $('#payment-limit-max-enable').prop('checked', true); |             $('#payment-limit-max-enable').prop('checked', true); | ||||||
|         } else { |         } else { | ||||||
| @ -222,12 +225,17 @@ | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         $('#payment-limit-gateway-type').val(gateway_type_id); |         $('#payment-limit-gateway-type').val(gateway_type_id); | ||||||
|  | 
 | ||||||
|  | 		if (settings) { | ||||||
| 			$('#fee_amount').val(settings.fee_amount); | 			$('#fee_amount').val(settings.fee_amount); | ||||||
| 			$('#fee_percent').val(settings.fee_percent); | 			$('#fee_percent').val(settings.fee_percent); | ||||||
| 			setTaxRate(1, settings.fee_tax_name1, settings.fee_tax_rate1); | 			setTaxRate(1, settings.fee_tax_name1, settings.fee_tax_rate1); | ||||||
| 			setTaxRate(2, settings.fee_tax_name2, settings.fee_tax_rate2); | 			setTaxRate(2, settings.fee_tax_name2, settings.fee_tax_rate2); | ||||||
|  | 		} | ||||||
| 
 | 
 | ||||||
|         $('#paymentLimitsModal').modal('show'); |         $('#paymentLimitsModal').modal('show'); | ||||||
|  | 		 | ||||||
|  | 		updateFeeSample(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     var limitsSlider = document.getElementById('payment-limits-slider'); |     var limitsSlider = document.getElementById('payment-limits-slider'); | ||||||
| @ -288,7 +296,7 @@ | |||||||
| 		var feePercent = NINJA.parseFloat($('#fee_percent').val()) || 0; | 		var feePercent = NINJA.parseFloat($('#fee_percent').val()) || 0; | ||||||
| 		var total = feeAmount + feePercent | 		var total = feeAmount + feePercent | ||||||
| 		var subtotal = total; | 		var subtotal = total; | ||||||
| 
 | 		console.log('feeAmount: %s', feeAmount); | ||||||
| 		var taxRate1 = $('#tax_rate1').val(); | 		var taxRate1 = $('#tax_rate1').val(); | ||||||
| 		if (taxRate1) { | 		if (taxRate1) { | ||||||
| 			taxRate1 = NINJA.parseFloat(taxRatesMap[taxRate1].rate); | 			taxRate1 = NINJA.parseFloat(taxRatesMap[taxRate1].rate); | ||||||
| @ -339,13 +347,6 @@ | |||||||
| 		onTaxRateChange(instance); | 		onTaxRateChange(instance); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@if (Utils::isNinja()) |  | ||||||
| 		updateFeeSample(); |  | ||||||
| 		$(function() { |  | ||||||
| 			javascript:showLimitsModal('Credit Card', 1); |  | ||||||
| 		}); |  | ||||||
| 	@endif |  | ||||||
| 
 |  | ||||||
|   </script> |   </script> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user