X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=767d0e87d5625f8b70c40d8ffdb9ef7b09ae92af;hb=db68b6fd72b9f0d7d8be953746c0e7d6154f5eaf;hp=896bc4aef0ffe7963d307ea4c31e7246e95d677a;hpb=f7c5820cdac7e13d95586b9ff2775ca5198118c6;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 896bc4aef..767d0e87d 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -543,14 +543,8 @@ sub list_names { {password}> |; + . $locale->text('Add') . qq|"> - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| @@ -563,6 +557,10 @@ sub list_names { sub edit { $lxdebug->enter_sub(); + # show history button + $form->{javascript} = qq||; + #/show hhistory button + # $locale->text('Edit Customer') # $locale->text('Edit Vendor') @@ -675,6 +673,7 @@ sub form_header { my $pjy = new CGI::Ajax( 'get_shipto' => $get_shipto_url ); $form->{selectshipto} = ""; + $form->{selectshipto} .= ""; if (@{ $form->{SHIPTO} }) { foreach $item (@{ $form->{SHIPTO} }) { if ($item->{shipto_id} == $form->{shipto_id}) { @@ -863,6 +862,7 @@ sub form_header { # $locale->text('Customer Number') # $locale->text('Vendor Number') $form->{fokus} = "ct.greeting"; + $form->{jsscript} = 1; $form->header; print qq| @@ -953,9 +953,9 @@ sub form_header { | . $locale->text('Credit Limit') . qq| - | . $locale->text('Terms: Net') . qq| - | - . $locale->text('days') . qq| + + | . $locale->text('Payment Terms') . qq| + | . $locale->text('Discount') . qq| % @@ -991,9 +991,6 @@ sub form_header { | . $locale->text('Obsolete') . qq| {obsolete}> - | . $locale->text('Payment Terms') . qq| - $taxzone @@ -1167,9 +1164,11 @@ $shipto $delivery | . $locale->text('From') . qq| - - | . $locale->text('Bis') . qq| - + + + | . $locale->text('To (time)') . qq| + + @@ -1182,7 +1181,8 @@ $shipto -|; +| . $form->write_trigger(\%myconfig, 2, "fromB", "BL", "trigger_from", + "toB", "BL", "trigger_to"); $lxdebug->leave_sub(); } @@ -1247,10 +1247,16 @@ $update_button . qq|">\n|; } - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; + # button for saving history + if($form->{id} ne "") { + print qq| + {id} + . qq|); name=history id=history value=| + . $locale->text('history') + . qq|>|; } + # /button for saving history print qq| @@ -1269,6 +1275,13 @@ initializetabcontent("maintab") sub add_transaction { $lxdebug->enter_sub(); +# # saving the history +# if(!exists $form->{addition}) { +# $form->{addition} = "ADD TRANSACTION"; +# $form->save_history($form->dbconnect(\%myconfig)); +# } +# # /saving the history + $form->isblank("name", $locale->text("Name missing!")); if ($vertreter && $form->{db} eq "customer") { $form->isblank("salesman_id", $locale->text("Salesman missing!")); @@ -1280,7 +1293,6 @@ sub add_transaction { $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->redirect; $lxdebug->leave_sub(); @@ -1290,8 +1302,13 @@ sub save_and_ap_transaction { $lxdebug->enter_sub(); $form->{script} = "ap.pl"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1299,8 +1316,13 @@ sub save_and_ar_transaction { $lxdebug->enter_sub(); $form->{script} = "ar.pl"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1309,8 +1331,13 @@ sub save_and_invoice { $form->{script} = ($form->{db} eq 'customer') ? "is.pl" : "ir.pl"; $form->{type} = "invoice"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1319,8 +1346,13 @@ sub save_and_rfq { $form->{script} = "oe.pl"; $form->{type} = "request_quotation"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1329,8 +1361,13 @@ sub save_and_quotation { $form->{script} = "oe.pl"; $form->{type} = "sales_quotation"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1340,8 +1377,13 @@ sub save_and_order { $form->{script} = "oe.pl"; $form->{type} = ($form->{db} eq 'customer') ? "sales_order" : "purchase_order"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &add_transaction; - $lxdebug->leave_sub(); } @@ -1362,6 +1404,12 @@ sub save_and_close { if ($rc == 3) { $form->error($locale->text('customernumber not unique!')); } + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $form->redirect($locale->text($msg)); $lxdebug->leave_sub(); @@ -1380,9 +1428,22 @@ sub save { if ($vertreter && $form->{db} eq "customer") { $form->isblank("salesman_id", $locale->text("Salesman missing!")); } - print(STDERR "SHIPTO in sub save $form->{shipto_id}\n"); - &{"CT::save_$form->{db}"}("", \%myconfig, \%$form); + my $res = &{"CT::save_$form->{db}"}("", \%myconfig, \%$form); + + if (3 == $res) { + if ($form->{"db"} eq "customer") { + $form->error($locale->text('This customer number is already in use.')); + } else { + $form->error($locale->text('This vendor number is already in use.')); + } + } + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &edit; exit; $lxdebug->leave_sub(); @@ -1400,6 +1461,12 @@ sub delete { $msg = ucfirst $form->{db}; $msg .= " deleted!"; + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $form->redirect($locale->text($msg)); $msg = "Cannot delete $form->{db}"; @@ -1607,7 +1674,6 @@ sub get_contact { } - sub get_shipto { $lxdebug->enter_sub();