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

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



Revision: 1969
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1969&view=rev
Author:   einhverfr
Date:     2007-12-10 14:39:20 -0800 (Mon, 10 Dec 2007)

Log Message:
-----------
Minor Customer/Vendor fixes

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Company.pm
    trunk/LedgerSMB/DBObject/Menu.pm
    trunk/LedgerSMB/DBObject.pm
    trunk/UI/Contact/contact.html
    trunk/scripts/vendor.pl

Modified: trunk/LedgerSMB/DBObject/Company.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Company.pm	2007-12-08 22:43:05 UTC (rev 1968)
+++ trunk/LedgerSMB/DBObject/Company.pm	2007-12-10 22:39:20 UTC (rev 1969)
@@ -33,6 +33,9 @@
     @{$self->{location_class_list}} = 
          $self->exec_method(funcname => 'location_list_class');
 
+    @{$self->{business_types}} = 
+         $self->exec_method(funcname => 'business_type__list');
+
     @{$self->{country_list}} = 
          $self->exec_method(funcname => 'location_list_country');
 
@@ -58,6 +61,13 @@
     $self->{dbh}->commit;
 }
 
+sub search {
+    my ($self) = @_;
+    @{$self->{search_results}} = 
+	$self->exec_method(funcname => 'company__search');
+    return @{$self->{search_results}};
+}
+
 sub get {
     my $self = shift @_;
 

Modified: trunk/LedgerSMB/DBObject/Menu.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Menu.pm	2007-12-08 22:43:05 UTC (rev 1968)
+++ trunk/LedgerSMB/DBObject/Menu.pm	2007-12-10 22:39:20 UTC (rev 1969)
@@ -71,7 +71,6 @@
 
 sub __generate {
     my ($self) = @_;
-    $self->debug({file => '/tmp/menu'});
     my @args;
 
     shift @{$self->{menu_items}};

Modified: trunk/LedgerSMB/DBObject.pm
===================================================================
--- trunk/LedgerSMB/DBObject.pm	2007-12-08 22:43:05 UTC (rev 1968)
+++ trunk/LedgerSMB/DBObject.pm	2007-12-10 22:39:20 UTC (rev 1969)
@@ -130,7 +130,6 @@
 
     for (@in_args) { push @call_args, $_ } ;
     $self->{call_args} = ..hidden..;
-    $self->debug({file => '/tmp/dbobject'});
     return $self->call_procedure( procname => $funcname, args => ..hidden.. );
 }
 

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2007-12-08 22:43:05 UTC (rev 1968)
+++ trunk/UI/Contact/contact.html	2007-12-10 22:39:20 UTC (rev 1969)
@@ -1,4 +1,8 @@
-<?lsmb script_css = "Contact/contact.css" ?><?lsmb PROCESS 'ui-header.html' ?>
+<?lsmb INCLUDE 'ui-header.html'
+	include_stylesheet = [
+		stylesheet
+		'UI/Contact/contact.css'
+	] ?>
 <?lsmb PROCESS 'elements.html' ?>
 <body>
     <?lsmb IF name ?> 
@@ -155,12 +159,12 @@
 		size = "20"
 	} ?><br/>
 	<?lsmb PROCESS input element_data = {
-		label = text('Account Number:'),
+		label = text("$entity_classname Number:"),
 		type= "text",
 		name = "meta_number",
 		value = meta_number,
 		size = "20"
-	}  # ' ?><br/>
+	}  # " ?><br/>
         <table>
         <tr>
             <td>
@@ -188,7 +192,7 @@
         </tr>
         <tr>
             <td>
-		<?lsmb PROCESS input element_data = {
+		<?lsmb INCLUDE input element_data = {
 			label = text('Credit Limit:'),
 			name = "creditlimit",
 			value = creditlimit,
@@ -197,7 +201,7 @@
 		} #' ?>
             </td>
             <td>
-		<?lsmb PROCESS input element_data = {
+		<?lsmb INCLUDE input element_data = {
 			label = text('Terms:'),
 			name = "terms",
 			value = terms,
@@ -209,7 +213,7 @@
         <tr>
             
             <td>
-		<?lsmb PROCESS input element_data = {
+		<?lsmb INCLUDE input element_data = {
 			label = text('Tax Number/SSN:'),
 			name = "taxnumber",
 			value = taxnumber,
@@ -218,7 +222,7 @@
 		} #' ?>
             </td>
             <td>
-		<?lsmb PROCESS input element_data = {
+		<?lsmb INCLUDE input element_data = {
 			label = text('Subcontract GIFI:'),
 			name = "gifi_accno",
 			value = gifi_accno,
@@ -229,7 +233,7 @@
         </tr>
 	<tr>
             <td>
-		<?lsmb PROCESS input element_data = {
+		<?lsmb INCLUDE input element_data = {
 			label = text('Discount:'),
 			name = "discount",
 			value = discount,
@@ -237,7 +241,7 @@
 			size = "3",
 			maxlength = 3
 		} ?>% / 
-		<?lsmb PROCESS input element_data = {
+		<?lsmb INCLUDE input element_data = {
 			name = "discount_terms",
 			value = discount_terms,
 			type = "text",
@@ -246,7 +250,7 @@
 		} ?> <?lsmb text('days') ?>
             </td>
             <td>
-		<?lsmb PROCESS input element_data = {
+		<?lsmb INCLUDE input element_data = {
 			label = text('SIC:'),
 			name = "sic_code",
 			value = sic_code,
@@ -257,19 +261,20 @@
             </td>
         </tr>
         <tr>
-            
-        <tr>
-            <td>
-		<!-- TODO:  Move to elements.html framework. -CT -->
-                <label for="notes"><?lsmb text('Notes:') ?></label><br/>
-
-                <textarea name="notes" rows="3" cols="40" id="notes"></textarea>
-            </td>
-        </tr>
+           <td> <?lsmb INCLUDE select element_data = {
+			name = "business_id"
+			options = business_types
+			default_values = [business_id]
+			text_attr = "description"
+			value_attr = "id"
+			label = text('Business Type:') #'
+			} ?> 
+	  </td>
+	</td>
     </table>
 
             <hr/>
-		<?lsmb PROCESS button element_data = {
+		<?lsmb INCLUDE button element_data = {
 			text = text('Save'),
 			class="submit" 
 			type="submit" 
@@ -278,7 +283,7 @@
 			accesskey="S" 
 			title="Save [Alt-S]"
 		} ?>
-		<?lsmb PROCESS button element_data = {
+		<?lsmb INCLUDE button element_data = {
                         class="submit" 
                         type="submit" 
                         name="action" 
@@ -287,7 +292,7 @@
                         title="Transaction [Alt-A]"
 			text = (entity_class == 1) ? text('AP Transaction') : text('AR Transaction')
 		} ?>
-		<?lsmb PROCESS button element_data = {
+		<?lsmb INCLUDE button element_data = {
                         class="submit" 
                         type="submit" 
                         name="action" 
@@ -296,7 +301,7 @@
                         title="Invoice [Alt-I]"
 			text = (entity_class == 1) ? text('Vendor Invoice')  : text('Customer Invoice') 
 		} ?>
-		<?lsmb PROCESS button element_data = {
+		<?lsmb INCLUDE button element_data = {
                         class="submit" 
                         type="submit" 
                         name="action" 
@@ -305,7 +310,7 @@
                         title="Order [Alt-O]"
 			text = (entity_class == 1) ? text('Purchase Order') : text('Sales Order')
 		} ?>
-		<?lsmb PROCESS button element_data = {
+		<?lsmb INCLUDE button element_data = {
                         class="submit" 
                         type="submit" 
                         name="action" 
@@ -314,7 +319,7 @@
                         title="Quotation [Alt-Q]"
 			text = (entity_class == 1) ? text('RFQ') : text('Quotation')
 		} ?>
-		<?lsmb PROCESS button element_data = {
+		<?lsmb INCLUDE button element_data = {
                         class="submit" 
                         type="submit" 
                         name="action" 
@@ -330,7 +335,7 @@
 <div id="location_div" class="container">
     <div class="listtop"><?lsmb text('Locations') ?></div>
 	<!-- This entire form should probably be optionaly automated with AJAX
-	in oder to prevent user confusion -->
+	in order to prevent user confusion -CT -->
     <form id="location_form" action="<?lsmb script ?>">
 	<?lsmb PROCESS input element_data = {
 		type="hidden" 
@@ -431,12 +436,14 @@
 		} #' ?>
 	</div>
 	<div> <!-- TODO:  Move to elements.html -CT -->
-		<label for="country"><?lsmb text('Country:') ?></label>
-		<select name="country" id="country">
-		<?lsmb FOREACH c = country_list ?>
-		<option value="<?lsmb c.id ?>"><?lsmb c.name ?></option>
-		<?lsmb END ?>
-		</select>
+		<?lsmb INCLUDE select element_data = {
+			text_attr = "name"
+			value_attr = "id"
+			default_values = [country]
+			options = country_list
+			name = "country"
+			label = text('Country:') 
+		} ?>
 	</div>
 	<div><?lsmb PROCESS button element_data = {
 		class = "submit" 
@@ -586,7 +593,7 @@
 		value=entity_id
 	} ?>
 <div class="input"><?lsmb PROCESS textarea element_data = {
-	label = text('Notes:')
+	label = text('Notes:<br />') # '
 	name = notes
 } ?></div>
 <div class="input">

Modified: trunk/scripts/vendor.pl
===================================================================
--- trunk/scripts/vendor.pl	2007-12-08 22:43:05 UTC (rev 1968)
+++ trunk/scripts/vendor.pl	2007-12-10 22:39:20 UTC (rev 1969)
@@ -48,14 +48,9 @@
     my $vendor = LedgerSMB::DBObject::Vendor->new(base => $request, copy => 'all');
     
     $vendor->set( entity_class=> '1' );
-    my $result = $vendor->get();
-    
-    my $template = LedgerSMB::Template->new( user => $user, 
-	template => 'contact', language => $user->{language}, 
-	path => 'UI/Contact',
-        format => 'HTML');
-    $template->render($results);
-        
+    $vendor->get();
+    $vendor->get_metadata();
+    _render_main_screen($vendor);
 }
 
 
@@ -122,7 +117,7 @@
     # URL Setup
     my $baseurl = "$request->{script}";
     my $search_url = "$base_url?action=get_results";
-    my $get_url = "$base_url?action=get";
+    my $get_url = "$base_url?action=get&account_class=$request->{account_class}";
     for (keys %$vendor){
         next if $_ eq 'order_by';
         $search_url .= "&$_=$form->{$_}";
@@ -153,20 +148,23 @@
 	push @rows, 
                 {legal_name   => $ref->{legal_name},
                 meta_number   => {text => $ref->{meta_number},
-                                  href => "$get_url&id=$ref->{entity_id}"},
+                                  href => "$get_url&entity_id=$ref->{entity_id}"},
 		business_type => $ref->{business_type},
                 curr          => $ref->{curr},
                 };
     }
-
+# CT:  The CSV Report is broken.  I get:
+# Not an ARRAY reference at 
+# /usr/lib/perl5/site_perl/5.8.8/CGI/Simple.pm line 423
+# Disabling the button for now.
     my @buttons = (
+#	{name => 'action',
+#        value => 'csv_vendor_list',
+#        text => $vendor->{_locale}->text('CSV Report'),
+#        type => 'submit',
+#        class => 'submit',
+#        },
 	{name => 'action',
-        value => 'csv_chart_of_accounts',
-        text => $vendor->{_locale}->text('CSV Report'),
-        type => 'submit',
-        class => 'submit',
-        },
-	{name => 'action',
         value => 'add',
         text => $vendor->{_locale}->text('Add Vendor'),
         type => 'submit',
@@ -179,7 +177,8 @@
 		path => 'UI' ,
     		template => 'form-dynatable', 
 		locale => $vendor->{_locale}, 
-		format => 'HTML');
+		format => ($request->{FORMAT}) ? $request->{FORMAT}  : 'HTML',
+    );
             
     $template->render({
 	form    => $vendor,
@@ -191,6 +190,12 @@
     });
 }
 
+sub csv_vendor_list {
+    my ($request) = @_;
+    $request->{FORMAT} = 'CSV';
+    get_results($request); 
+}
+
 =pod
 
 =over
@@ -204,6 +209,7 @@
 
 =cut
 
+
 sub save {
     
     my ($request) = @_;


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