X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fir.pl;h=1f18c1fc3c7f7fbe4a7e68758900b8b228f308bc;hb=5fd2cf413e611047a3b8d667378a258a7955941e;hp=1dafe84512a9477845950fe29e474d6c80994498;hpb=6cf3f7762efd40bee49a2b8f11bb4ab6915d9071;p=kivitendo-erp.git
diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl
index 1dafe8451..1f18c1fc3 100644
--- a/bin/mozilla/ir.pl
+++ b/bin/mozilla/ir.pl
@@ -100,7 +100,7 @@ sub invoice_links {
$form->{vc} = 'vendor';
# create links
- $form->{webdav} = $main::webdav;
+ $form->{webdav} = $::lx_office_conf{features}->{webdav};
$form->{jsscript} = 1;
$form->create_links("AP", \%myconfig, "vendor");
@@ -171,7 +171,7 @@ sub invoice_links {
foreach my $key (keys %{ $form->{AP_links} }) {
foreach my $ref (@{ $form->{AP_links}{$key} }) {
- $form->{"select$key"} .= "";
}
next unless $form->{acc_trans}{$key};
@@ -226,6 +226,12 @@ sub prepare_invoice {
foreach my $ref (@{ $form->{invoice_details} }) {
$i++;
map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
+ # übernommen aus is.pl Fix für Bug 1642. Nebenwirkungen? jb 12.5.2011
+ # getestet: Lieferantenauftrag -> Rechnung i.O.
+ # Lieferantenauftrag -> Lieferschein -> Rechnung i.O.
+ # Werte: 20% (Lieferantenrabatt), 12,4% individuell und 0,4 individuell s.a.
+ # Screenshot zu Bug 1642
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
my ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
$dec = length $dec;
@@ -256,7 +262,7 @@ sub form_header {
my $locale = $main::locale;
my $cgi = $main::cgi;
- $main::auth->assert('invoice_edit');
+ $main::auth->assert('vendor_invoice_edit');
my %TMPL_VAR = ();
my @custom_hiddens;
@@ -354,7 +360,7 @@ sub form_footer {
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- $main::auth->assert('invoice_edit');
+ $main::auth->assert('vendor_invoice_edit');
$form->{invtotal} = $form->{invsubtotal};
$form->{oldinvtotal} = $form->{invtotal};
@@ -393,9 +399,17 @@ sub form_footer {
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
$form->{paid_indices} = [ 1 .. $form->{paidaccounts} ];
+ # Standard Konto für Umlaufvermögen
+ my $accno_arap = IS->get_standard_accno_current_assets(\%myconfig, \%$form);
+
for my $i (1 .. $form->{paidaccounts}) {
$form->{"selectAP_paid_$i"} = $form->{selectAP_paid};
- $form->{"selectAP_paid_$i"} =~ s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/;
+ if (!$form->{"AP_paid_$i"}) {
+ $form->{"selectAP_paid_$i"} =~ s/option>$accno_arap--(.*?)>/option selected>$accno_arap--$1>/;
+ } else {
+ $form->{"selectAP_paid_$i"} =~ s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/;
+ }
+
$totalpaid += $form->{"paid_$i"};
}