X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=da09648ca04fcda1abf22d9e2c2c90bd030eacc3;hb=5ee57de8a130f13418e9013102963e4336e72f6d;hp=7c9ee98efb02ed1ddae125905ae617dcfd1e105d;hpb=d0655093e8562bcc88ffe7283646b4ef3a2aa4a8;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 7c9ee98ef..da09648ca 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -452,10 +452,10 @@ sub form_footer { $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2); $TMPL_VAR{tax} .= qq| - - $form->{"${item}_description"} | . $form->{"${item}_rate"} * 100 .qq|% - $form->{"${item}_total"} - |; + + $form->{"${item}_description"} | . $form->{"${item}_rate"} * 100 .qq|% + $form->{"${item}_total"} + |; } } @@ -470,14 +470,14 @@ sub form_footer { $form->{"${item}_netto"} = $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2); $TMPL_VAR{tax} .= qq| - - Enthaltene $form->{"${item}_description"} | . $form->{"${item}_rate"} * 100 .qq|% - $form->{"${item}_total"} - - - Nettobetrag - $form->{"${item}_netto"} - |; + + Enthaltene $form->{"${item}_description"} | . $form->{"${item}_rate"} * 100 .qq|% + $form->{"${item}_total"} + + + Nettobetrag + $form->{"${item}_netto"} + |; } } } @@ -552,7 +552,7 @@ sub update { my $rows = scalar @{ $form->{item_list} }; # hier ist das problem fuer bug 817 $form->{discount} wird nicht durchgeschliffen - # ferner fallunterscheidung fuer verkauf oder einkauf s.a. bug 736 jb 04.05.2009 + # ferner fallunterscheidung fuer verkauf oder einkauf s.a. bug 736 jb 04.05.2009 # select discount as vendor_discount from vendor || # select discount as customer_discount from customer $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"$form->{vc}_discount"} * 100); @@ -745,7 +745,8 @@ sub orders { "shipvia", "globalprojectnumber", "transaction_description", "open", "delivered", "marge_total", "marge_percent", - "country", "ustid", + "vcnumber", "ustid", + "country", ); # only show checkboxes if gotten here via sales_order form. @@ -782,7 +783,7 @@ sub orders { my @hidden_variables = map { "l_${_}" } @columns; push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber transaction_description transdatefrom transdateto type vc employee_id salesman_id - reqdatefrom reqdateto projectnumber); + reqdatefrom reqdateto projectnumber project_id); my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables); @@ -807,6 +808,7 @@ sub orders { 'delivered' => { 'text' => $locale->text('Delivered'), }, 'marge_total' => { 'text' => $locale->text('Ertrag'), }, 'marge_percent' => { 'text' => $locale->text('Ertrag prozentual'), }, + 'vcnumber' => { 'text' => $form->{vc} eq 'customer' ? $locale->text('Customer Number') : $locale->text('Vendor Number'), }, 'country' => { 'text' => $locale->text('Country'), }, 'ustid' => { 'text' => $locale->text('USt-IdNr.'), }, ); @@ -1057,8 +1059,8 @@ sub save_and_close { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history @@ -1164,8 +1166,8 @@ sub save { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history @@ -1252,8 +1254,8 @@ sub delete_order_quotation { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; - $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history $form->info($msg); @@ -1367,7 +1369,8 @@ sub invoice { $form->{type} = "invoice"; # locale messages - $locale = new Locale "$myconfig{countrycode}", "$script"; + $main::locale = new Locale "$myconfig{countrycode}", "$script"; + $locale = $main::locale; require "bin/mozilla/$form->{script}"; @@ -1457,16 +1460,16 @@ sub backorder_exchangerate { - - - - - - - + + + + + + + - - + +
| . $locale->text('Currency') . qq|$form->{currency}
| . $locale->text('Date') . qq|$orddate
| . $locale->text('Currency') . qq|$form->{currency}
| . $locale->text('Date') . qq|$orddate
| . $locale->text('Exchangerate') . qq|| . $locale->text('Exchangerate') . qq|
@@ -1685,7 +1688,9 @@ sub purchase_order { check_oe_access(); $main::auth->assert('purchase_order_edit'); + $form->{sales_order_to_purchase_order} = 0; if ($form->{type} eq 'sales_order') { + $form->{sales_order_to_purchase_order} = 1; check_for_direct_delivery(); } @@ -1703,6 +1708,8 @@ sub purchase_order { &poso; + delete $form->{sales_order_to_purchase_order}; + $main::lxdebug->leave_sub(); } @@ -1751,8 +1758,14 @@ sub poso { $form->{old_salesman_id} = $form->{salesman_id}; # reset - map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal delivered - ordnumber); + map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal delivered ordnumber); + + # if purchase_order was generated from sales_order, use lastcost_$i as sellprice_$i + if ( $form->{sales_order_to_purchase_order} ) { + for my $i (1 .. $form->{rowcount}) { + $form->{"sellprice_${i}"} = $form->format_amount(\%myconfig,$form->{"lastcost_${i}"}); + }; + }; for my $i (1 .. $form->{rowcount}) { map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice listprice basefactor discount);