X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=767d0e87d5625f8b70c40d8ffdb9ef7b09ae92af;hb=7712480e4a082f84a2229f5b1a90d79a6c01255b;hp=09068dce4ad72353d2ddc1f5d1abda7615778ce1;hpb=5b9f9bd6fc967ee0978be32dbe50414af0e55bb1;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 09068dce4..767d0e87d 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -38,6 +38,9 @@ # $locale->text('Add Vendor') use SL::CT; +use CGI::Ajax; +use CGI; +use Data::Dumper; 1; @@ -182,6 +185,128 @@ sub search { $lxdebug->leave_sub(); } +sub search_delivery { + $lxdebug->enter_sub(); + + $label = ucfirst $form->{db}; + $form->{title} = $locale->text($label . "s"); + + if ($form->{db} eq 'vendor') { + $gifi = qq| + | + . $locale->text('GIFI') . qq| +|; + } + + $form->header; + + print qq| + + +
{script}> + +{db}> + + + + + + + + + + + + +
$form->{title}
+ + + + + + + + + + + + + + + + + + + + + + + + + +
| . $locale->text($label . ' Number') . qq|{db}number size=35>
| . $locale->text('Company Name') . qq|
| . $locale->text('Contact') . qq|
| . $locale->text('E-mail') . qq|
 | + . $locale->text('All') . qq| +  | + . $locale->text('Orphaned') . qq|
| . $locale->text('Include in Report') . qq| + + + + + + + + + + + + + + + + $gifi + + + + + + + + +
| + . $locale->text('ID') . qq| | + . $locale->text($label . ' Number') . qq| | + . $locale->text('Company Name') . qq| | + . $locale->text('Address') . qq|
| + . $locale->text('Contact') . qq| | + . $locale->text('Phone') . qq| | + . $locale->text('Fax') . qq| | + . $locale->text('E-mail') . qq|
| + . $locale->text('Tax Number') . qq| | + . $locale->text('SIC') . qq| | + . $locale->text('Type of Business') . qq|
| + . $locale->text('Invoices') . qq| | + . $locale->text('Orders') . qq| | + . $locale->text('Quotations') . qq|
+
+

+ + + +{path}> +{login}> +{password}> + +
+ +
+ + + +|; + $lxdebug->leave_sub(); +} + sub list_names { $lxdebug->enter_sub(); @@ -418,14 +543,8 @@ sub list_names { {password}> |; + . $locale->text('Add') . qq|"> - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| @@ -438,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') @@ -463,6 +586,7 @@ sub form_header { $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : ""; $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0); + $form->{discount} = $form->format_amount(\%myconfig, $form->{discount}); if ($myconfig{role} eq 'admin') { $bcc = qq| @@ -473,16 +597,118 @@ sub form_header { |; } $form->{obsolete} = "checked" if $form->{obsolete}; - %langs = (de => "deutsch", en => "englisch", fr => "französisch"); + $lang = qq||; - foreach $item (keys %langs) { - if ($form->{language} eq $item) { - $lang .= qq||; + foreach $item (@{ $form->{languages} }) { + if ($form->{language_id} eq $item->{id}) { + $lang .= qq||; + } else { + $lang .= qq||; + } + } + + $payment = qq||; + foreach $item (@{ $form->{payment_terms} }) { + if ($form->{payment_id} eq $item->{id}) { + $payment .= qq||; + } else { + $payment .= qq||; + } + } + + if (!$form->{id}) { + if ($form->{db} eq "customer") { + $form->{taxzone_id} = 0; } else { - $lang .= qq||; + $form->{taxzone_id} = 0; + } + } + + if (@{ $form->{TAXZONE} }) { + foreach $item (@{ $form->{TAXZONE} }) { + if ($item->{id} == $form->{taxzone_id}) { + $form->{selecttaxzone} .= + ""; + if (@{ $form->{CONTACTS} }) { + foreach $item (@{ $form->{CONTACTS} }) { + if ($item->{cp_id} == $form->{cp_id}) { + $form->{selectcontact} .= + qq|\n|; + } else { + $form->{selectcontact} .= + qq|\n|; + } + + } + } + push(@ { $form->{AJAX} }, $pjx); + $ansprechpartner = qq| + + | . $locale->text('Ansprechpartner') . qq| + + + |; + $get_shipto_url = + "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=get_shipto"; + + 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}) { + $form->{selectshipto} .= + "|; } @{ $form->{GREETINGS} }); $select_greeting .= qq||; + + $select_company_greeting = + qq| |; + + $select_department = + qq| |; ## /LINET if ($form->{db} eq 'customer') { - #get pricegroup and form it - $form->get_pricegroup(\%myconfig, { all => 1 }); - $form->{pricegroup} = "$form->{klass}"; - $form->{pricegroup_id} = "$form->{klass}"; + #get pricegroup and form it + $form->get_pricegroup(\%myconfig, { all => 1 }); - if (@{ $form->{all_pricegroup} }) { + $form->{pricegroup} = "$form->{klass}"; + $form->{pricegroup_id} = "$form->{klass}"; - $form->{selectpricegroup} = qq|