BUGFIX: Kreditorenbuchungen: Fehler beim Nutzen von Drafts(2)
[kivitendo-erp.git] / bin / mozilla / gl.pl
index 42ac4a0..77591f5 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.
 #======================================================================
 #
 # Genereal Ledger
@@ -40,7 +41,6 @@ use List::Util qw(sum);
 use SL::FU;
 use SL::GL;
 use SL::IS;
-use SL::PE;
 use SL::ReportGenerator;
 use SL::DBUtils qw(selectrow_query selectall_hashref_query);
 
@@ -210,7 +210,7 @@ sub edit {
 
 sub search {
   $::lxdebug->enter_sub;
-  $::auth->assert('gl_transactions');
+  $::auth->assert('general_ledger | gl_transactions');
 
   $::form->all_departments(\%::myconfig);
   $::form->get_lists(
@@ -249,7 +249,7 @@ sub create_subtotal_row {
 sub generate_report {
   $main::lxdebug->enter_sub();
 
-  $main::auth->assert('gl_transactions');
+  $main::auth->assert('general_ledger | gl_transactions');
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
@@ -510,6 +510,12 @@ sub generate_report {
   $main::lxdebug->leave_sub();
 }
 
+sub show_draft {
+  $::form->{transdate} = DateTime->today_local->to_kivitendo if !$::form->{transdate};
+  $::form->{gldate}    = $::form->{transdate} if !$::form->{gldate};
+  update();
+}
+
 sub update {
   $main::lxdebug->enter_sub();