summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LedgerSMB/CT.pm10
-rw-r--r--LedgerSMB/DBObject/Customer.pm (renamed from LedgerSMB/Customer.pm)0
-rw-r--r--lsmb-request.pl2
-rw-r--r--scripts/customer.pl20
4 files changed, 17 insertions, 15 deletions
diff --git a/LedgerSMB/CT.pm b/LedgerSMB/CT.pm
index c398b108..e870323e 100644
--- a/LedgerSMB/CT.pm
+++ b/LedgerSMB/CT.pm
@@ -247,7 +247,6 @@ sub _save_vc {
curr = ?
startdate = ?
enddate = ?
- invoice_notes = ?
bic = ?
iban = ?
WHERE id = ?|;
@@ -258,7 +257,7 @@ sub _save_vc {
$form->{bcc}, $form->{business_id}, $form->{sic_code},
$form->{language_code}, $form->{pricegroup_id},
$form->{curr}, $form->{startdate}, $form->{enddate},
- $form->{invoice_notes}, $form->{bic}, $form->{iban}, $form->{id}
+ $form->{bic}, $form->{iban}, $form->{id}
) || $form->dberror(__FILE__.":".__LINE__.":$query");
$updated = 1;
}
@@ -338,13 +337,6 @@ sub _save_vc {
$sth = $dbh->prepare($query);
$sth->execute($form->{entity_id}, $form->{bic}, $form->{iban}) ||
$form->dberror($query);
- $query = qq|
- insert into entity_invoice_notes (entity_id, note)
- values (?, ?)
- |;
- $sth = $dbh->prepare($query);
- $sth->execute($form->{entity_id}, $form->{notes}) ||
- $form->dberror($query);
}
}
diff --git a/LedgerSMB/Customer.pm b/LedgerSMB/DBObject/Customer.pm
index ef25c4a1..ef25c4a1 100644
--- a/LedgerSMB/Customer.pm
+++ b/LedgerSMB/DBObject/Customer.pm
diff --git a/lsmb-request.pl b/lsmb-request.pl
index 473ea39f..d848c484 100644
--- a/lsmb-request.pl
+++ b/lsmb-request.pl
@@ -48,7 +48,7 @@ if (!$script){
}
eval { require "scripts/$script" }
- || $request->error($locale->text('Unable to open script') . ": $script : $!");
+ || $request->error($locale->text('Unable to open script') . ": scripts/$script : $!");
$script =~ s/\.pl$//;
$script = "LedgerSMB::Scripts::$script";
diff --git a/scripts/customer.pl b/scripts/customer.pl
index 8b476995..dfef02cd 100644
--- a/scripts/customer.pl
+++ b/scripts/customer.pl
@@ -17,7 +17,7 @@ Save customer will update or create as needed.
=cut
-package LedgerSMB::Scripts::Customer;
+package LedgerSMB::Scripts::customer;
use LedgerSMB::Template;
use LedgerSMB::DBObject::Customer;
@@ -40,7 +40,7 @@ of the customer informations.
sub get {
- my ($class, $request) = @_;
+ my ($request) = @_;
my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all');
my $result = $customer->get($customer->{id});
@@ -51,6 +51,16 @@ sub get {
}
+sub add {
+ my ($request) = @_;
+ my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all');
+
+ my $template = LedgerSMB::Template->new( user => $user,
+ template => 'customer.html', language => $user->{language},
+ format => 'html');
+ $template->render($results);
+}
+
=pod
=over
@@ -68,7 +78,7 @@ as well as customer/Company name.
=cut
sub search {
- my ($class, $request) = @_;
+ my ($request) = @_;
my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all');
my $results = $customer->search($customer->{search_pattern});
@@ -93,7 +103,7 @@ customer as needed, and will generate a new Company ID for the customer if neede
sub save {
- my ($class, $request) = @_;
+ my ($request) = @_;
my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all');
my $result = $customer->save_to_db();
@@ -103,4 +113,4 @@ sub save {
$template->render($result);
}
-1; \ No newline at end of file
+1;