summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LedgerSMB/DBObject.pm1
-rw-r--r--LedgerSMB/DBObject/Company.pm10
-rw-r--r--LedgerSMB/DBObject/Menu.pm1
-rw-r--r--UI/Contact/contact.html73
-rw-r--r--scripts/vendor.pl42
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 @@
-<?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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
</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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
} #' ?>
</td>
<td>
- <?lsmb PROCESS input element_data = {
+ <?lsmb INCLUDE input element_data = {
label = text('Terms:'),
name = "terms",
value = terms,
@@ -209,7 +213,7 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
<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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
} #' ?>
</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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
</tr>
<tr>
<td>
- <?lsmb PROCESS input element_data = {
+ <?lsmb INCLUDE input element_data = {
label = text('Discount:'),
name = "discount",
value = discount,
@@ -237,7 +241,7 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
} ?> <?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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
</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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
<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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
} #' ?>
</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 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
value=entity_id
} ?>
<div class="input"><?lsmb PROCESS textarea element_data = {
- label = text('Notes:')
+ label = text('Notes:<br />') # '
name = notes
} ?></div>
<div class="input">
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) = @_;