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

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



Revision: 3716
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3716&view=rev
Author:   einhverfr
Date:     2011-09-19 23:41:40 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------

Permissions fixes for reconciliation
Minor UI glitches fixed re: reconciliation
Improvement in reconciliation deletion routines

Modified Paths:
--------------
    branches/1.3/UI/reconciliation/report.html
    branches/1.3/sql/modules/Reconciliation.sql
    branches/1.3/sql/modules/Roles.sql

Modified: branches/1.3/UI/reconciliation/report.html
===================================================================
--- branches/1.3/UI/reconciliation/report.html	2011-09-19 21:26:22 UTC (rev 3715)
+++ branches/1.3/UI/reconciliation/report.html	2011-09-19 23:41:40 UTC (rev 3716)
@@ -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: branches/1.3/sql/modules/Reconciliation.sql
===================================================================
--- branches/1.3/sql/modules/Reconciliation.sql	2011-09-19 21:26:22 UTC (rev 3715)
+++ branches/1.3/sql/modules/Reconciliation.sql	2011-09-19 23:41:40 UTC (rev 3716)
@@ -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: branches/1.3/sql/modules/Roles.sql
===================================================================
--- branches/1.3/sql/modules/Roles.sql	2011-09-19 21:26:22 UTC (rev 3715)
+++ branches/1.3/sql/modules/Roles.sql	2011-09-19 23:41:40 UTC (rev 3716)
@@ -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";

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