Revision 2d51ec2e
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
116 | 116 |
} |
117 | 117 |
} |
118 | 118 |
|
119 |
my ($phone_notes_columns, $phone_notes_join); |
|
120 |
$form->{phone_notes} = trim($form->{phone_notes}); |
|
121 |
if ($form->{phone_notes}) { |
|
122 |
$phone_notes_columns = qq| , phone_notes.subject AS phone_notes_subject, phone_notes.body AS phone_notes_body |; |
|
123 |
$phone_notes_join = qq| JOIN notes phone_notes ON (o.id = phone_notes.trans_id AND phone_notes.trans_module LIKE 'oe') |; |
|
124 |
} |
|
125 |
|
|
119 | 126 |
$query = |
120 | 127 |
qq|SELECT o.id, o.ordnumber, o.transdate, o.reqdate, | . |
121 | 128 |
qq| o.amount, ct.${vc}number, ct.name, o.netamount, o.${vc}_id, o.globalproject_id, | . |
... | ... | |
133 | 140 |
qq| ct.${vc}number AS vcnumber, ct.country, ct.ustid, ct.business_id, | . |
134 | 141 |
qq| tz.description AS taxzone | . |
135 | 142 |
$periodic_invoices_columns . |
143 |
$phone_notes_columns . |
|
136 | 144 |
qq| , o.order_probability, o.expected_billing_date, (o.netamount * o.order_probability / 100) AS expected_netamount | . |
137 | 145 |
qq|FROM oe o | . |
138 | 146 |
qq|JOIN $vc ct ON (o.${vc}_id = ct.id) | . |
... | ... | |
146 | 154 |
qq|LEFT JOIN tax_zones tz ON (o.taxzone_id = tz.id) | . |
147 | 155 |
qq|LEFT JOIN department ON (o.department_id = department.id) | . |
148 | 156 |
qq|$periodic_invoices_joins | . |
157 |
$phone_notes_join . |
|
149 | 158 |
qq|WHERE (o.quotation = ?) |; |
150 | 159 |
push(@values, $quotation); |
151 | 160 |
|
... | ... | |
304 | 313 |
push(@values, like($form->{intnotes})); |
305 | 314 |
} |
306 | 315 |
|
316 |
if ($form->{phone_notes}) { |
|
317 |
$query .= qq| AND (phone_notes.subject ILIKE ? OR phone_notes.body ILIKE ?)|; |
|
318 |
push(@values, like($form->{phone_notes}), like($form->{phone_notes})); |
|
319 |
} |
|
320 |
|
|
307 | 321 |
if ($form->{parts_partnumber}) { |
308 | 322 |
$query .= <<SQL; |
309 | 323 |
AND EXISTS ( |
Auch abrufbar als: Unified diff
Telefonnotizen: in Berichten Angebot/Auftrag filtern können.
Durchsucht werden Betreff und Text.