Revision 2def6461
Von Kivitendo Admin vor mehr als 11 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
617 | 617 |
my %allowed_sort_columns = |
618 | 618 |
map { $_, 1 } qw( |
619 | 619 |
id customernumber vendornumber name contact phone fax email street |
620 |
taxnumber business invnumber ordnumber quonumber zipcode city |
|
620 |
taxnumber business invnumber ordnumber quonumber zipcode city country salesman
|
|
621 | 621 |
); |
622 | 622 |
my $sortorder = $form->{sort} && $allowed_sort_columns{$form->{sort}} ? $form->{sort} : "name"; |
623 | 623 |
$form->{sort} = $sortorder; |
... | ... | |
659 | 659 |
push @values, ('%' . $form->{addr_city} . '%') x 2; |
660 | 660 |
} |
661 | 661 |
|
662 |
if ($form->{addr_country}) { |
|
663 |
$where .= " AND ((lower(ct.country) LIKE lower(?)) |
|
664 |
OR |
|
665 |
(ct.id IN ( |
|
666 |
SELECT trans_id |
|
667 |
FROM shipto |
|
668 |
WHERE (module = 'CT') |
|
669 |
AND (lower(shiptocountry) LIKE lower(?)) |
|
670 |
)) |
|
671 |
)"; |
|
672 |
push @values, ('%' . $form->{addr_country} . '%') x 2; |
|
673 |
} |
|
674 |
|
|
662 | 675 |
if ( $form->{status} eq 'orphaned' ) { |
663 | 676 |
$where .= |
664 | 677 |
qq| AND ct.id NOT IN | . |
... | ... | |
676 | 689 |
qq| WHERE cv.id = a.vendor_id)|; |
677 | 690 |
} |
678 | 691 |
$form->{l_invnumber} = $form->{l_ordnumber} = $form->{l_quonumber} = ""; |
679 |
} |
|
692 |
};
|
|
680 | 693 |
|
681 | 694 |
if ($form->{obsolete} eq "Y") { |
682 | 695 |
$where .= qq| AND obsolete|; |
... | ... | |
716 | 729 |
} |
717 | 730 |
|
718 | 731 |
my $query = |
719 |
qq|SELECT ct.*, b.description AS business | . |
|
732 |
qq|SELECT ct.*, b.description AS business, e.name as salesman | .
|
|
720 | 733 |
(qq|, NULL AS invnumber, NULL AS ordnumber, NULL AS quonumber, NULL AS invid, NULL AS module, NULL AS formtype, NULL AS closed | x!! $join_records) . |
721 | 734 |
qq|FROM $cv ct | . |
722 | 735 |
qq|LEFT JOIN business b ON (ct.business_id = b.id) | . |
736 |
qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . |
|
723 | 737 |
qq|WHERE $where|; |
724 | 738 |
|
725 | 739 |
my @saved_values = @values; |
... | ... | |
733 | 747 |
push(@values, @saved_values); |
734 | 748 |
$query .= |
735 | 749 |
qq| UNION | . |
736 |
qq|SELECT ct.*, b.description AS business, | . |
|
750 |
qq|SELECT ct.*, b.description AS business, e.name as salesman, | .
|
|
737 | 751 |
qq| a.invnumber, a.ordnumber, a.quonumber, a.id AS invid, | . |
738 | 752 |
qq| '$module' AS module, 'invoice' AS formtype, | . |
739 | 753 |
qq| (a.amount = a.paid) AS closed | . |
740 | 754 |
qq|FROM $cv ct | . |
741 | 755 |
qq|JOIN $ar a ON (a.${cv}_id = ct.id) | . |
742 | 756 |
qq|LEFT JOIN business b ON (ct.business_id = b.id) | . |
757 |
qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . |
|
743 | 758 |
qq|WHERE $where AND (a.invoice = '1')|; |
744 | 759 |
} |
745 | 760 |
|
... | ... | |
747 | 762 |
push(@values, @saved_values); |
748 | 763 |
$query .= |
749 | 764 |
qq| UNION | . |
750 |
qq|SELECT ct.*, b.description AS business,| . |
|
765 |
qq|SELECT ct.*, b.description AS business, e.name as salesman, | .
|
|
751 | 766 |
qq| ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | . |
752 | 767 |
qq| 'oe' AS module, 'order' AS formtype, o.closed | . |
753 | 768 |
qq|FROM $cv ct | . |
754 | 769 |
qq|JOIN oe o ON (o.${cv}_id = ct.id) | . |
755 | 770 |
qq|LEFT JOIN business b ON (ct.business_id = b.id) | . |
771 |
qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . |
|
756 | 772 |
qq|WHERE $where AND (o.quotation = '0')|; |
757 | 773 |
} |
758 | 774 |
|
... | ... | |
760 | 776 |
push(@values, @saved_values); |
761 | 777 |
$query .= |
762 | 778 |
qq| UNION | . |
763 |
qq|SELECT ct.*, b.description AS business, | . |
|
779 |
qq|SELECT ct.*, b.description AS business, e.name as salesman, | .
|
|
764 | 780 |
qq| ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | . |
765 | 781 |
qq| 'oe' AS module, 'quotation' AS formtype, o.closed | . |
766 | 782 |
qq|FROM $cv ct | . |
767 | 783 |
qq|JOIN oe o ON (o.${cv}_id = ct.id) | . |
768 | 784 |
qq|LEFT JOIN business b ON (ct.business_id = b.id) | . |
785 |
qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | . |
|
769 | 786 |
qq|WHERE $where AND (o.quotation = '1')|; |
770 | 787 |
} |
771 | 788 |
} |
bin/mozilla/ct.pl | ||
---|---|---|
161 | 161 |
push @options, $locale->text('Billing/shipping address (city)') . " : $form->{addr_city}" if $form->{addr_city}; |
162 | 162 |
push @options, $locale->text('Billing/shipping address (zipcode)') . " : $form->{zipcode}" if $form->{addr_zipcode}; |
163 | 163 |
push @options, $locale->text('Billing/shipping address (street)') . " : $form->{street}" if $form->{addr_street}; |
164 |
push @options, $locale->text('Billing/shipping address (country)') . " : $form->{country}" if $form->{addr_country}; |
|
164 | 165 |
|
165 | 166 |
if ($form->{business_id}) { |
166 | 167 |
my $business = SL::DB::Manager::Business->find_by(id => $form->{business_id}); |
... | ... | |
171 | 172 |
} |
172 | 173 |
|
173 | 174 |
my @columns = ( |
174 |
'id', 'name', "$form->{db}number", 'contact', 'phone', |
|
175 |
'fax', 'email', 'taxnumber', 'street', 'zipcode' , 'city', |
|
176 |
'business', 'invnumber', 'ordnumber', 'quonumber' |
|
175 |
'id', 'name', "$form->{db}number", 'contact', 'phone',
|
|
176 |
'fax', 'email', 'taxnumber', 'street', 'zipcode' , 'city',
|
|
177 |
'business', 'invnumber', 'ordnumber', 'quonumber', 'salesman', 'country'
|
|
177 | 178 |
); |
178 | 179 |
|
179 | 180 |
my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs }; |
... | ... | |
199 | 200 |
'street' => { 'text' => $locale->text('Street'), }, |
200 | 201 |
'zipcode' => { 'text' => $locale->text('Zipcode'), }, |
201 | 202 |
'city' => { 'text' => $locale->text('City'), }, |
203 |
'country' => { 'text' => $locale->text('Country'), }, |
|
204 |
'salesman' => { 'text' => $locale->text('Salesman'), }, |
|
202 | 205 |
%column_defs_cvars, |
203 | 206 |
); |
204 | 207 |
|
locale/de/all | ||
---|---|---|
284 | 284 |
'Bilanz' => 'Bilanz', |
285 | 285 |
'Billing Address' => 'Rechnungsadresse', |
286 | 286 |
'Billing/shipping address (city)' => 'Rechnungsadresse (Stadt)', |
287 |
'Billing/shipping address (country)' => 'Rechnungsadresse (Land)', |
|
287 | 288 |
'Billing/shipping address (street)' => 'Rechnungsadresse (Straße)', |
288 | 289 |
'Billing/shipping address (zipcode)' => 'Rechnungsadresse (PLZ)', |
289 | 290 |
'Bin' => 'Lagerplatz', |
templates/webpages/ct/search.html | ||
---|---|---|
43 | 43 |
<th align="right" nowrap>[% 'Billing/shipping address (city)' | $T8 %]</th> |
44 | 44 |
<td><input name="addr_city" size="35"></td> |
45 | 45 |
</tr> |
46 |
<tr> |
|
47 |
<th align="right" nowrap>[% 'Billing/shipping address (country)' | $T8 %]</th> |
|
48 |
<td><input name="addr_country" size="35"></td> |
|
49 |
</tr> |
|
50 |
|
|
46 | 51 |
[% IF SHOW_BUSINESS_TYPES %] |
47 | 52 |
<tr> |
48 | 53 |
<th align="right" nowrap>[% IF IS_CUSTOMER %][% 'Customer type' | $T8 %][% ELSE %][% 'Vendor type' | $T8 %][% END %]</th> |
... | ... | |
128 | 133 |
<td> |
129 | 134 |
<input name="l_city" id="l_city" type="checkbox" class="checkbox" value="Y" checked> |
130 | 135 |
<label for="l_city">[% 'City' | $T8 %]</label> |
131 |
</td> |
|
136 |
</td>
|
|
132 | 137 |
</tr> |
133 | 138 |
|
134 | 139 |
<tr> |
... | ... | |
145 | 150 |
<label for="l_quonumber">[% IF IS_CUSTOMER %][% 'Quotations' | $T8 %][% ELSE %][% 'RFQs' | $T8 %][% END %]</label> |
146 | 151 |
</td> |
147 | 152 |
<td> |
153 |
<input name="l_country" id="l_country" type="checkbox" class="checkbox" value="Y" checked> |
|
154 |
<label for="l_country">[% 'Country' | $T8 %]</label> |
|
155 |
</td> |
|
156 |
</tr> |
|
157 |
<tr> |
|
158 |
<td> |
|
159 |
<input name="l_salesman" id="l_salesman" type="checkbox" class="checkbox" value="Y"> |
|
160 |
<label for="l_salesman">[% IF IS_CUSTOMER %][% 'Salesman' | $T8 %][% END %]</label> |
|
148 | 161 |
</td> |
149 | 162 |
</tr> |
150 | 163 |
|
Auch abrufbar als: Unified diff
Verkauf -> Berichte -> Kunden - Land und Verkäufer
neue Häkchen bei "In Bericht aufnehmen"