X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fct.pl;h=e5ba1ddf8ff48d4fe44667b360a374b20a20699b;hb=b5157f97d47413e5f33cced1d0de527979ff3d61;hp=de231974aaf68f0530ec8e1be7390263243b551a;hpb=0c472ce6b2b803cd57b8361d778fb711dc3549ba;p=kivitendo-erp.git
diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl
index de231974a..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);
@@ -199,7 +199,6 @@ sub search {
-{path}>
{login}>
{password}>
@@ -313,7 +312,6 @@ sub search_delivery {
-{path}>
{login}>
{password}>
@@ -334,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}&obsolete=$form->{obsolete}";
+ "$form->{script}?action=list_names&db=$form->{db}&login=$form->{login}&password=$form->{password}&status=$form->{status}&obsolete=$form->{obsolete}";
$href = $callback;
@columns =
@@ -496,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};
@@ -511,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++;
@@ -555,7 +553,6 @@ sub list_names {
{db}>
-{path}>
{login}>
{password}>
@@ -601,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} =
@@ -644,27 +642,23 @@ sub form_header {
}
}
- if (@{ $form->{TAXZONE} }) {
- foreach $item (@{ $form->{TAXZONE} }) {
- if ($item->{id} == $form->{taxzone_id}) {
- $form->{selecttaxzone} .=
- "";
@@ -688,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} = "";
@@ -716,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 );
@@ -1198,7 +1192,6 @@ sub form_footer {
-{path}>
{login}>
{password}>
@@ -1262,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();
@@ -1280,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));
}
@@ -1294,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));
}
@@ -1309,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));
}
@@ -1324,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));
}
@@ -1339,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));
}
@@ -1355,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));
}
@@ -1373,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
@@ -1399,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") {
@@ -1410,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));
}
@@ -1433,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));
}
@@ -1572,4 +1587,4 @@ sub get_delivery {
}
-sub continue { &{ $form->{nextsub} } }
+sub continue { call_sub($form->{nextsub}); }