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

SF.net SVN: ledger-smb:[3718] trunk



Revision: 3718
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3718&view=rev
Author:   einhverfr
Date:     2011-09-20 06:01:57 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
Merging branches/1.3 changes into trunk

Modified Paths:
--------------
    trunk/LedgerSMB/Template/LaTeX.pm
    trunk/LedgerSMB.pm
    trunk/UI/reconciliation/report.html
    trunk/sql/modules/Reconciliation.sql
    trunk/sql/modules/Roles.sql
    trunk/t/11-ledgersmb.t

Property Changed:
----------------
    trunk/


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3:3711-3714
   + /branches/1.3:3711-3717

Modified: trunk/LedgerSMB/Template/LaTeX.pm
===================================================================
--- trunk/LedgerSMB/Template/LaTeX.pm	2011-09-20 05:58:33 UTC (rev 3717)
+++ trunk/LedgerSMB/Template/LaTeX.pm	2011-09-20 06:01:57 UTC (rev 3718)
@@ -99,6 +99,8 @@
 
     if (defined $vars){
             $vars =~ s/([&\$\\_<>~^#\%\{\}])/\\$1/g;
+            $vars =~ s/â/--/g;
+            $vars =~ s/[ââ]/---/g;
             $vars =~ s/"(.*)"/``$1''/gs;
             $vars =~ s/\n/\n\n/gm;
     }

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2011-09-20 05:58:33 UTC (rev 3717)
+++ trunk/LedgerSMB.pm	2011-09-20 06:01:57 UTC (rev 3718)
@@ -807,7 +807,7 @@
     my ($self, $args) = @_;
     my @roles = @{$args->{allowed_roles}};
     for my $role (@roles){
-        $self->{_role_prefix} = "" unless defined $self->{_role_prefix};
+        $self->{_role_prefix} = "lsmb_$self->{company}__" unless defined $self->{_role_prefix};
         my @roleset = grep m/^$self->{_role_prefix}$role$/, @{$self->{_roles}};
         if (scalar @roleset){
             return 1;

Modified: trunk/UI/reconciliation/report.html
===================================================================
--- trunk/UI/reconciliation/report.html	2011-09-20 05:58:33 UTC (rev 3717)
+++ trunk/UI/reconciliation/report.html	2011-09-20 06:01:57 UTC (rev 3718)
@@ -108,7 +108,7 @@
 	<?lsmb END ?>
 	<?lsmb END -?>
 	<tr class="subtotal">
-		<th colspan=5><?lsmb text('Total') ?></th>
+		<th colspan=6><?lsmb text('Total') ?></th>
 		<td><?lsmb total_cleared_debits ?></td>
 		<td><?lsmb total_cleared_credits ?></td>
 	</tr>
@@ -123,7 +123,7 @@
 		<th><?lsmb text('Clear date') ?></th>
 		<th><?lsmb text('Source') ?></th>
 		<th><?lsmb text('Posted Date') ?></th>
-		<th><?lsmb text('Payee') ?></th>
+		<th><?lsmb text('Description') ?></th>
 		<th><?lsmb text('Our Debits') ?></th>
 		<th><?lsmb text('Our Credits') ?></th>
 		<th><?lsmb text('Their Debits') ?></th>
@@ -159,7 +159,7 @@
 	<?lsmb END -?>
 	<?lsmb END -?>
 	<tr class="subtotal">
-		<th colspan=5><?lsmb text('Total') ?></th>
+		<th colspan=6><?lsmb text('Total') ?></th>
 		<td><?lsmb mismatch_our_debits ?></td>
 		<td><?lsmb mismatch_our_credits ?></td>
 		<td><?lsmb mismatch_their_debits ?></td>
@@ -174,7 +174,7 @@
 		<th><?lsmb text('Cleared') ?></th>
 		<th><?lsmb text('Source') ?></th>
 		<th><?lsmb text('Posted Date') ?></th>
-		<th><?lsmb text('Payee') ?></th>
+		<th><?lsmb text('Description') ?></th>
 		<th><?lsmb text('Our Debits') ?></th>
 		<th><?lsmb text('Our Credits') ?></th>
 	</tr>
@@ -203,7 +203,7 @@
 	<?lsmb END ?>
 	<?lsmb END -?>
 	<tr class="subtotal">
-		<th colspan=3><?lsmb text('Total') ?></th>
+		<th colspan=4><?lsmb text('Total') ?></th>
 		<td><?lsmb total_uncleared_debits ?></td>
 		<td><?lsmb total_uncleared_credits ?></td>
 	</tr>

Modified: trunk/sql/modules/Reconciliation.sql
===================================================================
--- trunk/sql/modules/Reconciliation.sql	2011-09-20 05:58:33 UTC (rev 3717)
+++ trunk/sql/modules/Reconciliation.sql	2011-09-20 06:01:57 UTC (rev 3718)
@@ -37,15 +37,6 @@
 $$
     DECLARE
     BEGIN
-        PERFORM id FROM cr_report WHERE id = in_report_id;
-        
-        IF NOT FOUND THEN
-            RAISE NOTICE 'reconciliation__delete_report(): Cannot find specified report.';
-            return FOUND;
-        END IF;
-        
-        -- We found the entry. Update it.
-        
         PERFORM id FROM cr_report WHERE id = in_report_id AND approved = TRUE;
         
         IF FOUND THEN --changing the verbose message to a notice and adding a
@@ -53,37 +44,17 @@
             RAISE NOTICE 'reconcilation__delete_report(): report % is approved; cannot delete.', in_report_id;
             RAISE EXCEPTION 'Cannot delete approved';
         END IF;
-        
-        PERFORM id 
-           FROM cr_report 
-          WHERE id = in_report_id 
-            AND submitted = TRUE
-            AND entered_by = person__get_my_entity_id();
-        
-        -- IF FOUND THEN
-            -- Creators cannot delete their own reports if they've been submitted. -AS
-            -- Why not?  If it hasn't been approved.....  
-            -- Also concerned about single-user setups here so commenting out
-            -- this block --CT
-            -- RAISE EXCEPTION 'reconciliation__delete_report(): creators cannot delete their own report after submission. %', in_report_id;
-        -- END IF;
-        
-        UPDATE cr_report
-           SET deleted = TRUE,
-               deleted_by = person__get_my_entity_id()
-         WHERE id = in_report_id;
+
+        DELETE FROM cr_report_line WHERE report_id = in_report_id;
+        DELETE FROM cr_report WHERE id = in_report_id;
          
-        return TRUE;
+        return FOUND;
     END;
 $$ language plpgsql;
 
 COMMENT ON FUNCTION reconciliation__delete_report(in_report_id int) IS
-$$Deletes the report if the report exists and is unapproved.
+$$Deletes the report if the report exists and is unapproved.$$;
 
-Note this does not actually delete anything from the database.  Deleted reports
-are kept around in case they need to be investigated.  It only marks them as 
-deleted so that they can never be approved.$$;
-
 CREATE OR REPLACE FUNCTION reconciliation__get_cleared_balance(in_chart_id int)
 RETURNS numeric AS
 $$

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2011-09-20 05:58:33 UTC (rev 3717)
+++ trunk/sql/modules/Roles.sql	2011-09-20 06:01:57 UTC (rev 3718)
@@ -635,10 +635,11 @@
 TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
 
 GRANT UPDATE ON cr_report TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
+GRANT ALL ON cr_report_line_id_seq TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
  
  GRANT INSERT, SELECT ON cr_report, cr_report_line 
 TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
-GRANT DELETE ON cr_report_line
+GRANT DELETE, UPDATE ON cr_report_line
 TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
 GRANT SELECT ON acc_trans, account_checkpoint 
 TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
@@ -657,7 +658,8 @@
 GRANT SELECT ON recon_payee 
 TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";
 
-GRANT UPDATE ON cr_report TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";
+GRANT DELETE ON cr_report_line TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";
+GRANT UPDATE, DELETE ON cr_report TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";
 GRANT SELECT ON acc_trans, account_checkpoint TO 
 "lsmb_<?lsmb dbname ?>__reconciliation_approve";
 

Modified: trunk/t/11-ledgersmb.t
===================================================================
--- trunk/t/11-ledgersmb.t	2011-09-20 05:58:33 UTC (rev 3717)
+++ trunk/t/11-ledgersmb.t	2011-09-20 06:01:57 UTC (rev 3718)
@@ -258,7 +258,8 @@
 
 # $lsmb->is_allowed_role checks, no prefix
 $lsmb = LedgerSMB->new();
-$lsmb->{_roles} = ['apple', 'pear'];
+$lsmb->{_role_prefix} = '1_';
+$lsmb->{_roles} = ['1_apple', '1_pear'];
 is($lsmb->is_allowed_role({allowed_roles => ['pear']}), 1, 
 	'is_allowed_role: allowed role');
 

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