use SL::IS;
use SL::PE;
-require "$form->{path}/io.pl";
-require "$form->{path}/arap.pl";
+require "bin/mozilla/io.pl";
+require "bin/mozilla/arap.pl";
1;
set_headings("add");
$form->{callback} =
- "$form->{script}?action=add&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&path=$form->{path}&password=$form->{password}"
+ "$form->{script}?action=add&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
&order_links;
# with JavaScript Calendar
$button1 = qq|
- <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate}></td>
+ <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate} onBlur=\"check_right_date_format(this)\"></td>
<td><input type=button name=transdate id="trigger1" value=|
. $locale->text('button') . qq|></td>
|;
$button2 = qq|
- <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate}></td>
+ <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate} onBlur=\"check_right_date_format(this)\"></td>
<td width="4"><input type=button name=reqdate name=reqdate id="trigger2" value=|
. $locale->text('button') . qq|></td>
|;
# without JavaScript Calendar
$button1 = qq|
- <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate}></td>|;
+ <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate} onBlur=\"check_right_date_format(this)\"></td>|;
$button2 = qq|
- <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate}></td>|;
+ <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate} onBlur=\"check_right_date_format(this)\"></td>|;
}
- if ($form->{id}) {
- $openclosed = qq|
- <tr>
- <td colspan=2 align=center>
- <input name="closed" id="closed" type="checkbox" class="checkbox" value="1" $checkedclosed>
- <label for="closed">| . $locale->text('Closed') . qq|</label>
-|;
+ my @tmp;
- if (($form->{"type"} eq "sales_order") ||
- ($form->{"type"} eq "purchase_order")) {
- $openclosed .= qq|
+ if (($form->{"type"} eq "sales_order") ||
+ ($form->{"type"} eq "purchase_order")) {
+ push(@tmp, qq|
<input name="delivered" id="delivered" type="checkbox" class="checkbox" value="1" $checkeddelivered>
- <label for="delivered">| . $locale->text('Delivered') . qq|</label>
-|;
- }
+ <label for="delivered">| . $locale->text('Delivered') . qq|</label>|);
+ }
+
+ if ($form->{id}) {
+ push(@tmp, qq|
+ <input name="closed" id="closed" type="checkbox" class="checkbox" value="1" $checkedclosed>
+ <label for="closed">| . $locale->text('Closed') . qq|</label>|);
+ }
+ if (@tmp) {
$openclosed .= qq|
+ <tr>
+ <td colspan=| . (2 * scalar(@tmp)) . qq| align=center>| . join("\n", @tmp) . qq|
</td>
</tr>
|;
"projects" => { "key" => "ALL_PROJECTS",
"all" => 0,
"old_id" => \@old_project_ids },
- "employees" => "ALL_SALESMEN");
+ "employees" => "ALL_SALESMEN",
+ "taxzones" => "ALL_TAXZONES");
my %labels;
my @values = (undef);
</tr>|;
}
+
+ %labels = ();
+ @values = ();
+ foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"description"};
+ }
+
+ $taxzone = qq|
+ <tr>
+ <th align="right">| . $locale->text('Steuersatz') . qq|</th>
+ <td>| .
+ NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ </td>
+ </tr>|;
+
$form->{exchangerate} =
$form->format_amount(\%myconfig, $form->{exchangerate});
|;
}
- if (@{ $form->{TAXZONE} }) {
- $form->{selecttaxzone} = "";
- foreach $item (@{ $form->{TAXZONE} }) {
- if ($item->{id} == $form->{taxzone_id}) {
- $form->{selecttaxzone} .=
- "<option value=$item->{id} selected>" . H($item->{description}) .
- "</option>";
- } else {
- $form->{selecttaxzone} .=
- "<option value=$item->{id}>" . H($item->{description}) . "</option>";
- }
-
- }
- } else {
- $form->{selecttaxzone} =~ s/ selected//g;
- if ($form->{taxzone_id} ne "") {
- $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}>/value=$form->{taxzone_id} selected>/;
- }
- }
-
- $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>|;
-
-
if ($form->{type} !~ /_quotation$/) {
$ordnumber = qq|
<tr>
} elsif ($form->{resubmit}) {
$onload = qq|document.oe.submit()|;
} else {
- $onload = "fokus()";
+ $onload = "focus()";
}
$credittext = $locale->text('Credit Limit exceeded!!!');
if ($creditwarning) {
$onload = qq|alert('$credittext')|;
}
-
+
+ $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
+ $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
+
$form->{"javascript"} .= qq|<script type="text/javascript" src="js/show_form_details.js"></script>|;
# show history button js
$form->{javascript} .= qq|<script type="text/javascript" src="js/show_history.js"></script>|;
<tr>
<td>
|;
- &print_options;
+ print_options();
print qq|
</td>
<input name=callback type=hidden value="$form->{callback}">
-<input type=hidden name=path value=$form->{path}>
<input type=hidden name=login value=$form->{login}>
<input type=hidden name=password value=$form->{password}>
# with JavaScript Calendar
$button1 = qq|
- <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}">
+ <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
<input type=button name=transdatefrom id="trigger3" value=|
. $locale->text('button') . qq|></td>
|;
$button2 = qq|
- <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}">
+ <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
<input type=button name=transdateto name=transdateto id="trigger4" value=|
. $locale->text('button') . qq|></td>
|;
# without JavaScript Calendar
$button1 = qq|
- <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>|;
+ <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
$button2 = qq|
- <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>|;
+ <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\></td>|;
}
$form->get_lists("projects" => { "key" => "ALL_PROJECTS",
<br>
<input type=hidden name=nextsub value=orders>
-<input type=hidden name=path value=$form->{path}>
<input type=hidden name=login value=$form->{login}>
<input type=hidden name=password value=$form->{password}>
<input type=hidden name=vc value=$form->{vc}>
# construct href
$href =
- "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department";
+ "$form->{script}?action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department";
# construct callback
$number = $form->escape($form->{$ordnumber}, 1);
$department = $form->escape($form->{department}, 1);
$callback =
- "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department";
+ "$form->{script}?action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department";
@columns =
$form->sort_columns("transdate", "reqdate", "id", "$ordnumber",
$column_data{reqdate} = "<td>$oe->{reqdate} </td>";
$column_data{$ordnumber} =
- "<td><a href=oe.pl?path=$form->{path}&action=$action&type=$form->{type}&id=$oe->{id}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&callback=$callback_escaped>$oe->{$ordnumber}</a></td>";
+ "<td><a href=oe.pl?action=$action&type=$form->{type}&id=$oe->{id}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&callback=$callback_escaped>$oe->{$ordnumber}</a></td>";
$column_data{name} = "<td>$oe->{name}</td>";
$column_data{employee} = "<td>$oe->{employee} </td>";
if ($form->{type} =~ /sales_order/) {
print qq|
- <input type="hidden" name="path" value="$form->{path}">
<input class"submit" type="submit" name="action" value="|
. $locale->text('Continue') . qq|">
<input type="hidden" name="nextsub" value="edit">
<input type=hidden name=type value=$form->{type}>
<input type=hidden name=vc value=$form->{vc}>
-<input type=hidden name=path value=$form->{path}>
<input type=hidden name=login value=$form->{login}>
<input type=hidden name=password value=$form->{password}>
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
$form->redirect($msg);
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
# locale messages
$locale = new Locale "$myconfig{countrycode}", "$script";
- require "$form->{path}/$form->{script}";
+ require "bin/mozilla/$form->{script}";
map { $form->{"select$_"} = "" } ($form->{vc}, currency);
print qq|
-<input type=hidden name=path value=$form->{path}>
<input type=hidden name=login value=$form->{login}>
<input type=hidden name=password value=$form->{password}>
OE->close_order(\%myconfig, \%$form);
}
+ if ($form->{type} =~ /^sales_/) {
+ delete($form->{ordnumber});
+ }
+
$form->{cp_id} *= 1;
$form->{title} = $locale->text('Add Purchase Order');
OE->close_order(\%myconfig, $form);
}
+ if ($form->{type} eq "purchase_order") {
+ delete($form->{ordnumber});
+ }
+
$form->{cp_id} *= 1;
$form->{title} = $locale->text('Add Sales Order');