require "bin/mozilla/io.pl";
require "bin/mozilla/arap.pl";
-require "bin/mozilla/report_generator.pl";
+require "bin/mozilla/reportgenerator.pl";
1;
set_headings("edit");
# editing without stuff to edit? try adding it first
- if ($form->{rowcount}) {
+ if ($form->{rowcount} && !$form->{print_and_save}) {
map { $id++ if $form->{"multi_id_$_"} } (1 .. $form->{rowcount});
if (!$id) {
</tr>
</table>
</td>
- <td align=right width=100%>
+ <td>
+ <table>
+|;
+
+ if ($form->{type} =~ /^sales_/) {
+ print qq|
+ <tr>
+ <th align=left>| . $locale->text('Ertrag') . qq|</th>
+ <td>| . $form->format_amount(\%myconfig, $form->{marge_total}, 2, 0) . qq|</td>
+ </tr>
+ <tr>
+ <th align=left>| . $locale->text('Ertrag prozentual') . qq|</th>
+ <td>| . $form->format_amount(\%myconfig, $form->{marge_percent}, 2, 0) . qq| %</td>
+ </tr>
+|;
+ }
+
+ print qq|
+ <input type=hidden name="marge_total" value="$form->{"marge_total"}">
+ <input type=hidden name="marge_percent" value="$form->{"marge_percent"}">
+ </table>
+ </td>
+ <td align=right>
$taxincluded
- <table width=100%>
+ <table>
$subtotal
$tax
<tr>
<td align=left width=30%><b>Dateiname</b></td>
<td align=left width=70%><b>Webdavlink</b></td>
|;
- foreach $file (keys %{ $form->{WEBDAV} }) {
+ foreach $file (@{ $form->{WEBDAV} }) {
$webdav_list .= qq|
<tr>
- <td align=left>$file</td>
- <td align=left><a href="$form->{WEBDAV}{$file}">$form->{WEBDAV}{$file}</a></td>
+ <td align="left">$file->{name}</td>
+ <td align="left"><a href="$file->{link}">$file->{type}</a></td>
</tr>
|;
}
<input class=submit type=submit name=action value="|
. $locale->text('Purchase Order') . qq|">|;
}
- if (1) {
print qq|
<input class=submit type=submit name=action value="|
. $locale->text('Invoice') . qq|">
|;
-}
if ($form->{type} =~ /sales_order$/) {
print qq|
. $locale->text('Order') . qq|">
|;
}
- } elsif ($form->{type} =~ /sales_order$/ && $form->{rowcount} && !$form->{proforma}) {
- print qq|
-<br>Workflow $form->{heading}<br>
-<input class=submit type=submit name=action value="|
- . $locale->text('Save as new') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Invoice') . qq|">
-|;
}
$form->hide_form("saved_xyznumber");
<td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
<td><input name="l_shipvia" class=checkbox type=checkbox value=Y> |
. $locale->text('Ship via') . qq|</td>
- <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
</tr>
<tr>
<td><input name="l_netamount" class=checkbox type=checkbox value=Y> |
. $locale->text('Total') . qq|</td>
</tr>
<tr>
+ <td><input name="l_marge_total" class=checkbox type=checkbox value=Y> |
+ . $locale->text('Ertrag') . qq|</td>
+ <td><input name="l_marge_percent" class=checkbox type=checkbox value=Y> |
+ . $locale->text('Ertrag prozentual') . qq|</td>
+ </tr>
+ <tr>
<td><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y> |
. $locale->text('Project Number') . qq|</td>
<td><input name="l_transaction_description" class=checkbox type=checkbox value=Y> |
"curr", "employee",
"shipvia", "globalprojectnumber",
"transaction_description", "open",
- "delivered"
+ "delivered", "marge_total", "marge_percent"
);
# only show checkboxes if gotten here via sales_order form.
my @hidden_variables = map { "l_${_}" } @columns;
push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber
- transaction_description transdatefrom transdateto type vc);
+ transaction_description transdatefrom transdateto type vc employee_id);
my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables);
'transaction_description' => { 'text' => $locale->text('Transaction description'), },
'open' => { 'text' => $locale->text('Open'), },
'delivered' => { 'text' => $locale->text('Delivered'), },
+ 'marge_total' => { 'text' => $locale->text('Ertrag'), },
+ 'marge_percent' => { 'text' => $locale->text('Ertrag prozentual'), }
);
foreach my $name (qw(id transdate reqdate quonumber ordnumber name employee shipvia)) {
# escape callback for href
$callback = $form->escape($href);
- my @subtotal_columns = qw(netamount amount);
+ my @subtotal_columns = qw(netamount amount marge_total);
my %totals = map { $_ => 0 } @subtotal_columns;
my %subtotals = map { $_ => 0 } @subtotal_columns;
map { $subtotals{$_} += $oe->{$_};
$totals{$_} += $oe->{$_} } @subtotal_columns;
- map { $oe->{$_} = $form->format_amount(\%myconfig, $oe->{$_}, 2) } qw(netamount tax amount);
+ map { $oe->{$_} = $form->format_amount(\%myconfig, $oe->{$_}, 2) } qw(netamount tax amount marge_total marge_percent);
my $row = { };
<input type="hidden" name="yes_nextsub" value="delete_order_quotation">
<input name=action class=submit type=submit value="|
. $locale->text('Yes') . qq|">
-<input name=action class=submit type=submit onclick="history.back()" value="|
- . $locale->text('No') . qq|">
+<button class=submit type=button onclick="history.back()">|
+ . $locale->text('No') . qq|</button>
</form>
</body>
$exchangerate =
$form->check_exchangerate(\%myconfig, $form->{currency}, $orddate,
$buysell);
- print(STDERR "CURRENCY $form->{currency} DEFAULT: $form->{defaultcurrency} EXCHANGE $exchangerate\n");
if (!$exchangerate) {
&backorder_exchangerate($orddate, $buysell);
# if not it's most likely a collective order, which can't be saved back
# so they just have to be closed
if (($form->{ordnumber} ne '') || ($form->{quonumber} ne '')) {
- OE->close_order(\%myconfig, \%$form);
+ OE->close_order(\%myconfig, \%$form) if ($form->{id});
} else {
OE->close_orders(\%myconfig, \%$form);
}
$form->{print_and_save} = 1;
- if (!$form->{id}) {
- $print_post = 1;
+ $print_post = 1;
- my $saved_form = save_form();
+ my $saved_form = save_form();
- save();
+ save();
- my %saved_vars;
- map({ $saved_vars{$_} = $form->{$_}; } qw(id ordnumber quonumber));
- restore_form($saved_form);
- map({ $form->{$_} = $saved_vars{$_}; } qw(id ordnumber quonumber));
- }
+ my %saved_vars;
+ map({ $saved_vars{$_} = $form->{$_}; } qw(id ordnumber quonumber));
+ restore_form($saved_form);
+ map({ $form->{$_} = $saved_vars{$_}; } qw(id ordnumber quonumber));
edit_e_mail();