Revision 3da73190
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
479 | 479 |
is_pur_ord => scalar ($form->{type} =~ /purchase_order$/), |
480 | 480 |
); |
481 | 481 |
|
482 |
$TMPL_VAR{ORDER_PROBABILITIES} = [ map { { title => ($_ * 10) . '%', id => $_ * 10 } } (0..10) ]; |
|
483 |
|
|
482 | 484 |
print $form->parse_html_template("oe/form_header", { %TMPL_VAR }); |
483 | 485 |
|
484 | 486 |
$main::lxdebug->leave_sub(); |
... | ... | |
756 | 758 |
# constants and subs for template |
757 | 759 |
$form->{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" }; |
758 | 760 |
|
761 |
$form->{ORDER_PROBABILITIES} = [ map { { title => ($_ * 10) . '%', id => $_ * 10 } } (0..10) ]; |
|
762 |
|
|
759 | 763 |
$form->header(); |
760 | 764 |
|
761 | 765 |
print $form->parse_html_template('oe/search', { |
... | ... | |
823 | 827 |
"vcnumber", "ustid", |
824 | 828 |
"country", "shippingpoint", |
825 | 829 |
"taxzone", |
830 |
"order_probability", "expected_billing_date", "expected_netamount", |
|
826 | 831 |
); |
827 | 832 |
|
828 | 833 |
# only show checkboxes if gotten here via sales_order form. |
... | ... | |
835 | 840 |
$form->{l_delivered} = "Y" if ($form->{delivered} && $form->{notdelivered}); |
836 | 841 |
$form->{l_periodic_invoices} = "Y" if ($form->{periodic_invoices_active} && $form->{periodic_invoices_inactive}); |
837 | 842 |
|
843 |
map { $form->{"l_${_}"} = 'Y' } qw(order_probability expected_billing_date expected_netamount) if $form->{l_order_probability_expected_billing_date}; |
|
844 |
|
|
838 | 845 |
my $attachment_basename; |
839 | 846 |
if ($form->{vc} eq 'vendor') { |
840 | 847 |
if ($form->{type} eq 'purchase_order') { |
... | ... | |
861 | 868 |
push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber cusordnumber |
862 | 869 |
transaction_description transdatefrom transdateto type vc employee_id salesman_id |
863 | 870 |
reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive |
864 |
business_id shippingpoint taxzone_id); |
|
871 |
business_id shippingpoint taxzone_id |
|
872 |
order_probability_op order_probability_value expected_billing_date_from expected_billing_date_to); |
|
865 | 873 |
|
866 | 874 |
my @keys_for_url = grep { $form->{$_} } @hidden_variables; |
867 | 875 |
push @keys_for_url, 'taxzone_id' if $form->{taxzone_id} ne ''; # taxzone_id could be 0 |
... | ... | |
899 | 907 |
'periodic_invoices' => { 'text' => $locale->text('Per. Inv.'), }, |
900 | 908 |
'shippingpoint' => { 'text' => $locale->text('Shipping Point'), }, |
901 | 909 |
'taxzone' => { 'text' => $locale->text('Steuersatz'), }, |
910 |
'order_probability' => { 'text' => $locale->text('Order probability'), }, |
|
911 |
'expected_billing_date' => { 'text' => $locale->text('Exp. bill. date'), }, |
|
912 |
'expected_netamount' => { 'text' => $locale->text('Exp. netamount'), }, |
|
902 | 913 |
); |
903 | 914 |
|
904 | 915 |
foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone)) { |
... | ... | |
906 | 917 |
$column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir"; |
907 | 918 |
} |
908 | 919 |
|
909 |
my %column_alignment = map { $_ => 'right' } qw(netamount tax amount curr remaining_amount remaining_netamount); |
|
920 |
my %column_alignment = map { $_ => 'right' } qw(netamount tax amount curr remaining_amount remaining_netamount order_probability expected_billing_date expected_netamount);
|
|
910 | 921 |
|
911 | 922 |
$form->{"l_type"} = "Y"; |
912 | 923 |
map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns; |
... | ... | |
952 | 963 |
push @options, $locale->text('Steuersatz') . " : " . SL::DB::TaxZone->new(id => $form->{taxzone_id})->load->description; |
953 | 964 |
} |
954 | 965 |
|
966 |
if (($form->{order_probability_value} || '') ne '') { |
|
967 |
push @options, $::locale->text('Order probability') . ' ' . ($form->{order_probability_op} eq 'le' ? '<=' : '>=') . ' ' . $form->{order_probability_value} . '%'; |
|
968 |
} |
|
969 |
|
|
970 |
if ($form->{expected_billing_date_from} or $form->{expected_billing_date_to}) { |
|
971 |
push @options, $locale->text('Expected billing date'); |
|
972 |
push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{expected_billing_date_from}, 1) if $form->{expected_billing_date_from}; |
|
973 |
push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{expected_billing_date_to}, 1) if $form->{expected_billing_date_to}; |
|
974 |
} |
|
975 |
|
|
955 | 976 |
$report->set_options('top_info_text' => join("\n", @options), |
956 | 977 |
'raw_top_info_text' => $form->parse_html_template('oe/orders_top'), |
957 | 978 |
'raw_bottom_info_text' => $form->parse_html_template('oe/orders_bottom', { 'SHOW_CONTINUE_BUTTON' => $allow_multiple_orders }), |
... | ... | |
969 | 990 |
my $callback = $form->escape($href); |
970 | 991 |
|
971 | 992 |
my @subtotal_columns = qw(netamount amount marge_total marge_percent remaining_amount remaining_netamount); |
993 |
push @subtotal_columns, 'expected_netamount' if $form->{l_order_probability_expected_billing_date}; |
|
972 | 994 |
|
973 | 995 |
my %totals = map { $_ => 0 } @subtotal_columns; |
974 | 996 |
my %subtotals = map { $_ => 0 } @subtotal_columns; |
... | ... | |
991 | 1013 |
$subtotals{marge_percent} = $subtotals{netamount} ? ($subtotals{marge_total} * 100 / $subtotals{netamount}) : 0; |
992 | 1014 |
$totals{marge_percent} = $totals{netamount} ? ($totals{marge_total} * 100 / $totals{netamount} ) : 0; |
993 | 1015 |
|
994 |
map { $oe->{$_} = $form->format_amount(\%myconfig, $oe->{$_}, 2) } qw(netamount tax amount marge_total marge_percent remaining_amount remaining_netamount); |
|
1016 |
map { $oe->{$_} = $form->format_amount(\%myconfig, $oe->{$_}, 2) } qw(netamount tax amount marge_total marge_percent remaining_amount remaining_netamount expected_netamount); |
|
1017 |
|
|
1018 |
$oe->{order_probability} = ($oe->{order_probability} || 0) . '%'; |
|
995 | 1019 |
|
996 | 1020 |
my $row = { }; |
997 | 1021 |
|
Auch abrufbar als: Unified diff
Angebote: neue Felder Auftragswahrscheinlichkeit, Voraus. Abrechnungsdatum