[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1473] trunk
- Subject: SF.net SVN: ledger-smb: [1473] trunk
- From: ..hidden..
- Date: Wed, 29 Aug 2007 14:35:47 -0700
Revision: 1473
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1473&view=rev
Author: einhverfr
Date: 2007-08-29 14:35:46 -0700 (Wed, 29 Aug 2007)
Log Message:
-----------
Correcting a few issues with customers.
Modified Paths:
--------------
trunk/LedgerSMB/CT.pm
trunk/lsmb-request.pl
trunk/scripts/customer.pl
Added Paths:
-----------
trunk/LedgerSMB/DBObject/
trunk/LedgerSMB/DBObject/Customer.pm
Removed Paths:
-------------
trunk/LedgerSMB/Customer.pm
Modified: trunk/LedgerSMB/CT.pm
===================================================================
--- trunk/LedgerSMB/CT.pm 2007-08-28 18:03:40 UTC (rev 1472)
+++ trunk/LedgerSMB/CT.pm 2007-08-29 21:35:46 UTC (rev 1473)
@@ -247,7 +247,6 @@
curr = ?
startdate = ?
enddate = ?
- invoice_notes = ?
bic = ?
iban = ?
WHERE id = ?|;
@@ -258,7 +257,7 @@
$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 @@
$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);
}
}
Deleted: trunk/LedgerSMB/Customer.pm
===================================================================
--- trunk/LedgerSMB/Customer.pm 2007-08-28 18:03:40 UTC (rev 1472)
+++ trunk/LedgerSMB/Customer.pm 2007-08-29 21:35:46 UTC (rev 1473)
@@ -1,33 +0,0 @@
-package LedgerSMB::DBObject::Customer;
-
-use base qw(LedgerSMB);
-use LedgerSMB::DBObject;
-
-sub save_to_db {
-
- my $self = shift @_;
-
- my $id;
- if ($self->{id} >= 1) {
- $id = $self->{id};
- }
- else {
- $id = $self->next_customer_id();
- }
- $id = $self->save($id, $self->{discount}, $self->{tax_included},
- $self->{creditlimit}, $self->{terms}, $self->{customernumber},
- $self->{cc}, $self->{bcc}, $self->{business_id}, $self->{language},
- $self->{pricegroup}, $self->{currency}, $self->{startdate},
- $self->{enddate}
- );
-
- # Undef in the created field causes the system to use now() as the current
- # creation date.
- $self->location_save(
- $id, 1, $self->{line_one}, $self->{line_two}, $self->{line_three},
- $self->{city_province}, $self->{mailing_code}, $self->{country}, undef
-
- );
- return $id;
-}
-1;
\ No newline at end of file
Copied: trunk/LedgerSMB/DBObject/Customer.pm (from rev 1472, trunk/LedgerSMB/Customer.pm)
===================================================================
--- trunk/LedgerSMB/DBObject/Customer.pm (rev 0)
+++ trunk/LedgerSMB/DBObject/Customer.pm 2007-08-29 21:35:46 UTC (rev 1473)
@@ -0,0 +1,33 @@
+package LedgerSMB::DBObject::Customer;
+
+use base qw(LedgerSMB);
+use LedgerSMB::DBObject;
+
+sub save_to_db {
+
+ my $self = shift @_;
+
+ my $id;
+ if ($self->{id} >= 1) {
+ $id = $self->{id};
+ }
+ else {
+ $id = $self->next_customer_id();
+ }
+ $id = $self->save($id, $self->{discount}, $self->{tax_included},
+ $self->{creditlimit}, $self->{terms}, $self->{customernumber},
+ $self->{cc}, $self->{bcc}, $self->{business_id}, $self->{language},
+ $self->{pricegroup}, $self->{currency}, $self->{startdate},
+ $self->{enddate}
+ );
+
+ # Undef in the created field causes the system to use now() as the current
+ # creation date.
+ $self->location_save(
+ $id, 1, $self->{line_one}, $self->{line_two}, $self->{line_three},
+ $self->{city_province}, $self->{mailing_code}, $self->{country}, undef
+
+ );
+ return $id;
+}
+1;
\ No newline at end of file
Modified: trunk/lsmb-request.pl
===================================================================
--- trunk/lsmb-request.pl 2007-08-28 18:03:40 UTC (rev 1472)
+++ trunk/lsmb-request.pl 2007-08-29 21:35:46 UTC (rev 1473)
@@ -48,7 +48,7 @@
}
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";
Modified: trunk/scripts/customer.pl
===================================================================
--- trunk/scripts/customer.pl 2007-08-28 18:03:40 UTC (rev 1472)
+++ trunk/scripts/customer.pl 2007-08-29 21:35:46 UTC (rev 1473)
@@ -17,7 +17,7 @@
=cut
-package LedgerSMB::Scripts::Customer;
+package LedgerSMB::Scripts::customer;
use LedgerSMB::Template;
use LedgerSMB::DBObject::Customer;
@@ -40,7 +40,7 @@
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 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 @@
=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 @@
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 @@
$template->render($result);
}
-1;
\ No newline at end of file
+1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.