X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fct.pl;h=706860a1f983bdcf30dfe99c11018fd46aceb692;hb=637be9d46084bc19a08b91bc13ae541a6c36f9ef;hp=a091ff955d01b9ccf72fd13a00b715941bc631ae;hpb=bcb41cda2a33c1b7e8cd3386ae53b04ac7198f15;p=kivitendo-erp.git
diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl
index a091ff955..706860a1f 100644
--- a/bin/mozilla/ct.pl
+++ b/bin/mozilla/ct.pl
@@ -68,6 +68,31 @@ sub add {
sub search {
$lxdebug->enter_sub();
+ my $vc_business_type = $form->{db} eq "customer" ?
+ $locale->text("Customer type") : $locale->text("Vendor type");
+
+ $form->get_lists("business_types" => "ALL_BUSINESS_TYPES");
+ my (%labels, @values);
+
+ my $business_types;
+ if (scalar(@{ $form->{ALL_BUSINESS_TYPES} }) != 0) {
+ push(@values, undef);
+ foreach my $item (@{ $form->{ALL_BUSINESS_TYPES} }) {
+ push(@values, $item->{id});
+ $labels{$item->{id}} = $item->{description};
+ }
+
+ $business_types =
+ qq|
|
@@ -299,7 +334,7 @@ sub list_names {
CT->search(\%myconfig, \%$form);
$callback =
- "$form->{script}?action=list_names&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
+ "$form->{script}?action=list_names&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}&obsolete=$form->{obsolete}";
$href = $callback;
@columns =
@@ -1227,7 +1262,11 @@ sub add_transaction {
# # /saving the history
$form->isblank("name", $locale->text("Name missing!"));
- &{"CT::save_$form->{db}"}("", \%myconfig, \%$form);
+ if ($form->{"db"} eq "customer") {
+ CT->save_customer(\%myconfig, \%$form);
+ } else {
+ CT->save_vendor(\%myconfig, \%$form);
+ }
$form->{callback} = $form->escape($form->{callback}, 1);
$name = $form->escape("$form->{name}", 1);
@@ -1245,6 +1284,7 @@ sub save_and_ap_transaction {
$form->{script} = "ap.pl";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -1259,6 +1299,7 @@ sub save_and_ar_transaction {
$form->{script} = "ar.pl";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -1274,6 +1315,7 @@ sub save_and_invoice {
$form->{type} = "invoice";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -1289,6 +1331,7 @@ sub save_and_rfq {
$form->{type} = "request_quotation";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -1304,6 +1347,7 @@ sub save_and_quotation {
$form->{type} = "sales_quotation";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -1320,6 +1364,7 @@ sub save_and_order {
($form->{db} eq 'customer') ? "sales_order" : "purchase_order";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -1338,13 +1383,18 @@ sub save_and_close {
$imsg .= " saved!";
$form->isblank("name", $locale->text("Name missing!"));
- $rc = &{"CT::save_$form->{db}"}("", \%myconfig, \%$form);
+ if ($form->{"db"} eq "customer") {
+ $rc = CT->save_customer(\%myconfig, \%$form);
+ } else {
+ $rc = CT->save_vendor(\%myconfig, \%$form);
+ }
if ($rc == 3) {
$form->error($locale->text('customernumber not unique!'));
}
# saving the history
if(!exists $form->{addition}) {
- $form->{addition} = "SAVED";
+ $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
+ $form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
@@ -1364,7 +1414,12 @@ sub save {
$form->isblank("name", $locale->text("Name missing!"));
- my $res = &{"CT::save_$form->{db}"}("", \%myconfig, \%$form);
+ my $res;
+ if ($form->{"db"} eq "customer") {
+ $res = CT->save_customer(\%myconfig, \%$form);
+ } else {
+ $res = CT->save_customer(\%myconfig, \%$form);
+ }
if (3 == $res) {
if ($form->{"db"} eq "customer") {
@@ -1375,6 +1430,7 @@ sub save {
}
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -1398,6 +1454,7 @@ sub delete {
$msg .= " deleted!";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -1537,4 +1594,4 @@ sub get_delivery {
}
-sub continue { &{ $form->{nextsub} } }
+sub continue { call_sub($form->{nextsub}); }
|