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

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



Revision: 4333
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4333&view=rev
Author:   einhverfr
Date:     2012-02-20 01:29:06 +0000 (Mon, 20 Feb 2012)
Log Message:
-----------
More changes to business reporting units

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Business_Unit_Class.pm
    trunk/sql/Pg-database.sql
    trunk/sql/modules/Business_Unit.sql

Added Paths:
-----------
    trunk/UI/business_units/list_classes.html

Modified: trunk/LedgerSMB/DBObject/Business_Unit_Class.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Business_Unit_Class.pm	2012-02-18 11:26:58 UTC (rev 4332)
+++ trunk/LedgerSMB/DBObject/Business_Unit_Class.pm	2012-02-20 01:29:06 UTC (rev 4333)
@@ -46,6 +46,17 @@
 
 has 'active' => (is => 'rw', isa => 'Bool');
 
+# Hmm should we move this to per-module restrictions? --CT
+
+=item non_accounting bool
+
+If true, indicates that this will not show up on accounting transaction screens.
+this is indivated for CRM and other applications.
+
+=cut
+
+has 'non_accounting' => (is => 'rw', isa => 'Bool');
+
 =item ordering 
 
 The entry boxes (drop down or text entry) are set arranged from low to high

Added: trunk/UI/business_units/list_classes.html
===================================================================
--- trunk/UI/business_units/list_classes.html	                        (rev 0)
+++ trunk/UI/business_units/list_classes.html	2012-02-20 01:29:06 UTC (rev 4333)
@@ -0,0 +1,77 @@
+<?lsmb INCLUDE 'ui-header.html' 
+      include_stylesheet = ["UI/businbusiness_unit/filter.css"] 
+?>
+<?lsmb PROCESS 'elements.html' ?>
+<body>
+<div class="listtop"><?lsmb title ?></div>
+<table>
+<!-- headings -->
+<tr class="listheading"> 
+    <th><?lsmb text('ID') ?></th>
+    <th><?lsmb text('Label') ?></th>
+    <th><?lsmb text('Active') ?></th>
+    <th><?lsmb text('Non-Accounting') ?></th>
+    <th><?lsmb text('Ordering') ?></th>
+    <th>&nbsp;</th>
+</tr>
+<?lsmb push classes, {}; 
+       FOR c IN classes 
+?>
+<form action="<?lsmb script ?>" method=POST id="edit-<?lsmb c.id ?>">
+<tr class="row<?lsmb LOOP%2?>">
+<td><?lsmb c.id ?>
+<?lsmb PROCESS input element_data = {
+    type = "hidden"
+   value = c.id
+    name = "id"
+} ?></td>
+<td><?lsmb PROCESS input element_data = {
+    type = "text"
+   class = "control_code"
+    name = "label"
+   value = c.label
+    size = 12
+} ?>
+</td>
+<td><?lsmb PROCESS input element_data = {
+    type = "checkbox"
+   value = "1"
+   class = "is-active"
+    name = "is_active"
+ checked = (c.is_active)? 'CHECKED' : ''
+} ?>
+</td>
+<td><?lsmb PROCESS input element_data = {
+    type = "checkbox"
+   value = "1"
+    name = "non-accounting"
+ checked = (c.non-accounting)? 'CHECKED' : ''
+} ?>
+</td>
+<td><?lsmb PROCESS input element_data = {
+    type = "text"
+   class = "ordering"
+    name = "ordering"
+   value = c.ordering
+    size = 4
+} ?>
+</td>
+<td><?lsmb PROCESS button element_data = {
+    type = "submit"
+   class = "submit"
+    name = "action"
+   value = "save"
+    text = (c.id) ? text('Save') : text('Add')
+};
+<?lsmb PROCESS button element_data = {
+    type = "submit"
+   class = "submit"
+    name = "action"
+   value = "delete"
+    text = text('Delete')
+} ?>
+</tr>
+<?lsmb END ?>
+</table>
+</body>
+</html>

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2012-02-18 11:26:58 UTC (rev 4332)
+++ trunk/sql/Pg-database.sql	2012-02-20 01:29:06 UTC (rev 4333)
@@ -1776,6 +1776,7 @@
     id int not null unique,
     label text primary key,
     active bool not null default false,
+    non_accounting bool not null default false,
     ordering int
 );
 

Modified: trunk/sql/modules/Business_Unit.sql
===================================================================
--- trunk/sql/modules/Business_Unit.sql	2012-02-18 11:26:58 UTC (rev 4332)
+++ trunk/sql/modules/Business_Unit.sql	2012-02-20 01:29:06 UTC (rev 4333)
@@ -83,26 +83,31 @@
 the business unit of in_id.  $$;
 
 CREATE OR REPLACE FUNCTION business_unit_class__save 
-(in_id int, in_label text, in_active bool, in_ordering int)
+(in_id int, in_label text, in_active bool, in_non_accounting, in_ordering int)
 RETURNS business_unit_class AS
 $$
 DECLARE retval business_unit_class;
+        t_id int;
 BEGIN
 
+t_id := in_id;
 UPDATE business_unit_class
    SET label = in_label,
        active = in_active,
-       ordering = in_ordering
+       ordering = in_ordering,
+       non_accounting = in_non_accounting
  WHERE id = in_id;
 
 IF NOT FOUND THEN
 
-   INSERT INTO business_unit_class (id, label, active, ordering)
-   VALUES (in_id, in_label, in_active, in_ordering);
+   INSERT INTO business_unit_class (label, active, non_accounting, ordering)
+   VALUES (in_label, in_active, in_non_accounting, in_ordering);
 
+   t_id := currval('business_unit_class_id_seq');
+
 END IF;
 
-SELECT * INTO retval FROM business_unit_class;
+SELECT * INTO retval FROM business_unit_class WHERE id = t_id;
 
 RETURN retval;
 

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