#
#######################################################################
+use SL::IC;
+
# any custom scripts for this one
if (-f "$form->{path}/custom_io.pl") {
eval { require "$form->{path}/custom_io.pl"; };
sub display_form {
$lxdebug->enter_sub();
+
+ relink_accounts();
+
$form->language_payment(\%myconfig);
# if we have a display_form
my @a = ();
my $count = 0;
my @flds = (
- qw(id partnumber description qty ship sellprice unit discount inventory_accno income_accno expense_accno listprice taxaccounts bin assembly weight projectnumber project_id oldprojectnumber runningnumber serialnumber partsgroup payment_id not_discountable shop ve gv buchungsgruppen_id language_values)
+ qw(id partnumber description qty ship sellprice unit discount inventory_accno income_accno expense_accno listprice taxaccounts bin assembly weight projectnumber project_id oldprojectnumber runningnumber serialnumber partsgroup payment_id not_discountable shop ve gv buchungsgruppen_id language_values sellprice_pg pricegroup_old price_old price_new unit_old ordnumber transdate longdescription basefactor)
);
$lxdebug->leave_sub();
}
+sub request_for_quotation {
+ quotation();
+}
+
sub e_mail {
$lxdebug->enter_sub();
if ($form->{second_run}) {
$format .= qq|</select>|;
if (scalar(keys (%{ $form->{languages} })) !=0) {
-
- $language_select = qq|<select name=language_id>|;
+ $language_select = qq|<select name=language_id>
+ <option value=""></option>}|;
foreach $item (@{ $form->{languages} }) {
if ($form->{language_id} eq $item->{id}) {
$language_select .= qq|<option value="$item->{id}" selected>$item->{description}</option>|;
($form->{"email"}, $form->{"cc"}, $form->{"bcc"});
$language_saved = $form->{language_id};
+ $payment_id_saved = $form->{payment_id};
+
&{"$form->{vc}_details"};
+
$form->{language_id} = $language_saved;
+ $form->{payment_id} = $payment_id_saved;
$form->{"email"} = $saved_email if ($saved_email);
$form->{"cc"} = $saved_cc if ($saved_cc);
<td>$form->{name}</td>
<td><input name=shiptoname size=35 value="$form->{shiptoname}"></td>
</tr>
+ <tr>
+ <th align=right nowrap>| . $locale->text('Department') . qq|</th>
+ <td>$form->{department_1}</td>
+ <td><input name=shiptodepartment_1 size=35 value="$form->{shiptodepartment_1}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap> </th>
+ <td>$form->{department_2}</td>
+ <td><input name=shiptodepartment_2 size=35 value="$form->{shiptodepartment_2}"></td>
+ </tr>
<tr>
<th align=right nowrap>| . $locale->text('Street') . qq|</th>
<td>$form->{street}</td>
# delete shipto
map { delete $form->{$_} }
- qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail header);
+ qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2 header);
$form->{title} = $title;
foreach $key (keys %$form) {
$lxdebug->leave_sub();
}
+sub relink_accounts {
+ $lxdebug->enter_sub();
+
+ $form->{"taxaccounts"} =~ s/\s*$//;
+ $form->{"taxaccounts"} =~ s/^\s*//;
+ foreach my $accno (split(/\s*/, $form->{"taxaccounts"})) {
+ map({ delete($form->{"${accno}_${_}"}); } qw(rate description taxnumber));
+ }
+ $form->{"taxaccounts"} = "";
+
+ for (my $i = 1; $i <= $form->{"rowcount"}; $i++) {
+ if ($form->{"id_$i"}) {
+ IC->retrieve_accounts(\%myconfig, $form, $form->{"id_$i"}, $i, 1);
+ }
+ }
+
+ $lxdebug->leave_sub();
+}