Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 14ec63c8

Von Moritz Bunkus vor fast 2 Jahren hinzugefügt

  • ID 14ec63c8c100f32baa35a6ef99555ae778856155
  • Vorgänger b662d795
  • Nachfolger df7c8480

Lieferbedingungen ungültig markieren können

Unterschiede anzeigen:

SL/Controller/Order.pm
2246 2246
                                                                           sort_by => 'name');
2247 2247
  $self->{all_payment_terms}          = SL::DB::Manager::PaymentTerm->get_all_sorted(where => [ or => [ id => $self->order->payment_id,
2248 2248
                                                                                                        obsolete => 0 ] ]);
2249
  $self->{all_delivery_terms}         = SL::DB::Manager::DeliveryTerm->get_all_sorted();
2249
  $self->{all_delivery_terms}         = SL::DB::Manager::DeliveryTerm->get_valid($self->order->delivery_term_id);
2250 2250
  $self->{all_statuses}               = SL::DB::Manager::OrderStatus->get_all_sorted(where => [ or => [ id => $self->order->order_status_id,
2251 2251
                                                                                                        obsolete => 0,  ] ] );
2252 2252
  $self->{current_employee_id}        = SL::DB::Manager::Employee->current->id;
SL/DB/Manager/DeliveryTerm.pm
18 18
                      });
19 19
}
20 20

  
21
sub get_valid {
22
  my ($class, $with_this_id) = @_;
23

  
24
  my @conditions = (obsolete => 0);
25

  
26
  if ($with_this_id) {
27
    @conditions = (
28
      or => [
29
        id => $with_this_id,
30
        @conditions,
31
      ]);
32
  }
33

  
34
  return $class->get_all_sorted(query => \@conditions);
35
}
36

  
21 37
1;
SL/DB/MetaSetup/DeliveryTerm.pm
14 14
  id               => { type => 'integer', not_null => 1, sequence => 'id' },
15 15
  itime            => { type => 'timestamp', default => 'now()' },
16 16
  mtime            => { type => 'timestamp' },
17
  obsolete         => { type => 'boolean', default => 'false', not_null => 1 },
17 18
  sortkey          => { type => 'integer', not_null => 1 },
18 19
);
19 20

  
bin/mozilla/do.pl
519 519
    ]);
520 520

  
521 521
  $::form->{ALL_PROJECTS}          = SL::DB::Manager::Project->get_all_sorted(query => \@conditions);
522
  $::form->{ALL_DELIVERY_TERMS}    = SL::DB::Manager::DeliveryTerm->get_all_sorted();
522
  $::form->{ALL_DELIVERY_TERMS}    = SL::DB::Manager::DeliveryTerm->get_valid($::form->{delivery_term_id});
523 523
  $::form->{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
524 524
  $::form->{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
525 525
  $::form->{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all_sorted(query => [
bin/mozilla/ir.pl
467 467
                   "price_factors" => "ALL_PRICE_FACTORS");
468 468

  
469 469
  $TMPL_VAR->{ALL_DEPARTMENTS}       = SL::DB::Manager::Department->get_all_sorted;
470
  $TMPL_VAR->{ALL_DELIVERY_TERMS}    = SL::DB::Manager::DeliveryTerm->get_all_sorted();
470
  $TMPL_VAR->{ALL_DELIVERY_TERMS}    = SL::DB::Manager::DeliveryTerm->get_valid($::form->{delivery_term_id});
471 471
  $TMPL_VAR->{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
472 472
  $TMPL_VAR->{ALL_CONTACTS}          = SL::DB::Manager::Contact->get_all_sorted(query => [
473 473
    or => [
bin/mozilla/is.pl
603 603

  
604 604
  $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted;
605 605
  $form->{ALL_LANGUAGES}   = SL::DB::Manager::Language->get_all_sorted;
606
  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
606
  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_valid($form->{delivery_term_id});
607 607

  
608 608
  # Projects
609 609
  my @old_project_ids = uniq grep { $_ } map { $_ * 1 } ($form->{"globalproject_id"}, map { $form->{"project_id_$_"} } 1..$form->{"rowcount"});
bin/mozilla/oe.pl
563 563
    ]);
564 564

  
565 565
  $TMPL_VAR->{ALL_PROJECTS}          = SL::DB::Manager::Project->get_all_sorted(query => \@conditions);
566
  $TMPL_VAR->{ALL_DELIVERY_TERMS}    = SL::DB::Manager::DeliveryTerm->get_all_sorted();
566
  $TMPL_VAR->{ALL_DELIVERY_TERMS}    = SL::DB::Manager::DeliveryTerm->get_valid($form->{delivery_term_id});
567 567
  $form->{ALL_PROJECTS}            = $TMPL_VAR->{ALL_PROJECTS}; # make projects available for second row drop-down in io.pl
568 568

  
569 569
  # label subs
sql/Pg-upgrade2/delivery_terms_markable_as_obsolete.sql
1
-- @tag: delivery_terms_markable_as_obsolete
2
-- @description: Lieferbedingungenals ungültig markierbar
3
-- @depends: release_3_7_0
4
ALTER TABLE delivery_terms
5
ADD COLUMN obsolete BOOLEAN NOT NULL DEFAULT FALSE;
templates/webpages/delivery_term/form.html
28 28
     </td>
29 29
    </tr>
30 30
   [%- END %]
31

  
32
   <tr>
33
    <td>[% 'Obsolete' | $T8 %]</td>
34
    <td>[% L.checkbox_tag('delivery_term.obsolete', checked=SELF.delivery_term.obsolete, for_submit=1) %]</td>
35
   </tr>
31 36
  </table>
32 37

  
33 38
  [% P.hidden_tag("id", SELF.delivery_term.id) %]
templates/webpages/delivery_term/list.html
16 16
     <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
17 17
     <th>[%- 'Description' | $T8 %]</th>
18 18
     <th>[%- 'Long Description' | $T8 %]</th>
19
     <th>[%- 'Obsolete' | $T8 %]</th>
19 20
    </tr>
20 21
    </thead>
21 22

  
......
29 30
      </a>
30 31
     </td>
31 32
     <td>[%- HTML.escape(delivery_term.description_long) %]</td>
33
     <td>[% IF delivery_term.obsolete %][% LxERP.t8("yes") %][% ELSE %][% LxERP.t8("no") %][% END %]</td>
32 34
    </tr>
33 35
    [%- END %]
34 36
    </tbody>

Auch abrufbar als: Unified diff