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

SF.net SVN: ledger-smb:[2620] trunk/scripts/taxform.pl



Revision: 2620
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2620&view=rev
Author:   einhverfr
Date:     2009-06-04 00:50:53 +0000 (Thu, 04 Jun 2009)

Log Message:
-----------
Adding missing workflow script

Added Paths:
-----------
    trunk/scripts/taxform.pl

Added: trunk/scripts/taxform.pl
===================================================================
--- trunk/scripts/taxform.pl	                        (rev 0)
+++ trunk/scripts/taxform.pl	2009-06-04 00:50:53 UTC (rev 2620)
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+
+package LedgerSMB::Scripts::taxform;
+use LedgerSMB::DBObject::TaxForm;
+use LedgerSMB::Template;
+use LedgerSMB::Form;
+
+sub add_taxform 
+{
+    my ($request) = @_;
+    my $taxform = LedgerSMB::DBObject::TaxForm->new({base => $request});
+    
+    $taxform->get_metadata();
+    my $template = LedgerSMB::Template->new(
+        user =>$request->{_user}, 
+        locale => $request->{_locale},
+        path => 'UI',
+        template => 'taxform/add_taxform',
+        format => 'HTML'
+    );
+    $template->render($taxform);
+}
+
+sub save
+{
+    my ($request) = @_;
+    my $taxform = LedgerSMB::DBObject::TaxForm->new({base => $request}); 
+    
+    $taxform->save();
+    $taxform->get_metadata();
+    my $template = LedgerSMB::Template->new(
+        user =>$request->{_user}, 
+        locale => $request->{_locale},
+        path => 'UI',
+        template => 'taxform/add_taxform',
+        format => 'HTML'
+    );
+    $template->render($taxform);
+}
+
+
+
+1;


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