+ <script type="text/javascript">
+
+ // function toggle(id) {
+ // $('#skonto_' + id).change(function() {
+ // if($('#skonto_' + id).prop("checked")) {
+ // $('#' + id).val( $('#amount_less_skonto_' + id).val() );
+ // } else {
+ // $('#' + id).val( $('#invoice_open_amount_' + id).val() );
+ // }
+ // });
+ // };
+
+$( ".type_target" ).change(function() {
+ type_id = $(this).attr('id');
+ var id = type_id.match(/\d*$/);
+ // alert("found id " + id);
+ if ( $(this).val() == "without_skonto" ) {
+ $('#' + id).val( $('#invoice_open_amount_' + id).val() );
+ } else if ( $(this).val() == "difference_as_skonto" ) {
+ $('#' + id).val( $('#invoice_open_amount_' + id).val() );
+ } else if ( $(this).val() == "with_skonto_pt" ) {
+ $('#' + id).val( $('#amount_less_skonto_' + id).val() );
+ }
+});
+
+</script>