From 2754d8bdcb9d1e85f569490f21ff931c65d5949a Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 10 Dec 2007 22:39:20 +0000 Subject: Minor Customer/Vendor fixes git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1969 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/DBObject.pm | 1 - LedgerSMB/DBObject/Company.pm | 10 ++++++ LedgerSMB/DBObject/Menu.pm | 1 - UI/Contact/contact.html | 73 ++++++++++++++++++++++++------------------- scripts/vendor.pl | 42 ++++++++++++++----------- 5 files changed, 74 insertions(+), 53 deletions(-) diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm index 6366e957..2a8d976b 100644 --- a/LedgerSMB/DBObject.pm +++ b/LedgerSMB/DBObject.pm @@ -130,7 +130,6 @@ sub exec_method { for (@in_args) { push @call_args, $_ } ; $self->{call_args} = \@call_args; - $self->debug({file => '/tmp/dbobject'}); return $self->call_procedure( procname => $funcname, args => \@call_args ); } diff --git a/LedgerSMB/DBObject/Company.pm b/LedgerSMB/DBObject/Company.pm index ed94b015..08e0ebc8 100644 --- a/LedgerSMB/DBObject/Company.pm +++ b/LedgerSMB/DBObject/Company.pm @@ -33,6 +33,9 @@ sub get_metadata { @{$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 @@ sub save_notes { $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 @_; diff --git a/LedgerSMB/DBObject/Menu.pm b/LedgerSMB/DBObject/Menu.pm index ca3fae39..62de68ba 100644 --- a/LedgerSMB/DBObject/Menu.pm +++ b/LedgerSMB/DBObject/Menu.pm @@ -71,7 +71,6 @@ sub generate_section { sub __generate { my ($self) = @_; - $self->debug({file => '/tmp/menu'}); my @args; shift @{$self->{menu_items}}; diff --git a/UI/Contact/contact.html b/UI/Contact/contact.html index 0504e976..8ea851e0 100644 --- a/UI/Contact/contact.html +++ b/UI/Contact/contact.html @@ -1,4 +1,8 @@ - + @@ -155,12 +159,12 @@ problems with multi-word single-quoted constructs in PI tags. -CT --> size = "20" } ?>

+ } # " ?>
- - - - + +
@@ -188,7 +192,7 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
- } #' ?> -
- } #' ?> -
- size = "3", maxlength = 3 } ?>% / - } ?> -
- -
- - -
+

- accesskey="S" title="Save [Alt-S]" } ?> - title="Transaction [Alt-A]" text = (entity_class == 1) ? text('AP Transaction') : text('AR Transaction') } ?> - title="Invoice [Alt-I]" text = (entity_class == 1) ? text('Vendor Invoice') : text('Customer Invoice') } ?> - title="Order [Alt-O]" text = (entity_class == 1) ? text('Purchase Order') : text('Sales Order') } ?> - title="Quotation [Alt-Q]" text = (entity_class == 1) ? text('RFQ') : text('Quotation') } ?> -
+ in order to prevent user confusion -CT -->
} #' ?>
- - +
value=entity_id } ?>
') # ' name = notes } ?>
diff --git a/scripts/vendor.pl b/scripts/vendor.pl index 70c6318c..f84cee1d 100644 --- a/scripts/vendor.pl +++ b/scripts/vendor.pl @@ -48,14 +48,9 @@ sub get { 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 @@ sub get_results { # 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,19 +148,22 @@ sub get_results { 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_chart_of_accounts', - text => $vendor->{_locale}->text('CSV Report'), - type => 'submit', - class => 'submit', - }, +# {name => 'action', +# value => 'csv_vendor_list', +# text => $vendor->{_locale}->text('CSV Report'), +# type => 'submit', +# class => 'submit', +# }, {name => 'action', value => 'add', text => $vendor->{_locale}->text('Add Vendor'), @@ -179,7 +177,8 @@ sub get_results { 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 get_results { }); } +sub csv_vendor_list { + my ($request) = @_; + $request->{FORMAT} = 'CSV'; + get_results($request); +} + =pod =over @@ -204,6 +209,7 @@ vendor as needed, and will generate a new Company ID for the vendor if needed. =cut + sub save { my ($request) = @_; -- cgit v1.2.3