diff options
-rwxr-xr-x | LedgerSMB.pm | 5 | ||||
-rw-r--r-- | LedgerSMB/GL.pm | 18 | ||||
-rw-r--r-- | LedgerSMB/RP.pm | 7 | ||||
-rw-r--r-- | bin/gl.pl | 4 | ||||
-rw-r--r-- | sql/Pg-database.sql | 4 |
5 files changed, 33 insertions, 5 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm index 9a38149d..7c9e9644 100755 --- a/LedgerSMB.pm +++ b/LedgerSMB.pm @@ -197,7 +197,10 @@ sub new { if (!$self->{script}) { $self->{script} = 'login.pl'; } - if (($self->{script} eq 'login.pl') && + if ($self->{action} eq 'migrate_user'){ + return $self; + } + if ($self->{script} eq 'login.pl' && ($self->{action} eq 'authenticate' || !$self->{action})){ return $self; } diff --git a/LedgerSMB/GL.pm b/LedgerSMB/GL.pm index 8979d3ca..7ed6ab4c 100644 --- a/LedgerSMB/GL.pm +++ b/LedgerSMB/GL.pm @@ -417,6 +417,15 @@ sub all_transactions { } else { $chart_id = 'NULL'; } + + if (!defined $form->{approved}){ + $approved = 'true'; + } elsif ($form->{approved} eq 'all') { + $approved = 'NULL'; + } else { + $approved = $dbh->quote($form->{approved}); + } + my $query = qq|SELECT g.id, 'gl' AS type, $false AS invoice, g.reference, g.description, ac.transdate, ac.source, ac.amount, c.accno, c.gifi_accno, g.notes, c.link, @@ -429,6 +438,9 @@ sub all_transactions { WHERE $glwhere AND (ac.chart_id = $chart_id OR $chart_id IS NULL) + AND ($approved IS NULL OR + $approved = + (ac.approved AND g.approved)) UNION ALL @@ -445,6 +457,9 @@ sub all_transactions { WHERE $arwhere AND (ac.chart_id = $chart_id OR $chart_id IS NULL) + AND ($approved IS NULL OR + $approved = + (ac.approved AND a.approved)) UNION ALL @@ -461,6 +476,9 @@ sub all_transactions { WHERE $apwhere AND (ac.chart_id = $chart_id OR $chart_id IS NULL) + AND ($approved IS NULL OR + $approved = + (ac.approved AND a.approved)) ORDER BY $sortorder|; my $sth = $dbh->prepare($query); diff --git a/LedgerSMB/RP.pm b/LedgerSMB/RP.pm index bd27677f..b51d7290 100644 --- a/LedgerSMB/RP.pm +++ b/LedgerSMB/RP.pm @@ -925,6 +925,13 @@ sub get_accounts { $project = qq| AND ac.project_id = $project_id|; } + if (!defined $form->{approved}){ + $approved = 'true'; + } elsif ($form->{approved} eq 'all') { + $approved = 'NULL'; + } else { + $approved = $dbh->quote($form->{approved}); + } if ( $form->{accounttype} eq 'gifi' ) { @@ -131,7 +131,7 @@ qq|<option value="$_->{description}--$_->{id}">$_->{description}\n|; } } - &dislay_form(1); + display_form(1); } @@ -951,7 +951,7 @@ qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n|; $form->{rowcount} = $count + 1; - &display_form; + display_form; } diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql index 1fedb884..b42293f6 100644 --- a/sql/Pg-database.sql +++ b/sql/Pg-database.sql @@ -475,7 +475,7 @@ CREATE TABLE entity_credit_account ( primary_contact int references person(id), ar_ap_account_id int references chart(id), cash_account_id int references chart(id), - PRIMARY KEY(entity_id, meta_number, entity_class), + PRIMARY KEY(entity_id, meta_number, entity_class) ); CREATE UNIQUE INDEX entity_credit_ar_accno_idx_u @@ -489,7 +489,7 @@ $$This index is used to ensure that AR accounts are not reused.$$; INSERT INTO entity (name, entity_class) values ('Inventory Entity', 1); INSERT INTO company (legal_name, entity_id) -values ('Inventory Entity', currval('entity_id_seq'); +values ('Inventory Entity', currval('entity_id_seq')); INSERT INTO entity_credit_account (entity_id, meta_number, entity_class) VALUES |