X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=1836a6bfa6ec059ca6c775715d03bdcb0232099c;hb=088f6a9721fece191bcc8d11a144b3b958b6c0c8;hp=3cae60e677eb118b31b0ecd2bc839bd9d206bdcf;hpb=077ebb6c7e6b6ba243da85dbede70ff57927db01;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index 3cae60e67..1836a6bfa 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -903,6 +903,9 @@ sub post_invoice { $form->{"exchangerate_$i"}, 0); } } + + } else { # if (!$form->{storno}) + $form->{marge_total} *= -1; } if ($payments_only) { @@ -939,24 +942,6 @@ sub post_invoice { $amount = $netamount + $tax; - # fill in subject if there is none - $form->{subject} = qq|$form->{label} $form->{invnumber}| - unless $form->{subject}; - - # if there is a message stuff it into the intnotes - my $cc = "Cc: $form->{cc}\\r\n" if $form->{cc}; - my $bcc = "Bcc: $form->{bcc}\\r\n" if $form->{bcc}; - my $now = scalar localtime; - $form->{intnotes} .= qq|\r -\r| if $form->{intnotes}; - - $form->{intnotes} .= qq|[email]\r -Date: $now -To: $form->{email}\r -$cc${bcc}Subject: $form->{subject}\r -\r -Message: $form->{message}\r| if $form->{message}; - # save AR record $query = qq|UPDATE ar set invnumber = ?, @@ -1012,7 +997,7 @@ Message: $form->{message}\r| if $form->{message}; conv_i($form->{"employee_id"}), conv_i($form->{"salesman_id"}), $form->{"storno"} ? 't' : 'f', conv_i($form->{storno_id}), conv_i($form->{"globalproject_id"}), conv_i($form->{"cp_id"}), $form->{transaction_description}, - $form->{marge_total}, $form->{marge_percent}, + $form->{marge_total} * 1, $form->{marge_percent} * 1, conv_i($form->{"id"})); do_query($form, $dbh, $query, @values); @@ -1414,6 +1399,7 @@ sub retrieve_invoice { a.employee_id, a.salesman_id, a.payment_id, a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type, a.transaction_description, + a.marge_total, a.marge_percent, e.name AS employee FROM ar a LEFT JOIN employee e ON (e.id = a.employee_id)