+
+ $payment = qq|<option value=""></option>|;
+ foreach $item (@{ $form->{payment_terms} }) {
+ if ($form->{payment_id} eq $item->{id}) {
+ $payment .= qq|<option value="$item->{id}" selected>$item->{description}</option>|;
+ } else {
+ $payment .= qq|<option value="$item->{id}">$item->{description}</option>|;
+ }
+ }
+
+ if (!$form->{id}) {
+ if ($form->{db} eq "customer") {
+ $form->{taxzone_id} = 0;
+ } else {
+ $form->{taxzone_id} = 0;
+ }
+ }
+
+ if (@{ $form->{TAXZONE} }) {
+ foreach $item (@{ $form->{TAXZONE} }) {
+ if ($item->{id} == $form->{taxzone_id}) {
+ $form->{selecttaxzone} .=
+ "<option value=$item->{id} selected>$item->{description}\n";
+ } else {
+ $form->{selecttaxzone} .=
+ "<option value=$item->{id}>$item->{description}\n";
+ }
+
+ }
+ }
+
+ $taxzone = qq|
+ <tr>
+ <th align=right>| . $locale->text('Steuersatz') . qq|</th>
+ <td><select name=taxzone_id>$form->{selecttaxzone}</select></td>
+ <input type=hidden name=selecttaxzone value="$form->{selecttaxzone}">
+ </tr>|;
+
+ $get_contact_url =
+ "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=get_contact";
+
+ my $pjx = new CGI::Ajax( 'get_contact' => $get_contact_url );
+ $form->{selectcontact} = "<option value=0></option>";
+ if (@{ $form->{CONTACTS} }) {
+ foreach $item (@{ $form->{CONTACTS} }) {
+ if ($item->{cp_id} == $form->{cp_id}) {
+ $form->{selectcontact} .=
+ qq|<option value=$item->{cp_id} selected>$item->{cp_name}</option>\n|;
+ } else {
+ $form->{selectcontact} .=
+ qq|<option value=$item->{cp_id}>$item->{cp_name}</option>\n|;
+ }
+
+ }
+ }
+ push(@ { $form->{AJAX} }, $pjx);
+ $ansprechpartner = qq|
+ <tr>
+ <th align=right>| . $locale->text('Ansprechpartner') . qq|</th>
+ <td><select id=cp_id name=cp_id onChange="get_contact(['cp_id__' + this.value], ['cp_name', 'cp_greeting', 'cp_title', 'cp_givenname', 'cp_phone1', 'cp_phone2', 'cp_email', 'cp_abteilung', 'cp_fax', 'cp_mobile1', 'cp_mobile2', 'cp_satphone', 'cp_satfax', 'cp_project', 'cp_privatphone', 'cp_privatemail', 'cp_birthday'])">$form->{selectcontact}</select></td>
+ <input type=hidden name=selectcontact value="$form->{selectcontact}">
+ </tr>|;
+ $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} = "<option value=0></option>";
+ if (@{ $form->{SHIPTO} }) {
+ foreach $item (@{ $form->{SHIPTO} }) {
+ if ($item->{id} == $form->{shipto_id}) {
+ $form->{selectshipto} .=
+ "<option value=$item->{id} selected>$item->{shiptoname}\n";
+ } else {
+ $form->{selectshipto} .=
+ "<option value=$item->{id}>$item->{shiptoname}\n";
+ }
+
+ }
+ }
+ push(@ { $form->{AJAX} }, $pjy);
+
+ $shipto = qq|
+ <tr>
+ <th align=right>| . $locale->text('Shipping Address') . qq|</th>
+ <td><select id=shipto_id name=shipto_id onChange="get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail'])">$form->{selectshipto}</select></td>
+ <input type=hidden name=selectshipto value="$form->{selectshipto}">
+ </tr>|;
+
+
+ $get_delivery_url =
+ "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=get_delivery";
+
+ my $pjz = new CGI::Ajax( 'get_delivery' => $get_delivery_url );
+
+ push(@ { $form->{AJAX} }, $pjz);
+
+ $delivery = qq|
+ <tr>
+ <th align=right>| . $locale->text('Shipping Address') . qq|</th>
+ <td><select id=delivery_id name=delivery_id onChange="get_delivery(['shipto_id__' + this.value, 'from__' + from.value, 'to__' + to.value], ['delivery'])">$form->{selectshipto}</select></td>
+ </tr>|;
+