summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-01 16:57:07 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-01 16:57:07 +0000
commit6684020ee63ff4cd12035e5edd8143f8b27409e9 (patch)
tree9d0c3a134e0a097ae26405a2d37512bfe2e19112 /LedgerSMB
parent9d72b626cdde34c017997fcfc46eff2d1063b3c5 (diff)
Creating customers now works.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1488 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/CT.pm54
1 files changed, 4 insertions, 50 deletions
diff --git a/LedgerSMB/CT.pm b/LedgerSMB/CT.pm
index e870323e..e9497b57 100644
--- a/LedgerSMB/CT.pm
+++ b/LedgerSMB/CT.pm
@@ -212,55 +212,10 @@ sub _save_vc {
# this should really all be replaced by an upsert.
if ( $form->{id} ) {
- $query = qq|
- DELETE FROM $form->{vc}tax
- WHERE entity_id =
- (select entity_id from $form->{vc}
- WHERE id = ?)|;
-
- $sth = $dbh->prepare($query);
- $sth->execute( $form->{id} ) || $form->dberror($query);
-
- $query = qq|
- SELECT id
- FROM $form->{vc}
- WHERE id = ?|;
-
- $sth = $dbh->prepare($query);
- $sth->execute( $form->{id} ) || $form->dberror($query);
+ # This module is depricated, so we are just going to throw an error here
+ $form->error("Updating $form->{vc} not supported. ".
+ "Please wait for us to move to the new codebase.");
- if ( $sth->fetchrow_array ) {
- $sth->finish;
- $query = qq|
- UPDATE enti
- SET discount = ?
- taxincluded = ?
- creditlimit = ?
- terms = ?
- $form->{vc}number = ?
- cc = ?
- bcc = ?
- business_id = ?
- sic_code = ?
- language_code = ?
- pricegroup_id = ?
- curr = ?
- startdate = ?
- enddate = ?
- bic = ?
- iban = ?
- WHERE id = ?|;
- $sth = $dbh->prepare($query);
- $sth->execute(
- $form->{discount}, $form->{taxincluded}, $form->{creditlimit},
- $form->{terms}, $form->{"$form->{vc}number"}, $form->{cc},
- $form->{bcc}, $form->{business_id}, $form->{sic_code},
- $form->{language_code}, $form->{pricegroup_id},
- $form->{curr}, $form->{startdate}, $form->{enddate},
- $form->{bic}, $form->{iban}, $form->{id}
- ) || $form->dberror(__FILE__.":".__LINE__.":$query");
- $updated = 1;
- }
}
if (!$updated){
# Creating Entity
@@ -307,7 +262,6 @@ sub _save_vc {
$form->{taxnumber},
$form->{sic_code});
# Creating entity_metadata record, replacing customer and vendor.
-
$query = qq|
INSERT INTO entity_credit_account
(entity_id, entity_class, discount, taxincluded, creditlimit,
@@ -350,7 +304,7 @@ sub save_customer {
my $query;
my $sth;
my $null;
-
+ $form->{vc} = 'customer';
# remove double spaces
$form->{name} =~ s/ / /g;