ActionBar: Verwendung in Berichtsfunktion in do.pl
[kivitendo-erp.git] / bin / mozilla / dn.pl
index 8008f25..c6c520e 100644 (file)
@@ -24,7 +24,8 @@
 # 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
@@ -34,8 +35,8 @@
 use POSIX qw(strftime);
 
 use SL::IS;
-use SL::PE;
 use SL::DN;
+use SL::DB::Department;
 use SL::DB::Dunning;
 use SL::Helper::Flash qw(flash);
 use SL::Locale::String qw(t8);
@@ -98,12 +99,8 @@ sub add {
 
   $main::auth->assert('dunning_edit');
 
-  # setup customer selection
-  $form->all_vc(\%myconfig, "customer", "AR");
-
   DN->get_config(\%myconfig, \%$form);
 
-  $form->{SHOW_CUSTOMER_SELECTION}      = $form->{all_customer}    && scalar @{ $form->{all_customer} };
   $form->{SHOW_DUNNING_LEVEL_SELECTION} = $form->{DUNNING}         && scalar @{ $form->{DUNNING} };
   $form->{SHOW_DEPARTMENT_SELECTION}    = $form->{all_departments} && scalar @{ $form->{all_departments} || [] };
 
@@ -133,7 +130,7 @@ sub show_invoices {
     if ($row->{next_dunning_config_id}) {
       map { $_->{SELECTED} = $_->{id} == $row->{next_dunning_config_id} } @{ $row->{DUNNING_CONFIG } };
     }
-    map { $row->{$_} = $form->format_amount(\%myconfig, $row->{$_} * 1, -2) } qw(amount open_amount fee interest);
+    map { $row->{$_} = $form->format_amount(\%myconfig, $row->{$_} * 1, 2) } qw(amount open_amount fee interest);
 
     if ($row->{'language_id'}) {
       $row->{language} = SL::DB::Manager::Language->find_by_or_create('id' => $row->{'language_id'})->{'description'};
@@ -153,6 +150,7 @@ sub show_invoices {
                                           'no_html'         => 1,
                                           'no_opendocument' => 1,);
 
+  $::request->layout->add_javascripts("kivi.Dunning.js");
   $form->header();
   print $form->parse_html_template("dunning/show_invoices");
 
@@ -305,8 +303,6 @@ sub search {
 
   DN->get_config(\%myconfig, \%$form);
 
-  $form->{SHOW_CUSTOMER_DDBOX}   = scalar @{ $form->{ALL_CUSTOMERS} } <= $myconfig{vclimit};
-  $form->{SHOW_DEPARTMENT_DDBOX} = scalar @{ $form->{ALL_CUSTOMERS} };
   $form->{SHOW_DUNNING_LEVELS}   = scalar @{ $form->{DUNNING} };
 
   $form->{title}    = $locale->text('Dunnings');
@@ -453,6 +449,7 @@ sub show_dunning {
 
   $report->set_options_from_form();
 
+  $::request->layout->add_javascripts("kivi.Dunning.js");
   $report->generate_with_headers();
 
   $main::lxdebug->leave_sub();