Revision 3da73190
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/DB/MetaSetup/Order.pm | ||
---|---|---|
21 | 21 |
delivery_vendor_id => { type => 'integer' }, |
22 | 22 |
department_id => { type => 'integer' }, |
23 | 23 |
employee_id => { type => 'integer' }, |
24 |
expected_billing_date => { type => 'date' }, |
|
24 | 25 |
globalproject_id => { type => 'integer' }, |
25 | 26 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
26 | 27 |
intnotes => { type => 'text' }, |
... | ... | |
31 | 32 |
mtime => { type => 'timestamp' }, |
32 | 33 |
netamount => { type => 'numeric', precision => 15, scale => 5 }, |
33 | 34 |
notes => { type => 'text' }, |
35 |
order_probability => { type => 'integer', default => '0', not_null => 1 }, |
|
34 | 36 |
ordnumber => { type => 'text', not_null => 1 }, |
35 | 37 |
payment_id => { type => 'integer' }, |
36 | 38 |
proforma => { type => 'boolean', default => 'false' }, |
SL/OE.pm | ||
---|---|---|
115 | 115 |
qq| ct.${vc}number AS vcnumber, ct.country, ct.ustid, ct.business_id, | . |
116 | 116 |
qq| tz.description AS taxzone | . |
117 | 117 |
$periodic_invoices_columns . |
118 |
qq| , o.order_probability, o.expected_billing_date, (o.netamount * o.order_probability / 100) AS expected_netamount | . |
|
118 | 119 |
qq|FROM oe o | . |
119 | 120 |
qq|JOIN $vc ct ON (o.${vc}_id = ct.id) | . |
120 | 121 |
qq|LEFT JOIN employee e ON (o.employee_id = e.id) | . |
... | ... | |
243 | 244 |
$query .= qq| AND ${not} COALESCE(pcfg.active, 'f')|; |
244 | 245 |
} |
245 | 246 |
|
247 |
if (($form->{order_probability_value} || '') ne '') { |
|
248 |
my $op = $form->{order_probability_value} eq 'le' ? '<=' : '>='; |
|
249 |
$query .= qq| AND (o.order_probability ${op} ?)|; |
|
250 |
push @values, $form->{order_probability_value}; |
|
251 |
} |
|
252 |
|
|
253 |
if ($form->{expected_billing_date_from}) { |
|
254 |
$query .= qq| AND (o.expected_billing_date >= ?)|; |
|
255 |
push @values, conv_date($form->{expected_billing_date_from}); |
|
256 |
} |
|
257 |
|
|
258 |
if ($form->{expected_billing_date_to}) { |
|
259 |
$query .= qq| AND (o.expected_billing_date <= ?)|; |
|
260 |
push @values, conv_date($form->{expected_billing_date_to}); |
|
261 |
} |
|
262 |
|
|
246 | 263 |
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; |
247 | 264 |
my $sortorder = join(', ', map { "${_} ${sortdir} " } ("o.id", $form->sort_columns("transdate", $ordnumber, "name"))); |
248 | 265 |
my %allowed_sort_columns = ( |
... | ... | |
561 | 578 |
delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?, |
562 | 579 |
taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?,delivery_term_id = ?, |
563 | 580 |
globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?, marge_total = ?, marge_percent = ? |
581 |
, order_probability = ?, expected_billing_date = ? |
|
564 | 582 |
WHERE id = ?|; |
565 | 583 |
|
566 | 584 |
@values = ($form->{ordnumber} || '', $form->{quonumber}, |
... | ... | |
581 | 599 |
conv_i($form->{salesman_id}), conv_i($form->{cp_id}), |
582 | 600 |
$form->{transaction_description}, |
583 | 601 |
$form->{marge_total} * 1, $form->{marge_percent} * 1, |
602 |
$form->{order_probability} * 1, conv_date($form->{expected_billing_date}), |
|
584 | 603 |
conv_i($form->{id})); |
585 | 604 |
do_query($form, $dbh, $query, @values); |
586 | 605 |
|
... | ... | |
811 | 830 |
d.description AS department, o.payment_id, o.language_id, o.taxzone_id, |
812 | 831 |
o.delivery_customer_id, o.delivery_vendor_id, o.proforma, o.shipto_id, |
813 | 832 |
o.globalproject_id, o.delivered, o.transaction_description, o.delivery_term_id |
833 |
, o.order_probability, o.expected_billing_date |
|
814 | 834 |
FROM oe o |
815 | 835 |
JOIN ${vc} cv ON (o.${vc}_id = cv.id) |
816 | 836 |
LEFT JOIN employee e ON (o.employee_id = e.id) |
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 |
|
locale/de/all | ||
---|---|---|
1047 | 1047 |
'Existing file on server' => 'Auf dem Server existierende Datei', |
1048 | 1048 |
'Existing pending follow-ups for this item' => 'Noch nicht erledigte Wiedervorlagen für dieses Dokument', |
1049 | 1049 |
'Existing profiles' => 'Existierende Profile', |
1050 |
'Exp. bill. date' => 'Vorauss. Abr.datum', |
|
1051 |
'Exp. netamount' => 'Vorauss. Summe', |
|
1050 | 1052 |
'Expected Tax' => 'Erwartete Steuern', |
1053 |
'Expected billing date' => 'Voraussichtliches Abrechnungsdatum', |
|
1051 | 1054 |
'Expense' => 'Aufwandskonto', |
1052 | 1055 |
'Expense Account' => 'Aufwandskonto', |
1053 | 1056 |
'Expense/Asset' => 'Aufwand/Anlagen', |
... | ... | |
1624 | 1627 |
'Options' => 'Optionen', |
1625 | 1628 |
'Or download the whole Installation Documentation as PDF (350kB) for off-line study (currently in German Language): ' => 'Oder laden Sie die komplette Installationsbeschreibung als PDF (350kB) herunter: ', |
1626 | 1629 |
'Order' => 'Auftrag', |
1627 |
'Order Date' => 'Auftragsdatum', |
|
1628 | 1630 |
'Order Date missing!' => 'Auftragsdatum fehlt!', |
1629 |
'Order Number' => 'Auftragsnummer',
|
|
1631 |
'Order Date' => 'Auftragsdatum',
|
|
1630 | 1632 |
'Order Number missing!' => 'Auftragsnummer fehlt!', |
1633 |
'Order Number' => 'Auftragsnummer', |
|
1631 | 1634 |
'Order amount' => 'Auftragswert', |
1632 | 1635 |
'Order deleted!' => 'Auftrag gelöscht!', |
1636 |
'Order probability & expected billing date' => 'Auftragswahrscheinlichkeit & vorrauss. Abrechnungsdatum', |
|
1637 |
'Order probability' => 'Auftragswahrscheinlichkeit', |
|
1633 | 1638 |
'Order/Item row name' => 'Name der Auftrag-/Positions-Zeilen', |
1634 | 1639 |
'OrderItem' => 'Position', |
1640 |
'Ordered' => 'Vom Kunde bestellt', |
|
1635 | 1641 |
'Ordered' => 'Von Kunden bestellt', |
1636 | 1642 |
'Orders' => 'Aufträge', |
1637 | 1643 |
'Orders / Delivery Orders deleteable' => 'Aufträge / Lieferscheine löschbar', |
sql/Pg-upgrade2/sales_quotation_order_probability_expected_billing_date.sql | ||
---|---|---|
1 |
-- @tag: sales_quotation_order_probability_expected_billing_date |
|
2 |
-- @charset: utf-8 |
|
3 |
-- @description: Weitere Felder im Angebot: Angebotswahrscheinlichkeit, voraussichtliches Abrechnungsdatum |
|
4 |
ALTER TABLE oe |
|
5 |
ADD COLUMN order_probability INTEGER, |
|
6 |
ADD COLUMN expected_billing_date DATE; |
|
7 |
|
|
8 |
UPDATE oe SET order_probability = 0; |
|
9 |
|
|
10 |
ALTER TABLE oe |
|
11 |
ALTER COLUMN order_probability SET DEFAULT 0, |
|
12 |
ALTER COLUMN order_probability SET NOT NULL; |
templates/webpages/oe/form_header.html | ||
---|---|---|
237 | 237 |
[%- L.select_tag('globalproject_id', ALL_PROJECTS, title_key='projectnumber', default=globalproject_id, with_empty='1', onChange="document.getElementById('update_button').click();") %] |
238 | 238 |
</td> |
239 | 239 |
</tr> |
240 |
[%- IF type == 'sales_quotation' %] |
|
241 |
<tr> |
|
242 |
<th width="70%" align="right" nowrap>[% 'Order probability' | $T8 %]</th> |
|
243 |
<td nowrap> |
|
244 |
[%- L.select_tag('order_probability', ORDER_PROBABILITIES, title='title', default=order_probability) %]% |
|
245 |
</td> |
|
246 |
</tr> |
|
247 |
<tr> |
|
248 |
<th width="70%" align="right" nowrap>[% 'Expected billing date' | $T8 %]</th> |
|
249 |
<td nowrap> |
|
250 |
[%- L.date_tag('expected_billing_date', expected_billing_date 'BL') %] |
|
251 |
</td> |
|
252 |
</tr> |
|
253 |
[%- END %] |
|
240 | 254 |
</table> |
241 | 255 |
</td> |
242 | 256 |
</tr> |
templates/webpages/oe/search.html | ||
---|---|---|
122 | 122 |
[% L.date_tag('reqdateto') %] |
123 | 123 |
</td> |
124 | 124 |
</tr> |
125 |
[%- IF type == 'sales_quotation' %] |
|
126 |
<tr> |
|
127 |
<th align="right">[% 'Expected billing date' | $T8 %] [% 'From' | $T8 %]</th> |
|
128 |
<td> |
|
129 |
[% L.date_tag('expected_billing_date_from', '' 'BL') %] |
|
130 |
</td> |
|
131 |
<th align="right">[% 'Expected billing date' | $T8 %] [% 'Bis' | $T8 %]</th> |
|
132 |
<td> |
|
133 |
[% L.date_tag('expected_billing_date_to', '' 'BL') %] |
|
134 |
</td> |
|
135 |
</tr> |
|
136 |
<tr> |
|
137 |
<th align="right">[% 'Order probability' | $T8 %]</th> |
|
138 |
<td colspan="3"> |
|
139 |
[% L.select_tag('order_probability_op', [[ 'ge', '>=' ], [ 'le', '<=' ]]) %] |
|
140 |
[% L.select_tag('order_probability_value', ORDER_PROBABILITIES, title='title', with_empty=1) %] |
|
141 |
</td> |
|
142 |
</tr> |
|
143 |
[%- END %] |
|
125 | 144 |
<tr> |
126 | 145 |
<th align="right">[% 'Include in Report' | $T8 %]</th> |
127 | 146 |
<td colspan="5"> |
... | ... | |
250 | 269 |
<label for="l_salesman">[% 'Salesman' | $T8 %]</label> |
251 | 270 |
</td> |
252 | 271 |
</tr> |
272 |
[% IF type == 'sales_quotation' %] |
|
273 |
<tr> |
|
274 |
<td colspan="2"> |
|
275 |
<input name="l_order_probability_expected_billing_date" id="l_order_probability_expected_billing_date" class="checkbox" type="checkbox" value="Y"> |
|
276 |
<label for="l_order_probability_expected_billing_date">[% 'Order probability & expected billing date' | $T8 %]</label> |
|
277 |
</td> |
|
278 |
</tr> |
|
279 |
[%- END %] |
|
253 | 280 |
<tr> |
254 | 281 |
<td> |
255 | 282 |
<input name="l_remaining_amount" id="l_remaining_amount" class="checkbox" type="checkbox" value="Y"> |
Auch abrufbar als: Unified diff
Angebote: neue Felder Auftragswahrscheinlichkeit, Voraus. Abrechnungsdatum