[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6412] branches/1.3



Revision: 6412
          http://sourceforge.net/p/ledger-smb/code/6412
Author:   einhverfr
Date:     2014-01-07 09:38:13 +0000 (Tue, 07 Jan 2014)
Log Message:
-----------
Correcting draft deletion of journal entries.

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/bin/gl.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2014-01-07 09:32:10 UTC (rev 6411)
+++ branches/1.3/Changelog	2014-01-07 09:38:13 UTC (rev 6412)
@@ -10,6 +10,7 @@
 * Fixed invoices rounding and printing differently (Giovanni B)
 * Deleted broken pricematrix check on existing rows in POS (Chris T)
 * Fixing manually entered tax amounts ignored printing invoice (Chris T, 864)
+* Fixing deleting gl draft via gl screen fails (Chris T, 871)
 
 Chris T is Chris Travers
 Nick P is Nick Prater

Modified: branches/1.3/bin/gl.pl
===================================================================
--- branches/1.3/bin/gl.pl	2014-01-07 09:32:10 UTC (rev 6411)
+++ branches/1.3/bin/gl.pl	2014-01-07 09:38:13 UTC (rev 6412)
@@ -1111,47 +1111,18 @@
 
 
 sub delete {
-
-    my %hiddens;
-    delete $form->{action};
-    foreach (keys %$form) {
-        $hiddens{$_} = $form->{$_} unless ref $form->{$_};
-    }
-
-    $form->{title} = $locale->text('Confirm!');
-    my $query = $locale->text(
-        'Are you sure you want to delete Transaction [_1]',
-        $form->{reference} );
-
-    my @buttons = ({
-        name => 'action',
-        value => 'delete_transaction',
-        text => $locale->text('Yes'),
-        });
-    my $template = LedgerSMB::Template->new_UI(
-        user => \%myconfig, 
-        locale => $locale, 
-        template => 'form-confirmation',
-        );
-    $template->render({
-        form => $form,
-        query => $query,
-        hiddens => \%hiddens,
-        buttons => \@buttons,
-    });
+    $form->error($locale->text('Cannot delete posted transaction')) 
+       if ($form->{approved});
+    my $lsmb = LedgerSMB->new();
+    $lsmb->merge($form);
+    my $draft = LedgerSMB::DBObject::Draft->new({base => $lsmb});
+    $draft->delete();
+    delete $form->{id};
+    delete $form->{reference};
+    add();
 }
 
-sub delete_transaction {
 
-    if ( GL->delete_transaction( \%myconfig, \%$form ) ) {
-        $form->redirect( $locale->text('Transaction deleted!') );
-    }
-    else {
-        $form->error( $locale->text('Cannot delete transaction!') );
-    }
-
-}
-
 sub post {
     if (!$form->close_form){
         &update;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits