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

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



Revision: 3330
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3330&view=rev
Author:   einhverfr
Date:     2011-06-25 10:35:16 +0000 (Sat, 25 Jun 2011)

Log Message:
-----------
saving, editing, and deleting bank accounts now works aside from documented duplication issue

Modified Paths:
--------------
    trunk/LedgerSMB/ScriptLib/Company.pm
    trunk/UI/Contact/contact.html
    trunk/scripts/employee.pl
    trunk/sql/modules/Roles.sql

Modified: trunk/LedgerSMB/ScriptLib/Company.pm
===================================================================
--- trunk/LedgerSMB/ScriptLib/Company.pm	2011-06-25 10:08:23 UTC (rev 3329)
+++ trunk/LedgerSMB/ScriptLib/Company.pm	2011-06-25 10:35:16 UTC (rev 3330)
@@ -783,6 +783,33 @@
 
 =over
 
+=item delete_bank_acct
+
+Deletes the selected bank account record
+
+Required request variables:
+* bank_account_id
+* entity_id
+* form_id
+
+=back
+
+=cut
+
+sub delete_bank_acct{
+    my ($request) = @_;
+    my $company = new_company($request);
+    if (_close_form($company)){
+        $company->delete_bank_account();
+    }
+    $company->get;
+    _render_main_screen( $company );
+}
+
+=pod
+
+=over
+
 =item delete_location
 
 Deletes the selected contact info record
@@ -797,7 +824,7 @@
 
 =cut
 
-sub delete_location {
+sub delete_location{
     my ($request) = @_;
     my $company = new_company($request);
     if (_close_form($company)){
@@ -807,7 +834,32 @@
     _render_main_screen( $company );
 }
 
+=pod
 
+=over
+
+=item edit_bank_account($request)
+
+displays screen to a bank account
+
+Required data:
+bank_account_id
+bic
+iban
+
+=back
+
+=cut
+
+sub edit_bank_acct {
+    my ($request) = @_;
+    my $company = new_company($request);
+    $company->get;
+    _render_main_screen( $company );
+}
+
+
+
 =pod
 
 =over

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2011-06-25 10:08:23 UTC (rev 3329)
+++ trunk/UI/Contact/contact.html	2011-06-25 10:35:16 UTC (rev 3330)
@@ -696,22 +696,28 @@
 		<!--  TODO:  Automate links with AJAX -->
 		<a href="<?lsmb script ?>?action=edit&entity_id=<?lsmb entity_id 
 			?>&location_id=<?lsmb loc.id ?>&credit_id=<?lsmb 
-			credit_id ?>&target_div=location_div">[edit]</a> 
+			credit_id ?>&country_code=<?lsmb loc.country_id
+                        ?>&target_div=location_div&location_class=<?lsmb
+                        loc.class_id ?>">[edit]</a> 
 		<a href="<?lsmb script ?>?action=delete_location&entity_id=<?lsmb
 			entity_id ?>&location_id=<?lsmb loc.id 
 			?>&credit_id=<?lsmb credit_id 
-                        ?>&form_id=<?lsmb form_id 
+                        ?>&form_id=<?lsmb form_id
+                        ?>&location_class_id=<?lsmb loc.class_id 
                         ?>&target_div=location_div">[delete]</a>
 	</td>
     </tr>
 	<?lsmb END ?>
     </table>
 	<div> <!-- TODO:  Move to elements.html -CT -->
-		<label for="loc_type"><?lsmb text('Type:') ?></label>
-		<select id='loc_type' name="location_class">
-		<?lsmb FOREACH lc = location_class_list ?>
-		<option value="<?lsmb lc.id ?>"><?lsmb lc.class ?></option>
-		<?lsmb END ?>
+                <?lsmb INCLUDE select element_data = {
+                       name           = "location_class"
+                       default_values = [location_class]
+                       options        = location_class_list
+                       text_attr      = "class"
+                       value_attr     = "id"
+                       label          = text('Type:')
+                } ?>
 		</select>
 	</div>
 	<div> 
@@ -770,7 +776,7 @@
 			size = "20"
 		} #' ?>
 	</div>
-	<div> <!-- TODO:  Move to elements.html -CT -->
+	<div> 
 		<?lsmb IF !country_code; country_code = default_country; END -?>
 		<?lsmb INCLUDE select element_data = {
 			text_attr = "name"
@@ -933,11 +939,14 @@
 		<a href="<?lsmb script ?>?action=edit_bank_acct&entity_id=<?lsmb
 			entity_id ?>&bank_account_id=<?lsmb ba.id 
                         ?>&bic=<?lsmb tt_url(ba.bic)
-                        ?>&iban=<?lsmb tt_url(ba.iban) ?>&target_div=bank_div"
+                        ?>&iban=<?lsmb tt_url(ba.iban) 
+                        ?>&credit_id=<?lsmb tt_url(credit_id) 
+                        ?>&target_div=bank_div"
 			>[Edit]</a> 
 		<a href="<?lsmb script ?>?action=delete_bank_acct&entity_id=<?lsmb
 			entity_id ?>&bank_account_id=<?lsmb ba.id 
-                        ?>&target_div=bank_div&form_id=<?lsmb form_id ?>"
+                        ?>&target_div=bank_div&form_id=<?lsmb form_id 
+                        ?>&credit_id=<?lsmb tt_url(credit_id) ?>"
 			>[Delete]</a> 
 	</td>
 </tr>

Modified: trunk/scripts/employee.pl
===================================================================
--- trunk/scripts/employee.pl	2011-06-25 10:08:23 UTC (rev 3329)
+++ trunk/scripts/employee.pl	2011-06-25 10:35:16 UTC (rev 3330)
@@ -154,6 +154,57 @@
 
 =over
 
+=item edit_bank_account($request)
+
+displays screen to a bank account
+
+Required data:
+bank_account_id
+bic
+iban
+
+=back
+
+=cut
+
+sub edit_bank_acct {
+    my ($request) = @_;
+    my $employee= LedgerSMB::DBObject::Employee->new(base => $request, copy => 'all');
+    $employee->get;
+    _render_main_screen( $employee);
+}
+
+=pod
+
+=over
+
+=item delete_bank_acct
+
+Deletes the selected bank account record
+
+Required request variables:
+* bank_account_id
+* entity_id
+* form_id
+
+=back
+
+=cut
+
+sub delete_bank_acct{
+    my ($request) = @_;
+    my $employee= LedgerSMB::DBObject::Employee->new(base => $request, copy => 'all');
+    if (_close_form($employee)){
+        $employee->delete_bank_account();
+    }
+    $employee->get;
+    _render_main_screen( $employee);
+}
+
+=pod
+
+=over
+
 =item search($self, $request, $user)
 
 Requires form var: search_pattern

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2011-06-25 10:08:23 UTC (rev 3329)
+++ trunk/sql/modules/Roles.sql	2011-06-25 10:35:16 UTC (rev 3330)
@@ -129,6 +129,7 @@
 GRANT UPDATE ON person_to_location TO "lsmb_<?lsmb dbname ?>__contact_edit";
 GRANT UPDATE ON person_to_location TO "lsmb_<?lsmb dbname ?>__contact_edit";
 GRANT DELETE, INSERT  ON vendortax TO "lsmb_<?lsmb dbname ?>__contact_edit";
+GRANT DELETE, INSERT  ON entity_bank_account TO "lsmb_<?lsmb dbname ?>__contact_edit";
 GRANT ALL ON customertax TO"lsmb_<?lsmb dbname ?>__contact_edit";
 GRANT ALL ON vendortax TO"lsmb_<?lsmb dbname ?>__contact_edit";
 


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