Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e0bac67f

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

  • ID e0bac67faadc92d0e02ccb490627213962b5f112
  • Vorgänger b945837f
  • Nachfolger 916ec1da

Belegberichte (Lieferscheine) mit Positionsdetails

Unterschiede anzeigen:

SL/DO.pm
268 268

  
269 269
    my $sth = prepare_query($form, $dbh, $query);
270 270

  
271

  
272
    my ($items_query, $items_sth);
273
    if ($form->{l_items}) {
274
      $items_query =
275
        qq|SELECT id
276
          FROM delivery_order_items
277
          WHERE delivery_order_id = ?
278
          ORDER BY position|;
279

  
280
      $items_sth = prepare_query($form, $dbh, $items_query);
281
    }
282

  
271 283
    foreach my $dord (@{ $form->{DO} }) {
284
      if ($form->{l_items}) {
285
        do_statement($form, $items_sth, $items_query, $dord->{id});
286
        $dord->{item_ids} = $dbh->selectcol_arrayref($items_sth);
287
      }
288

  
272 289
      next unless ($dord->{ordnumber});
273 290
      do_statement($form, $sth, $query, $dord->{ordnumber});
274 291
      ($dord->{oe_id}) = $sth->fetchrow_array();
275 292
    }
276 293

  
277 294
    $sth->finish();
295
    $items_sth->finish() if $form->{l_items};
278 296
  }
279 297

  
280 298
  $main::lxdebug->leave_sub();
bin/mozilla/do.pl
38 38

  
39 39
use SL::Controller::DeliveryOrder;
40 40
use SL::DB::DeliveryOrder;
41
use SL::DB::DeliveryOrderItem;
41 42
use SL::DB::DeliveryOrder::TypeData qw(:types validate_type);
42 43
use SL::DB::ValidityToken;
43 44
use SL::Helper::UserPreferences::DisplayPreferences;
......
45 46
use SL::IR;
46 47
use SL::IS;
47 48
use SL::MoreCommon qw(ary_diff restore_form save_form);
49
use SL::Presenter::ItemsList;
48 50
use SL::ReportGenerator;
49 51
use SL::WH;
50 52
use SL::YAML;
......
753 755
    shipvia                 globalprojectnumber
754 756
    transaction_description department
755 757
    open                    delivered
756
    insertdate
758
    insertdate              items
757 759
  );
758 760

  
759 761
  $form->{l_open}      = $form->{l_closed} = "Y" if ($form->{open}      && $form->{closed});
......
792 794
    'delivered'               => { 'text' => $locale->text('Delivered'), },
793 795
    'department'              => { 'text' => $locale->text('Department'), },
794 796
    'insertdate'              => { 'text' => $locale->text('Insert Date'), },
797
    'items'                   => { 'text' => $locale->text('Positions'), },
795 798
  );
796 799

  
797 800
  foreach my $name (qw(id transdate reqdate donumber ordnumber name employee salesman shipvia transaction_description department insertdate)) {
......
914 917
    $dord->{open}      = $dord->{closed}    ? $locale->text('No')  : $locale->text('Yes');
915 918
    $dord->{delivered} = $dord->{delivered} ? $locale->text('Yes') : $locale->text('No');
916 919

  
917
    my $row = { map { $_ => { 'data' => $dord->{$_} } } @columns };
920
    my $row = { map { $_ => { 'data' => $dord->{$_} } } grep {$_ ne 'items'} @columns };
918 921

  
919 922
    my $ord_id = $dord->{id};
920 923
    $row->{ids}  = {
......
928 931
                              ? SL::Controller::DeliveryOrder->url_for(action => "edit", id => $dord->{id}, type => $dord->{order_type})
929 932
                              : $edit_url  . "&id=" . E($dord->{id})      . "&callback=${callback}";
930 933
    $row->{ordnumber}->{link} = $edit_order_url . "&id=" . E($dord->{oe_id})   . "&callback=${callback}" if $dord->{oe_id};
934

  
935
    if ($form->{l_items}) {
936
      my $items = SL::DB::Manager::DeliveryOrderItem->get_all_sorted(where => [id => $dord->{item_ids}]);
937
      $row->{items}->{raw_data}  = SL::Presenter::ItemsList::items_list($items)               if lc($report->{options}->{output_format}) eq 'html';
938
      $row->{items}->{data}      = SL::Presenter::ItemsList::items_list($items, as_text => 1) if lc($report->{options}->{output_format}) ne 'html';
939
    }
940

  
931 941
    $report->add_data($row);
932 942

  
933 943
    $idx++;
templates/webpages/do/search.html
243 243
        </td>
244 244
       </tr>
245 245

  
246
       <tr>
247
        <td>
248
         <input name="l_items" id="l_items" class="checkbox" type="checkbox" value="Y">
249
         <label for="l_items">[% 'Positions' | $T8 %]</label>
250
        </td>
251
       </tr>
252

  
246 253
      </table>
247 254
     </td>
248 255
    </tr>

Auch abrufbar als: Unified diff