+$( ".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>