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

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



Revision: 6438
          http://sourceforge.net/p/ledger-smb/code/6438
Author:   einhverfr
Date:     2014-01-11 07:44:12 +0000 (Sat, 11 Jan 2014)
Log Message:
-----------
Added 'Reject' button to reconciliation reports to return them to unsubmitted state

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/DBObject/Reconciliation.pm
    trunk/LedgerSMB/Scripts/recon.pm
    trunk/UI/Reports/filters/reconciliation_search.html
    trunk/UI/reconciliation/report.html
    trunk/UI/reconciliation/upload.html
    trunk/sql/modules/Reconciliation.sql
    trunk/sql/modules/Roles.sql

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2014-01-11 05:26:26 UTC (rev 6437)
+++ trunk/Changelog	2014-01-11 07:44:12 UTC (rev 6438)
@@ -16,6 +16,7 @@
 * Can now select default formats for printed invoices (Chris T)
 * Shipvia is now a text area. (Chris T)
 * Descriptions can now be locked on invoices and orders (Chris T)
+* Reconciliation reports can now be rejected (Chris T, 855)
 
 Enhancing Security Structure
 * Session expiration now with configurable behavior (Chris T)

Modified: trunk/LedgerSMB/DBObject/Reconciliation.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Reconciliation.pm	2014-01-11 05:26:26 UTC (rev 6437)
+++ trunk/LedgerSMB/DBObject/Reconciliation.pm	2014-01-11 07:44:12 UTC (rev 6438)
@@ -219,6 +219,17 @@
     return $retval;
 }
 
+=item reject
+
+This rejects a submitted but not approved report.
+
+=cut
+
+sub reject {
+    my ($self) = @_;
+    $self->exec_method(funcname => 'reconciliation__reject_set');
+}
+
 =item add_entries
 
 Adds entries from the import file routine.

Modified: trunk/LedgerSMB/Scripts/recon.pm
===================================================================
--- trunk/LedgerSMB/Scripts/recon.pm	2014-01-11 05:26:26 UTC (rev 6437)
+++ trunk/LedgerSMB/Scripts/recon.pm	2014-01-11 07:44:12 UTC (rev 6438)
@@ -100,6 +100,19 @@
 
 } 
 
+=item reject
+
+Rejects the recon set and returns it to non-submitted state
+
+=cut
+
+sub reject {
+    my ($request) = @_;
+    my $recon = LedgerSMB::DBObject::Reconciliation->new(base => $request);
+    $recon->reject;
+    search($request);
+}
+
 =item submit_recon_set
 
 Submits the recon set to be approved.

Modified: trunk/UI/Reports/filters/reconciliation_search.html
===================================================================
--- trunk/UI/Reports/filters/reconciliation_search.html	2014-01-11 05:26:26 UTC (rev 6437)
+++ trunk/UI/Reports/filters/reconciliation_search.html	2014-01-11 07:44:12 UTC (rev 6438)
@@ -1,5 +1,6 @@
 <?lsmb PROCESS 'ui-header.html' ?>
 <?lsmb PROCESS 'elements.html' ?>
+<body class="<?lsmb dojo_theme ?>">
 
 <div class="title"><?lsmb text('Search Reconciliation Reports') ?></div>
         

Modified: trunk/UI/reconciliation/report.html
===================================================================
--- trunk/UI/reconciliation/report.html	2014-01-11 05:26:26 UTC (rev 6437)
+++ trunk/UI/reconciliation/report.html	2014-01-11 07:44:12 UTC (rev 6438)
@@ -2,6 +2,7 @@
 		include_stylesheet = ['UI/reconciliation/report.css']
 ?>
 <?lsmb PROCESS 'elements.html' ?>
+<body class="<?lsmb dojo_theme ?>">
 
 <form action="recon.pl" method="post" enctype="multipart/form-data">
 <div class="listtop" id="title"><?lsmb text('Reconciliation Report') ?></div>
@@ -278,8 +279,14 @@
 <?lsmb INCLUDE button element_data = {
 	name = "action",
 	text = text('Approve'),
-	value = 'Approve',
+	value = 'approve',
 	class = "submit"
+};
+INCLUDE button element_data = {
+	name = "action",
+	text = text('Reject'),
+	value = 'reject',
+	class = "submit"
 } ?>
 <?lsmb END ?>
 <?lsmb IF NOT approved ?>

Modified: trunk/UI/reconciliation/upload.html
===================================================================
--- trunk/UI/reconciliation/upload.html	2014-01-11 05:26:26 UTC (rev 6437)
+++ trunk/UI/reconciliation/upload.html	2014-01-11 07:44:12 UTC (rev 6438)
@@ -1,7 +1,7 @@
 <?lsmb PROCESS 'ui-header.html' ?>
 <?lsmb PROCESS 'elements.html' ?>
 
-<div class="body" id ="recon1">
+<div class="body" id ="recon1" class="<?lsmb dojo_theme ?>">
     <div class="title">
         New Reconciliation Report
     </div>

Modified: trunk/sql/modules/Reconciliation.sql
===================================================================
--- trunk/sql/modules/Reconciliation.sql	2014-01-11 05:26:26 UTC (rev 6437)
+++ trunk/sql/modules/Reconciliation.sql	2014-01-11 07:44:12 UTC (rev 6438)
@@ -11,6 +11,18 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
+CREATE OR REPLACE FUNCTION reconciliation__reject_set(in_report_id int)
+RETURNS bool language plpgsql as $$
+BEGIN
+     UPDATE cr_report set submitted = false 
+      WHERE id = in_report_id
+            AND approved is not true;
+     RETURN found;
+END;
+$$ SECURITY DEFINER;
+
+REVOKE EXECUTE ON FUNCTION reconciliation__reject_set(in_report_id int) FROM public;
+
 COMMENT ON FUNCTION reconciliation__submit_set(
         in_report_id int, in_line_ids int[]) IS
 $$Submits a reconciliation report for approval. 

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2014-01-11 05:26:26 UTC (rev 6437)
+++ trunk/sql/modules/Roles.sql	2014-01-11 07:44:12 UTC (rev 6438)
@@ -594,6 +594,7 @@
 
 SELECT lsmb__grant_menu('reconciliation_approve', 44, 'allow');
 SELECT lsmb__grant_menu('reconciliation_approve', 211, 'allow');
+SELECT lsmb__grant_exec('reconciliation_approve', 'reconciliation__reject_set(in_report_id int)');
 SELECT lsmb__grant_exec('reconciliation_approve', 'reconciliation__delete_unapproved(in_report_id int)');
 
 SELECT lsmb__create_role('reconciliation_all');

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


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits