X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fct.pl;h=e5ba1ddf8ff48d4fe44667b360a374b20a20699b;hb=c1d8418b5244d224298431369c69ea971a69f3c2;hp=b3834fde555e0e2e610b0e285dedd05ea24d1029;hpb=272ff5b05b65ceea4d33a122a7d87464fc119475;p=kivitendo-erp.git
diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl
index b3834fde5..e5ba1ddf8 100644
--- a/bin/mozilla/ct.pl
+++ b/bin/mozilla/ct.pl
@@ -54,7 +54,7 @@ sub add {
$form->{title} = "Add";
$form->{callback} =
- "$form->{script}?action=add&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}"
+ "$form->{script}?action=add&db=$form->{db}&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
CT->populate_drop_down_boxes(\%myconfig, \%$form);
@@ -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|
+ ${vc_business_type} |
+ |
+ . NTI($cgi->popup_menu('-name' => 'business_id', '-values' => \@values,
+ '-labels' => \%labels))
+ . qq| |
+
+|;
+ }
+
$label = ucfirst $form->{db};
$form->{title} = $locale->text($label . "s");
@@ -104,12 +129,22 @@ sub search {
| . $locale->text('E-mail') . qq| |
|
+ $business_types
|
|
. $locale->text('All') . qq|
|
. $locale->text('Orphaned') . qq| |
+
+
+ |
+ |
+ . $locale->text('All') . qq|
+ |
+ . $locale->text('Obsolete') . qq|
+ |
+ . $locale->text('Not obsolete') . qq| |
| . $locale->text('Include in Report') . qq| |
@@ -141,7 +176,7 @@ sub search {
|
. $locale->text('SIC') . qq| |
|
- . $locale->text('Type of Business') . qq| |
+ . $vc_business_type . qq|
|
@@ -164,7 +199,6 @@ sub search {
-{path}>
{login}>
{password}>
@@ -278,7 +312,6 @@ sub search_delivery {
-{path}>
{login}>
{password}>
@@ -299,7 +332,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}&login=$form->{login}&password=$form->{password}&status=$form->{status}&obsolete=$form->{obsolete}";
$href = $callback;
@columns =
@@ -461,7 +494,7 @@ sub list_names {
(invnumber, ordnumber, quonumber);
$column_data{name} =
- " | {script}?action=edit&id=$ref->{id}&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}&callback=$callback>$ref->{name} | ";
+ "{script}?action=edit&id=$ref->{id}&db=$form->{db}&login=$form->{login}&password=$form->{password}&status=$form->{status}&callback=$callback>$ref->{name} | ";
if ($ref->{email}) {
$email = $ref->{email};
@@ -476,17 +509,17 @@ sub list_names {
if ($ref->{formtype} eq 'invoice') {
$column_data{invnumber} =
- "{module}.pl?action=edit&id=$ref->{invid}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber} | ";
+ "{module}.pl?action=edit&id=$ref->{invid}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber} | ";
}
if ($ref->{formtype} eq 'order') {
$column_data{ordnumber} =
- "{module}.pl?action=edit&id=$ref->{invid}&type=$ordertype&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{ordnumber} | ";
+ "{module}.pl?action=edit&id=$ref->{invid}&type=$ordertype&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{ordnumber} | ";
}
if ($ref->{formtype} eq 'quotation') {
$column_data{quonumber} =
- "{module}.pl?action=edit&id=$ref->{invid}&type=$quotationtype&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{quonumber} | ";
+ "{module}.pl?action=edit&id=$ref->{invid}&type=$quotationtype&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{quonumber} | ";
}
$i++;
@@ -520,7 +553,6 @@ sub list_names {
{db}>
-{path}>
{login}>
{password}>
@@ -566,7 +598,8 @@ sub edit {
sub form_header {
$lxdebug->enter_sub();
- $form->get_lists("employees" => "ALL_SALESMEN");
+ $form->get_lists("employees" => "ALL_SALESMEN",
+ "taxzones" => "ALL_TAXZONES");
$form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
$form->{creditlimit} =
@@ -609,27 +642,23 @@ sub form_header {
}
}
- if (@{ $form->{TAXZONE} }) {
- foreach $item (@{ $form->{TAXZONE} }) {
- if ($item->{id} == $form->{taxzone_id}) {
- $form->{selecttaxzone} .=
- "";
@@ -653,7 +682,7 @@ sub form_header {
|;
$get_shipto_url =
- "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=get_shipto";
+ "$form->{script}?login=$form->{login}&password=$form->{password}&action=get_shipto";
my $pjy = new CGI::Ajax( 'get_shipto' => $get_shipto_url );
$form->{selectshipto} = "";
@@ -681,7 +710,7 @@ sub form_header {
$get_delivery_url =
- "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=get_delivery";
+ "$form->{script}?login=$form->{login}&password=$form->{password}&action=get_delivery";
my $pjz = new CGI::Ajax( 'get_delivery' => $get_delivery_url );
@@ -1027,75 +1056,75 @@ $shipto
$ansprechpartner
| . $locale->text('Greeting') . qq| |
-
+ |
$select_greeting |
| . $locale->text('Title') . qq| |
-
+ |
$select_title |
| . $locale->text('Department') . qq| |
-
+ |
$select_department |
|
. $locale->text('Given Name') . qq| |
- |
+ |
| . $locale->text('Name') . qq| |
- |
+ |
| . $locale->text('Phone1') . qq| |
- |
+ |
| . $locale->text('Phone2') . qq| |
- |
+ |
| . $locale->text('Fax') . qq| |
- |
+ |
| . $locale->text('Mobile1') . qq| |
- |
+ |
| . $locale->text('Mobile2') . qq| |
- |
+ |
| . $locale->text('Sat. Phone') . qq| |
- |
+ |
| . $locale->text('Sat. Fax') . qq| |
- |
+ |
| . $locale->text('Project') . qq| |
- |
+ |
| . $locale->text('E-mail') . qq| |
- |
+ |
| . $locale->text('Private Phone') . qq| |
- |
+ |
| . $locale->text('Private E-mail') . qq| |
- |
+ |
| . $locale->text('Birthday') . qq| |
- |
+ |
@@ -1163,7 +1192,6 @@ sub form_footer {
-{path}>
{login}>
{password}>
@@ -1227,13 +1255,17 @@ 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);
$form->{callback} =
- "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=add&vc=$form->{db}&$form->{db}_id=$form->{id}&$form->{db}=$name&type=$form->{type}&callback=$form->{callback}";
+ "$form->{script}?login=$form->{login}&password=$form->{password}&action=add&vc=$form->{db}&$form->{db}_id=$form->{id}&$form->{db}=$name&type=$form->{type}&callback=$form->{callback}";
$form->redirect;
$lxdebug->leave_sub();
@@ -1245,6 +1277,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 +1292,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 +1308,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 +1324,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 +1340,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 +1357,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 +1376,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 +1407,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_vendor(\%myconfig, \%$form);
+ }
if (3 == $res) {
if ($form->{"db"} eq "customer") {
@@ -1375,6 +1423,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 +1447,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 +1587,4 @@ sub get_delivery {
}
-sub continue { &{ $form->{nextsub} } }
+sub continue { call_sub($form->{nextsub}); }