From: Sven Schöling Date: Mon, 6 Jan 2014 15:06:39 +0000 (+0100) Subject: Merge branch 'master' of github.com:kivitendo/kivitendo-erp X-Git-Tag: release-3.1.0beta1~22^2~53^2~2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ebe71b37a511272a7e64c9bd06a6cc336480d224;hp=eabcf7e4139817fe88b5905d27f98d846ba67993;p=kivitendo-erp.git Merge branch 'master' of github.com:kivitendo/kivitendo-erp --- diff --git a/SL/DB/Manager/BackgroundJobHistory.pm b/SL/DB/Manager/BackgroundJobHistory.pm index 4f1ddd305..5d7b0d078 100644 --- a/SL/DB/Manager/BackgroundJobHistory.pm +++ b/SL/DB/Manager/BackgroundJobHistory.pm @@ -13,7 +13,7 @@ sub object_class { 'SL::DB::BackgroundJobHistory' } __PACKAGE__->make_manager_methods; sub _sort_spec { - return ( default => [ 'run_at', 1 ], + return ( default => [ 'run_at', 0 ], columns => { SIMPLE => 'ALL' } ); } diff --git a/SL/DN.pm b/SL/DN.pm index c38733e19..ebfa4f374 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -327,12 +327,13 @@ sub save_dunning { $form->{DUNNING_PDFS_EMAIL} = []; + $form->{dunning_id} = $dunning_id; + $self->create_invoice_for_fees($myconfig, $form, $dbh, $dunning_id); $self->print_invoice_for_fees($myconfig, $form, $dunning_id, $dbh); $self->print_dunning($myconfig, $form, $dunning_id, $dbh); - $form->{dunning_id} = $dunning_id; if ($send_email) { $self->send_email($myconfig, $form, $dunning_id, $dbh); diff --git a/SL/Presenter/Record.pm b/SL/Presenter/Record.pm index a00f40055..4f9a51830 100644 --- a/SL/Presenter/Record.pm +++ b/SL/Presenter/Record.pm @@ -37,7 +37,7 @@ sub grouped_record_list { $output .= _purchase_order_list( $self, $groups{purchase_orders}, %params) if $groups{purchase_orders}; $output .= _purchase_delivery_order_list($self, $groups{purchase_delivery_orders}, %params) if $groups{purchase_delivery_orders}; $output .= _purchase_invoice_list( $self, $groups{purchase_invoices}, %params) if $groups{purchase_invoices}; - $output .= _ar_transaction_list( $self, $groups{ar_transactions}, %params) if $groups{ar_transactions}; + $output .= _ap_transaction_list( $self, $groups{ap_transactions}, %params) if $groups{ap_transactions}; $output .= _sepa_collection_list( $self, $groups{sepa_collections}, %params) if $groups{sepa_collections}; $output .= _sepa_transfer_list( $self, $groups{sepa_transfers}, %params) if $groups{sepa_transfers}; diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 8e374ec51..abe345150 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -511,6 +511,10 @@ sub mark_as_paid_common { $referer =~ /^(.*)\?action\=[^\&]*(\&.*)$/; $script = $1; $callback = $2; + } elsif ($referer =~ /RESTORE_FORM_FROM_SESSION_ID/){ + $referer =~ /^(.*)\?RESTORE_FORM_FROM_SESSION_ID\=(.*)$/; + $script = $1; + $callback = ""; } else { $script = $referer; $callback = ""; diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index 01658ab10..9cac44e3a 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -251,7 +251,8 @@ sub save_dunning { $form->{language_id} = $saved_language_id; - if($form->{DUNNING_PDFS}) { + if (scalar @{ $form->{DUNNING_PDFS} }) { + $form->{dunning_id} = strftime("%Y%m%d", localtime time) if scalar @{ $form->{DUNNING_PDFS}} > 1; DN->melt_pdfs(\%myconfig, $form, $form->{copies}); } @@ -498,6 +499,7 @@ sub print_multiple { if (!$form->{force_lang}) { $form->{language_id} = $language_ids[$i]; } + $form->{dunning_id} = $dunning_id; DN->print_invoice_for_fees(\%myconfig, $form, $dunning_id); DN->print_dunning(\%myconfig, $form, $dunning_id); $i++; @@ -505,7 +507,7 @@ sub print_multiple { $form->{language_id} = $saved_language_id; if (scalar @{ $form->{DUNNING_PDFS} }) { - $form->{dunning_id} = strftime("%Y%m%d", localtime time); + $form->{dunning_id} = strftime("%Y%m%d", localtime time) if scalar @{ $form->{DUNNING_PDFS}} > 1; DN->melt_pdfs(\%myconfig, $form, $form->{copies}); if ($form->{media} eq 'printer') { diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 3e54c1ed8..b722e2081 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -412,7 +412,7 @@ sub update_delivery_order { map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] }; $form->{"marge_price_factor_$i"} = $form->{item_list}->[0]->{price_factor}; - $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}); + $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"} * (1 - $form->{tradediscount})); $form->{"lastcost_$i"} = $form->format_amount(\%myconfig, $form->{"lastcost_$i"}); $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); } diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 30124cf64..46e32fabc 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -116,43 +116,14 @@ sub invoice_links { } } - my ($payment_id, $language_id, $taxzone_id, $currency, $delivery_term_id); - if ($form->{payment_id}) { - $payment_id = $form->{payment_id}; - } - if ($form->{language_id}) { - $language_id = $form->{language_id}; - } - if ($form->{taxzone_id}) { - $taxzone_id = $form->{taxzone_id}; - } - if ($form->{currency}) { - $currency = $form->{currency}; - } - if ($form->{delivery_term_id}) { - $delivery_term_id = $form->{delivery_term_id}; - } + $form->backup_vars(qw(payment_id language_id taxzone_id + currency delivery_term_id intnotes cp_id)); - my $cp_id = $form->{cp_id}; IR->get_vendor(\%myconfig, \%$form); IR->retrieve_invoice(\%myconfig, \%$form); - $form->{cp_id} = $cp_id; - if ($payment_id) { - $form->{payment_id} = $payment_id; - } - if ($language_id) { - $form->{language_id} = $language_id; - } - if ($taxzone_id) { - $form->{taxzone_id} = $taxzone_id; - } - if ($currency) { - $form->{currency} = $currency; - } - if ($delivery_term_id) { - $form->{delivery_term_id} = $delivery_term_id; - } + $form->restore_vars(qw(payment_id language_id taxzone_id + currency delivery_term_id intnotes cp_id)); my @curr = $form->get_all_currencies(); map { $form->{selectcurrency} .= "