Revision b008860a
Von Bernd Bleßmann vor fast 3 Jahren hinzugefügt
SL/AP.pm | ||
---|---|---|
|
||
$form->{AP} = [ @result ];
|
||
|
||
if ($form->{l_items} && scalar @{ $form->{AP} }) {
|
||
my ($items_query, $items_sth);
|
||
if ($form->{l_items}) {
|
||
$items_query =
|
||
qq|SELECT id
|
||
FROM invoice
|
||
WHERE trans_id = ?
|
||
ORDER BY position|;
|
||
|
||
$items_sth = prepare_query($form, $dbh, $items_query);
|
||
}
|
||
|
||
foreach my $ap (@{ $form->{AP} }) {
|
||
do_statement($form, $items_sth, $items_query, $ap->{id});
|
||
$ap->{item_ids} = $dbh->selectcol_arrayref($items_sth);
|
||
$ap->{item_ids} = undef if !@{$ap->{item_ids}};
|
||
}
|
||
$items_sth->finish();
|
||
}
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
SL/AR.pm | ||
---|---|---|
|
||
$form->{AR} = [ @result ];
|
||
|
||
if ($form->{l_items} && scalar @{ $form->{AR} }) {
|
||
my ($items_query, $items_sth);
|
||
if ($form->{l_items}) {
|
||
$items_query =
|
||
qq|SELECT id
|
||
FROM invoice
|
||
WHERE trans_id = ?
|
||
ORDER BY position|;
|
||
|
||
$items_sth = prepare_query($form, $dbh, $items_query);
|
||
}
|
||
|
||
foreach my $ar (@{ $form->{AR} }) {
|
||
do_statement($form, $items_sth, $items_query, $ar->{id});
|
||
$ar->{item_ids} = $dbh->selectcol_arrayref($items_sth);
|
||
$ar->{item_ids} = undef if !@{$ar->{item_ids}};
|
||
}
|
||
$items_sth->finish();
|
||
}
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
bin/mozilla/ap.pl | ||
---|---|---|
use SL::DB::Chart;
|
||
use SL::DB::Currency;
|
||
use SL::DB::Default;
|
||
use SL::DB::InvoiceItem;
|
||
use SL::DB::Order;
|
||
use SL::DB::PaymentTerm;
|
||
use SL::DB::PurchaseInvoice;
|
||
use SL::DB::RecordTemplate;
|
||
use SL::DB::Tax;
|
||
use SL::Presenter::ItemsList;
|
||
use SL::Webdav;
|
||
use SL::Locale::String qw(t8);
|
||
|
||
... | ... | |
qw(transdate id type invnumber ordnumber name netamount tax amount paid datepaid
|
||
due duedate transaction_description notes employee globalprojectnumber department
|
||
vendornumber country ustid taxzone payment_terms charts debit_chart direct_debit
|
||
insertdate);
|
||
insertdate items);
|
||
|
||
my @hidden_variables = map { "l_${_}" } @columns;
|
||
push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id
|
||
... | ... | |
'debit_chart' => { 'text' => $locale->text('Debit Account'), },
|
||
'direct_debit' => { 'text' => $locale->text('direct debit'), },
|
||
'insertdate' => { 'text' => $locale->text('Insert Date'), },
|
||
'items' => { 'text' => $locale->text('Positions'), },
|
||
);
|
||
|
||
foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia transaction_description direct_debit department taxzone)) {
|
||
... | ... | |
my $row = { };
|
||
|
||
foreach my $column (@columns) {
|
||
next if ($column eq 'items');
|
||
|
||
$row->{$column} = {
|
||
'data' => $ap->{$column},
|
||
'align' => $column_alignment{$column},
|
||
... | ... | |
$row->{invnumber}->{link} = build_std_url("script=" . ($ap->{invoice} ? 'ir.pl' : 'ap.pl'), 'action=edit')
|
||
. "&id=" . E($ap->{id}) . "&callback=${callback}";
|
||
|
||
if ($form->{l_items}) {
|
||
my $items = SL::DB::Manager::InvoiceItem->get_all_sorted(where => [id => $ap->{item_ids}]);
|
||
$row->{items}->{raw_data} = SL::Presenter::ItemsList::items_list($items) if lc($report->{options}->{output_format}) eq 'html';
|
||
$row->{items}->{data} = SL::Presenter::ItemsList::items_list($items, as_text => 1) if lc($report->{options}->{output_format}) ne 'html';
|
||
}
|
||
|
||
my $row_set = [ $row ];
|
||
|
||
if (($form->{l_subtotal} eq 'Y')
|
bin/mozilla/ar.pl | ||
---|---|---|
use SL::DB::Default;
|
||
use SL::DB::Employee;
|
||
use SL::DB::Invoice;
|
||
use SL::DB::InvoiceItem;
|
||
use SL::DB::RecordTemplate;
|
||
use SL::DB::Tax;
|
||
use SL::Helper::Flash qw(flash flash_later);
|
||
use SL::Locale::String qw(t8);
|
||
use SL::Presenter::Tag;
|
||
use SL::Presenter::Chart;
|
||
use SL::Presenter::ItemsList;
|
||
use SL::ReportGenerator;
|
||
|
||
require "bin/mozilla/common.pl";
|
||
... | ... | |
qw(ids transdate id type invnumber ordnumber cusordnumber donumber deliverydate name netamount tax amount paid
|
||
datepaid due duedate transaction_description notes salesman employee shippingpoint shipvia
|
||
marge_total marge_percent globalprojectnumber customernumber country ustid taxzone
|
||
payment_terms charts customertype direct_debit dunning_description department attachments);
|
||
payment_terms charts customertype direct_debit dunning_description department attachments
|
||
items);
|
||
|
||
my $ct_cvar_configs = CVar->get_configs('module' => 'CT');
|
||
my @ct_includeable_custom_variables = grep { $_->{includeable} } @{ $ct_cvar_configs };
|
||
... | ... | |
'department' => { 'text' => $locale->text('Department'), },
|
||
dunning_description => { 'text' => $locale->text('Dunning level'), },
|
||
attachments => { 'text' => $locale->text('Attachments'), },
|
||
items => { 'text' => $locale->text('Positions'), },
|
||
%column_defs_cvars,
|
||
);
|
||
|
||
... | ... | |
my $row = { };
|
||
|
||
foreach my $column (@columns) {
|
||
next if ($column eq 'items');
|
||
|
||
$row->{$column} = {
|
||
'data' => $ar->{$column},
|
||
'align' => $column_alignment{$column},
|
||
... | ... | |
|
||
}
|
||
|
||
if ($form->{l_items}) {
|
||
my $items = SL::DB::Manager::InvoiceItem->get_all_sorted(where => [id => $ar->{item_ids}]);
|
||
$row->{items}->{raw_data} = SL::Presenter::ItemsList::items_list($items) if lc($report->{options}->{output_format}) eq 'html';
|
||
$row->{items}->{data} = SL::Presenter::ItemsList::items_list($items, as_text => 1) if lc($report->{options}->{output_format}) ne 'html';
|
||
}
|
||
|
||
my $row_set = [ $row ];
|
||
|
||
if (($form->{l_subtotal} eq 'Y')
|
templates/webpages/ap/search.html | ||
---|---|---|
<td nowrap>[% 'Debit Account' | $T8 %]</td>
|
||
<td align=right><input name="l_insertdate" class=checkbox type=checkbox value=Y></td>
|
||
<td nowrap>[% 'Insert Date' | $T8 %]</td>
|
||
<td align=right><input name="l_items" id="l_items" class=checkbox type=checkbox value=Y>
|
||
<td nowrap>[% 'Positions' | $T8 %]</td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan=4 align=left><b>[% 'Vendor' | $T8 %]</b></td>
|
templates/webpages/ar/search.html | ||
---|---|---|
<td align=right><input name="l_direct_debit" id="l_direct_debit" class=checkbox type=checkbox value=Y></td>
|
||
<td nowrap>[% 'direct debit' | $T8 %]</td>
|
||
</tr>
|
||
[% IF INSTANCE_CONF.get_doc_storage -%]
|
||
<tr>
|
||
<td align=right><input name="l_items" id="l_items" class=checkbox type=checkbox value=Y>
|
||
<td nowrap>[% 'Positions' | $T8 %]</td>
|
||
[% IF INSTANCE_CONF.get_doc_storage -%]
|
||
<td align=right><input name="l_attachments" id="l_attachments" class=checkbox type=checkbox value=Y></td>
|
||
<td nowrap>[% 'Attachments' | $T8 %]</td>
|
||
</tr>
|
||
[% END-%]
|
||
</tr>
|
||
<tr>
|
||
<td colspan=4 align=left><b>[% 'Customer' | $T8 %]</b></td>
|
||
</tr>
|
Auch abrufbar als: Unified diff
Belegberichte (Rechnungen) mit Positionsdetails