my @values;
foreach my $item (qw(name department_1 department_2 street zipcode city country
- contact phone fax email)) {
+ contact cp_gender phone fax email)) {
if ($self->{"shipto$item"}) {
$shipto = 1 if ($self->{$item} ne $self->{"shipto$item"});
}
shiptocity = ?,
shiptocountry = ?,
shiptocontact = ?,
+ shiptocp_gender = ?,
shiptophone = ?,
shiptofax = ?,
shiptoemail = ?
shiptocity = ? AND
shiptocountry = ? AND
shiptocontact = ? AND
+ shiptocp_gender = ? AND
shiptophone = ? AND
shiptofax = ? AND
shiptoemail = ? AND
$query =
qq|INSERT INTO shipto (trans_id, shiptoname, shiptodepartment_1, shiptodepartment_2,
shiptostreet, shiptozipcode, shiptocity, shiptocountry,
- shiptocontact, shiptophone, shiptofax, shiptoemail, module)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
+ shiptocontact, shiptocp_gender, shiptophone, shiptofax, shiptoemail, module)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
do_query($self, $dbh, $query, $id, @values, $module);
}
}
my @shipto_vars =
qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry
- shiptocontact shiptophone shiptofax shiptoemail
+ shiptocontact shiptocp_gender shiptophone shiptofax shiptoemail
shiptodepartment_1 shiptodepartment_2);
my @addr_vars =
? $locale->text('Customer Number')
: $locale->text('Vendor Number');
+ # sieht nicht nett aus, funktioniert aber
+ # das vorausgewählte select-feld wird über shiptocp_gender
+ # entsprechend vorbelegt
+ my $selected_m='';
+ my $selected_f='';
+ if ($form->{shiptocp_gender} eq 'm') {
+ $selected_m='selected';
+ $selected_f='';
+ } elsif ($form->{shiptocp_gender} eq 'f') {
+ $selected_m='';
+ $selected_f='selected';
+ }
+
# get pricegroups for parts
IS->get_pricegroups_for_parts(\%myconfig, \%$form);
<td>$form->{contact}</td>
<td><input name="shiptocontact" size="35" value="$form->{shiptocontact}"></td>
</tr>
+ <tr>
+ <th align="right" nowrap>| . $locale->text('Gender') . qq|</th>
+ <td></td>
+ <td><select id="shiptocp_gender" name="shiptocp_gender">
+ <option value="m"| . $selected_m . qq|>| . $locale->text('male') . qq|</option>
+ <option value="f"| . $selected_f . qq|>| . $locale->text('female') . qq|</option>
+ </select>
+ </td>
+ </tr>
<tr>
<th align="right" nowrap>| . $locale->text('Phone') . qq|</th>
<td>$form->{phone}</td>
<input type="hidden" name="saved_donumber" value="[% HTML.escape(saved_donumber) %]">
<input type="hidden" name="shiptocity" value="[% HTML.escape(shiptocity) %]">
<input type="hidden" name="shiptocontact" value="[% HTML.escape(shiptocontact) %]">
+ <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
<input type="hidden" name="shiptocountry" value="[% HTML.escape(shiptocountry) %]">
<input type="hidden" name="shiptodepartment_1" value="[% HTML.escape(shiptodepartment_1) %]">
<input type="hidden" name="shiptodepartment_2" value="[% HTML.escape(shiptodepartment_2) %]">