[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[3692] trunk
- Subject: SF.net SVN: ledger-smb:[3692] trunk
- From: ..hidden..
- Date: Thu, 01 Sep 2011 23:52:26 +0000
Revision: 3692
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3692&view=rev
Author: einhverfr
Date: 2011-09-01 23:52:26 +0000 (Thu, 01 Sep 2011)
Log Message:
-----------
Better error handling in GL transaction posting for addons etc
Permissions fixes
Removing old install.sql
Modified Paths:
--------------
trunk/LedgerSMB/GL.pm
trunk/bin/gl.pl
trunk/bin/ps.pl
trunk/sql/modules/Roles.sql
Removed Paths:
-------------
trunk/sql/modules/install.sql
Modified: trunk/LedgerSMB/GL.pm
===================================================================
--- trunk/LedgerSMB/GL.pm 2011-09-01 20:07:24 UTC (rev 3691)
+++ trunk/LedgerSMB/GL.pm 2011-09-01 23:52:26 UTC (rev 3692)
@@ -88,7 +88,7 @@
sub post_transaction {
- my ( $self, $myconfig, $form ) = @_;
+ my ( $self, $myconfig, $form, $locale) = @_;
$form->{reference} = $form->update_defaults( $myconfig, 'glnumber', $dbh )
unless $form->{reference};
my $null;
@@ -210,6 +210,13 @@
( $null, $project_id ) = split /--/, $form->{"projectnumber_$i"};
$project_id ||= undef;
+ $query = qq|SELECT count(*) from account where accno = ?|;
+ $sth = $dbh->prepare($query);
+ $sth->execute($accno);
+ my ($count) = $sth->fetchrow_array();
+ if ($count == 0){
+ $form->error($locale->text('Account [_1] not found', $accno));
+ }
$query = qq|
INSERT INTO acc_trans
@@ -220,7 +227,6 @@
FROM chart
WHERE accno = ? AND charttype = 'A'),
?, ?, ?, ?, ?, ?, ?)|;
-
$sth = $dbh->prepare($query);
$sth->execute(
$form->{id}, $accno,
Modified: trunk/bin/gl.pl
===================================================================
--- trunk/bin/gl.pl 2011-09-01 20:07:24 UTC (rev 3691)
+++ trunk/bin/gl.pl 2011-09-01 23:52:26 UTC (rev 3692)
@@ -100,7 +100,7 @@
$lsmb->merge($form);
my $draft = LedgerSMB::DBObject::Draft->new({base => $lsmb});
$draft->delete();
- GL->post_transaction( \%myconfig, \%$form );
+ GL->post_transaction( \%myconfig, \%$form, $locale);
approve();
}
@@ -1123,7 +1123,7 @@
}
}
- if ( GL->post_transaction( \%myconfig, \%$form ) ) {
+ if ( GL->post_transaction( \%myconfig, \%$form, $locale) ) {
$form->redirect( $locale->text('Transaction posted!') );
}
else {
Modified: trunk/bin/ps.pl
===================================================================
--- trunk/bin/ps.pl 2011-09-01 20:07:24 UTC (rev 3691)
+++ trunk/bin/ps.pl 2011-09-01 23:52:26 UTC (rev 3692)
@@ -244,7 +244,7 @@
$form->{accno_2} = $accno2;
$form->{debit_2} = $amount;
$form->{transdate} = $form->current_date( \%myconfig );
- GL->post_transaction( \%myconfig, \%$form );
+ GL->post_transaction( \%myconfig, \%$form, $locale);
delete $form->{id};
$error = $amount - $expected;
$difference += $error;
@@ -259,7 +259,7 @@
$form->{accno_2} = $pos_config{coa_prefix};
$form->{debit_2} = $amount;
$form->{transdate} = $form->current_date( \%myconfig );
- GL->post_transaction( \%myconfig, \%$form );
+ GL->post_transaction( \%myconfig, \%$form, $locale);
delete $form->{id};
$lines .= "Cumulative Error: $amount\n\n";
$form->{accno} = $form->{accno_1};
@@ -272,7 +272,7 @@
$form->{accno_2} = $pos_config{coa_prefix};
$form->{debit_2} = $amount;
$form->{transdate} = $form->current_date( \%myconfig );
- GL->post_transaction( \%myconfig, \%$form );
+ GL->post_transaction( \%myconfig, \%$form, $locale);
delete $form->{id};
$head =
Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql 2011-09-01 20:07:24 UTC (rev 3691)
+++ trunk/sql/modules/Roles.sql 2011-09-01 23:52:26 UTC (rev 3692)
@@ -636,7 +636,7 @@
GRANT UPDATE ON cr_report TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
- GRANT INSERT ON cr_report, cr_report_line
+ GRANT INSERT, SELECT ON cr_report, cr_report_line
TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
GRANT DELETE ON cr_report_line
TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
Deleted: trunk/sql/modules/install.sql
===================================================================
--- trunk/sql/modules/install.sql 2011-09-01 20:07:24 UTC (rev 3691)
+++ trunk/sql/modules/install.sql 2011-09-01 23:52:26 UTC (rev 3692)
@@ -1,22 +0,0 @@
-BEGIN;
-\i sql/modules/Drafts.sql
-\i sql/modules/Account.sql
-\i sql/modules/Session.sql
-\i sql/modules/Business_type.sql
-\i sql/modules/Location.sql
-\i sql/modules/Company.sql
-\i sql/modules/Customer.sql
-\i sql/modules/Date.sql
-\i sql/modules/Defaults.sql
-\i sql/modules/Settings.sql
-\i sql/modules/Employee.sql
-\i sql/modules/Entity.sql
-\i sql/modules/Payment.sql
-\i sql/modules/Person.sql
-\i sql/modules/Report.sql
-\i sql/modules/Voucher.sql
-\i sql/modules/Reconciliation.sql
--- Adds the new user functionality.
-\i sql/modules/admin.sql
-\i sql/modules/chart.sql
-COMMIT;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.