Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b008860a

Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt

  • ID b008860ae0d3a6d48a25b0e822e281a63dcaa432
  • Vorgänger 916ec1da
  • Nachfolger 0c318d78

Belegberichte (Rechnungen) mit Positionsdetails

Unterschiede anzeigen:

SL/AP.pm
720 720

  
721 721
  $form->{AP} = [ @result ];
722 722

  
723
  if ($form->{l_items} && scalar @{ $form->{AP} }) {
724
    my ($items_query, $items_sth);
725
    if ($form->{l_items}) {
726
      $items_query =
727
        qq|SELECT id
728
          FROM invoice
729
          WHERE trans_id  = ?
730
          ORDER BY position|;
731

  
732
      $items_sth = prepare_query($form, $dbh, $items_query);
733
    }
734

  
735
    foreach my $ap (@{ $form->{AP} }) {
736
      do_statement($form, $items_sth, $items_query, $ap->{id});
737
      $ap->{item_ids} = $dbh->selectcol_arrayref($items_sth);
738
      $ap->{item_ids} = undef if !@{$ap->{item_ids}};
739
    }
740
    $items_sth->finish();
741
  }
742

  
723 743
  $main::lxdebug->leave_sub();
724 744
}
725 745

  
SL/AR.pm
703 703

  
704 704
  $form->{AR} = [ @result ];
705 705

  
706
  if ($form->{l_items} && scalar @{ $form->{AR} }) {
707
    my ($items_query, $items_sth);
708
    if ($form->{l_items}) {
709
      $items_query =
710
        qq|SELECT id
711
          FROM invoice
712
          WHERE trans_id  = ?
713
          ORDER BY position|;
714

  
715
      $items_sth = prepare_query($form, $dbh, $items_query);
716
    }
717

  
718
    foreach my $ar (@{ $form->{AR} }) {
719
      do_statement($form, $items_sth, $items_query, $ar->{id});
720
      $ar->{item_ids} = $dbh->selectcol_arrayref($items_sth);
721
      $ar->{item_ids} = undef if !@{$ar->{item_ids}};
722
    }
723
    $items_sth->finish();
724
  }
725

  
706 726
  $main::lxdebug->leave_sub();
707 727
}
708 728

  
bin/mozilla/ap.pl
47 47
use SL::DB::Chart;
48 48
use SL::DB::Currency;
49 49
use SL::DB::Default;
50
use SL::DB::InvoiceItem;
50 51
use SL::DB::Order;
51 52
use SL::DB::PaymentTerm;
52 53
use SL::DB::PurchaseInvoice;
53 54
use SL::DB::RecordTemplate;
54 55
use SL::DB::Tax;
56
use SL::Presenter::ItemsList;
55 57
use SL::Webdav;
56 58
use SL::Locale::String qw(t8);
57 59

  
......
1045 1047
    qw(transdate id type invnumber ordnumber name netamount tax amount paid datepaid
1046 1048
       due duedate transaction_description notes employee globalprojectnumber department
1047 1049
       vendornumber country ustid taxzone payment_terms charts debit_chart direct_debit
1048
       insertdate);
1050
       insertdate items);
1049 1051

  
1050 1052
  my @hidden_variables = map { "l_${_}" } @columns;
1051 1053
  push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id
......
1082 1084
    'debit_chart'             => { 'text' => $locale->text('Debit Account'), },
1083 1085
    'direct_debit'            => { 'text' => $locale->text('direct debit'), },
1084 1086
    'insertdate'              => { 'text' => $locale->text('Insert Date'), },
1087
    'items'                   => { 'text' => $locale->text('Positions'), },
1085 1088
  );
1086 1089

  
1087 1090
  foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia transaction_description direct_debit department taxzone)) {
......
1176 1179
    my $row = { };
1177 1180

  
1178 1181
    foreach my $column (@columns) {
1182
      next if ($column eq 'items');
1183

  
1179 1184
      $row->{$column} = {
1180 1185
        'data'  => $ap->{$column},
1181 1186
        'align' => $column_alignment{$column},
......
1185 1190
    $row->{invnumber}->{link} = build_std_url("script=" . ($ap->{invoice} ? 'ir.pl' : 'ap.pl'), 'action=edit')
1186 1191
      . "&id=" . E($ap->{id}) . "&callback=${callback}";
1187 1192

  
1193
    if ($form->{l_items}) {
1194
      my $items = SL::DB::Manager::InvoiceItem->get_all_sorted(where => [id => $ap->{item_ids}]);
1195
      $row->{items}->{raw_data}  = SL::Presenter::ItemsList::items_list($items)               if lc($report->{options}->{output_format}) eq 'html';
1196
      $row->{items}->{data}      = SL::Presenter::ItemsList::items_list($items, as_text => 1) if lc($report->{options}->{output_format}) ne 'html';
1197
    }
1198

  
1188 1199
    my $row_set = [ $row ];
1189 1200

  
1190 1201
    if (($form->{l_subtotal} eq 'Y')
bin/mozilla/ar.pl
48 48
use SL::DB::Default;
49 49
use SL::DB::Employee;
50 50
use SL::DB::Invoice;
51
use SL::DB::InvoiceItem;
51 52
use SL::DB::RecordTemplate;
52 53
use SL::DB::Tax;
53 54
use SL::Helper::Flash qw(flash flash_later);
54 55
use SL::Locale::String qw(t8);
55 56
use SL::Presenter::Tag;
56 57
use SL::Presenter::Chart;
58
use SL::Presenter::ItemsList;
57 59
use SL::ReportGenerator;
58 60

  
59 61
require "bin/mozilla/common.pl";
......
1028 1030
    qw(ids transdate id type invnumber ordnumber cusordnumber donumber deliverydate name netamount tax amount paid
1029 1031
       datepaid due duedate transaction_description notes salesman employee shippingpoint shipvia
1030 1032
       marge_total marge_percent globalprojectnumber customernumber country ustid taxzone
1031
       payment_terms charts customertype direct_debit dunning_description department attachments);
1033
       payment_terms charts customertype direct_debit dunning_description department attachments
1034
       items);
1032 1035

  
1033 1036
  my $ct_cvar_configs                 = CVar->get_configs('module' => 'CT');
1034 1037
  my @ct_includeable_custom_variables = grep { $_->{includeable} } @{ $ct_cvar_configs };
......
1084 1087
    'department'              => { 'text' => $locale->text('Department'), },
1085 1088
    dunning_description       => { 'text' => $locale->text('Dunning level'), },
1086 1089
    attachments               => { 'text' => $locale->text('Attachments'), },
1090
    items                     => { 'text' => $locale->text('Positions'), },
1087 1091
    %column_defs_cvars,
1088 1092
  );
1089 1093

  
......
1252 1256
    my $row = { };
1253 1257

  
1254 1258
    foreach my $column (@columns) {
1259
      next if ($column eq 'items');
1260

  
1255 1261
      $row->{$column} = {
1256 1262
        'data'  => $ar->{$column},
1257 1263
        'align' => $column_alignment{$column},
......
1281 1287

  
1282 1288
    }
1283 1289

  
1290
    if ($form->{l_items}) {
1291
      my $items = SL::DB::Manager::InvoiceItem->get_all_sorted(where => [id => $ar->{item_ids}]);
1292
      $row->{items}->{raw_data}  = SL::Presenter::ItemsList::items_list($items)               if lc($report->{options}->{output_format}) eq 'html';
1293
      $row->{items}->{data}      = SL::Presenter::ItemsList::items_list($items, as_text => 1) if lc($report->{options}->{output_format}) ne 'html';
1294
    }
1295

  
1284 1296
    my $row_set = [ $row ];
1285 1297

  
1286 1298
    if (($form->{l_subtotal} eq 'Y')
templates/webpages/ap/search.html
152 152
           <td nowrap>[% 'Debit Account' | $T8 %]</td>
153 153
           <td align=right><input name="l_insertdate" class=checkbox type=checkbox value=Y></td>
154 154
           <td nowrap>[% 'Insert Date' | $T8 %]</td>
155
           <td align=right><input name="l_items" id="l_items" class=checkbox type=checkbox value=Y>
156
           <td nowrap>[% 'Positions' | $T8 %]</td>
155 157
          </tr>
156 158
         <tr>
157 159
          <td colspan=4 align=left><b>[% 'Vendor' | $T8 %]</b></td>
templates/webpages/ar/search.html
216 216
           <td align=right><input name="l_direct_debit" id="l_direct_debit" class=checkbox type=checkbox value=Y></td>
217 217
           <td nowrap>[% 'direct debit' | $T8 %]</td>
218 218
          </tr>
219
[% IF INSTANCE_CONF.get_doc_storage -%]
220 219
          <tr>
220
           <td align=right><input name="l_items" id="l_items" class=checkbox type=checkbox value=Y>
221
           <td nowrap>[% 'Positions' | $T8 %]</td>
222
[% IF INSTANCE_CONF.get_doc_storage -%]
221 223
           <td align=right><input name="l_attachments" id="l_attachments" class=checkbox type=checkbox value=Y></td>
222 224
           <td nowrap>[% 'Attachments' | $T8 %]</td>
223
          </tr>
224 225
[% END-%]
226
          </tr>
225 227
          <tr>
226 228
           <td colspan=4 align=left><b>[% 'Customer' | $T8 %]</b></td>
227 229
          </tr>

Auch abrufbar als: Unified diff