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++;
|
Belegberichte (Lieferscheine) mit Positionsdetails