Revision 4800abb9
Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt
SL/AR.pm | ||
---|---|---|
$where .= " AND NOT invoice = 'f' "; # remove ar transactions from Sales -> Reports -> Invoices
|
||
};
|
||
|
||
if ($form->{customernumber}) {
|
||
$where .= " AND c.customernumber = ?";
|
||
push(@values, trim($form->{customernumber}));
|
||
}
|
||
if ($form->{customer_id}) {
|
||
$where .= " AND a.customer_id = ?";
|
||
push(@values, $form->{customer_id});
|
||
} elsif ($form->{customer}) {
|
||
if ($form->{customer}) {
|
||
$where .= " AND c.name ILIKE ?";
|
||
push(@values, like($form->{customer}));
|
||
}
|
bin/mozilla/ar.pl | ||
---|---|---|
use SL::FU;
|
||
use SL::GL;
|
||
use SL::IS;
|
||
use SL::DB::Business;
|
||
use SL::DB::Currency;
|
||
use SL::DB::Default;
|
||
use SL::DB::Employee;
|
||
... | ... | |
my $locale = $main::locale;
|
||
my $cgi = $::request->{cgi};
|
||
|
||
# setup customer selection
|
||
$form->all_vc(\%myconfig, "customer", "AR");
|
||
|
||
$form->{title} = $locale->text('AR Transactions');
|
||
|
||
# Auch in Rechnungsübersicht nach Kundentyp filtern - jan
|
||
$form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 },
|
||
"customers" => "ALL_VC",
|
||
"business_types" => "ALL_BUSINESS_TYPES");
|
||
$form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
|
||
$form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
|
||
$form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0;
|
||
$form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted;
|
||
$form->{ALL_BUSINESS_TYPES} = SL::DB::Manager::Business->get_all_sorted;
|
||
|
||
$form->{CT_CUSTOM_VARIABLES} = CVar->get_configs('module' => 'CT');
|
||
($form->{CT_CUSTOM_VARIABLES_FILTER_CODE},
|
||
... | ... | |
# constants and subs for template
|
||
$form->{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" };
|
||
|
||
$::request->layout->add_javascripts("autocomplete_project.js");
|
||
|
||
$form->header;
|
||
print $form->parse_html_template('ar/search', { %myconfig });
|
||
|
||
... | ... | |
|
||
my ($callback, $href, @columns);
|
||
|
||
($form->{customer}, $form->{customer_id}) = split(/--/, $form->{customer});
|
||
|
||
report_generator_set_default_sort('transdate', 1);
|
||
|
||
AR->ar_transactions(\%myconfig, \%$form);
|
templates/webpages/ar/search.html | ||
---|---|---|
[%- USE T8 %]
|
||
[%- USE L %]
|
||
[%- USE L %][%- USE P -%]
|
||
<h1>[% title %]</h1>
|
||
|
||
<form method=post name="search" action=[% script %]>
|
||
... | ... | |
<table>
|
||
<tr>
|
||
<th align=right>[% 'Customer' | $T8 %]</th>
|
||
<td colspan=3>
|
||
[%- INCLUDE 'generic/multibox.html'
|
||
name = 'customer',
|
||
default = oldcustomer,
|
||
style = 'width: 250px',
|
||
DATA = ALL_VC,
|
||
id_sub = 'vc_keys',
|
||
label_key = 'name',
|
||
select = vc_select,
|
||
limit = vclimit,
|
||
show_empty = 1,
|
||
allow_textbox = 1,
|
||
class = 'initial_focus',
|
||
-%]
|
||
</td>
|
||
<td colspan=3>[% L.input_tag("customer", customer, style="width: 250px", class="initial_focus") %]</td>
|
||
</tr>
|
||
<tr>
|
||
<th align="right" nowrap>[% 'Contact Person' | $T8 %]</th>
|
||
... | ... | |
</tr>
|
||
<tr>
|
||
<th align="right">[% 'Project Number' | $T8 %]</th>
|
||
<td colspan="3">
|
||
[%- INCLUDE 'generic/multibox.html'
|
||
name = 'project_id',
|
||
style = "width: 250px",
|
||
DATA = ALL_PROJECTS,
|
||
id_key = 'id',
|
||
label_key = 'projectnumber',
|
||
limit = vclimit,
|
||
show_empty = 1,
|
||
allow_textbox = 0,
|
||
-%]
|
||
</td>
|
||
<td colspan="3">[% P.project_picker("project_id", project_id, style="width: 250px") %]</td>
|
||
</tr>
|
||
[% IF SHOW_BUSINESS_TYPES %]
|
||
[% IF ALL_BUSINESS_TYPES.as_list.size > 0 %]
|
||
<tr>
|
||
<th align="right" nowrap>[% 'Customer type' | $T8 %]</th>
|
||
<td colspan="3">
|
||
[%- INCLUDE 'generic/multibox.html'
|
||
name = 'business_id',
|
||
style = "width: 250px",
|
||
DATA = ALL_BUSINESS_TYPES,
|
||
id_key = 'id',
|
||
label_key = 'description',
|
||
limit = vclimit,
|
||
show_empty = 1,
|
||
allow_textbox = 0,
|
||
-%]
|
||
</td>
|
||
<td colspan="3">[% L.select_tag("business_id", ALL_BUSINESS_TYPES, with_empty=1, title_key="description", style="width: 250px") %]</td>
|
||
</tr>
|
||
[% END %]
|
||
<tr>
|
||
... | ... | |
<br>
|
||
<input class=submit type=submit name=action id="continue" value="[% 'Continue' | $T8 %]">
|
||
</form>
|
||
<script type="text/javascript">
|
||
<!--
|
||
$(document).ready(function(){
|
||
$('customer').focus();
|
||
})
|
||
//-->
|
||
</script>
|
Auch abrufbar als: Unified diff
Verkaufsrechnungssuche: keine Multibox mehr nutzen