X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fdn.pl;h=c16f6c34c27464b94dea1f931d65422686cf1cf8;hb=0d5b91f1e71d914fea9d006e64c63665f011b1ae;hp=a81d9452e6e9fa9b6290ccc2cb904a5e5b41e179;hpb=fec0904532e2136a1a769f568c351f4875257d56;p=kivitendo-erp.git
diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl
index a81d9452e..c16f6c34c 100644
--- a/bin/mozilla/dn.pl
+++ b/bin/mozilla/dn.pl
@@ -24,358 +24,151 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
#======================================================================
#
# Dunning process module
#
#======================================================================
+use POSIX qw(strftime);
+
use SL::IS;
-use SL::PE;
use SL::DN;
-use Data::Dumper;
+use SL::DB::Department;
+use SL::DB::Dunning;
+use SL::Helper::Flash qw(flash);
+use SL::Locale::String qw(t8);
+use SL::ReportGenerator;
require "bin/mozilla/common.pl";
+require "bin/mozilla/reportgenerator.pl";
require "bin/mozilla/io.pl";
-require "bin/mozilla/arap.pl";
+
+use strict;
1;
sub edit_config {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+
+ $main::auth->assert('config');
DN->get_config(\%myconfig, \%$form);
+ $form->get_lists('charts' => { 'key' => 'ALL_CHARTS',
+ 'transdate' => 'current_date' });
+
+ $form->{SELECT_AR_AMOUNT} = [];
+ $form->{SELECT_AR} = [];
- $form->{title} = $locale->text('Edit Dunning Process Config');
- $form->{callback} ||= build_std_url("action=edit_config");
- $form->{rowcount} = 1 + scalar @{ $form->{DUNNING} };
- $form->{rowcount_odd} = $form->{rowcount} % 2;
+ foreach my $chart (@{ $form->{ALL_CHARTS} }) {
+ $chart->{LINKS} = { map { $_, 1 } split m/:/, $chart->{link} };
+
+ if ($chart->{LINKS}->{AR}) {
+ $chart->{AR_selected} = "selected" if $chart->{id} == $form->{AR};
+ push @{ $form->{SELECT_AR} }, $chart;
+ }
+
+ if ($chart->{LINKS}->{AR_amount}) {
+ $chart->{AR_amount_fee_selected} = "selected" if $chart->{id} == $form->{AR_amount_fee};
+ $chart->{AR_amount_interest_selected} = "selected" if $chart->{id} == $form->{AR_amount_interest};
+ push @{ $form->{SELECT_AR_AMOUNT} }, $chart;
+ }
+ }
+
+ $form->{title} = $locale->text('Edit Dunning Process Config');
+ $form->{callback} ||= build_std_url("action=edit_config");
+
+ setup_dn_edit_config_action_bar();
$form->header();
print $form->parse_html_template("dunning/edit_config");
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub add {
- $lxdebug->enter_sub();
- # setup customer selection
- $form->all_vc(\%myconfig, "customer", "AR");
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+
+ $main::auth->assert('dunning_edit');
DN->get_config(\%myconfig, \%$form);
- if (@{ $form->{all_customer} }) {
- map { $customer .= "