1 package SL::Controller::DeliveryOrder::TypeData;
4 use Exporter qw(import);
5 use Scalar::Util qw(weaken);
6 use SL::Locale::String qw(t8);
7 use SL::DB::DeliveryOrder::TypeData qw(:types :subs);
9 use Rose::Object::MakeMethods::Generic scalar => [ qw(c) ];
12 my ($class, $controller) = @_;
13 my $o = bless {}, $class;
24 my ($self, $string) = @_;
25 validate_type($string);
29 my ($self, $string) = @_;
30 get3($self->c->type, "text", $string);
34 my ($self, $string) = @_;
35 get3($self->c->type, "show_menu", $string);
39 my ($self, $string) = @_;
40 get3($self->c->type, "workflow", $string);
44 my ($self, $string) = @_;
45 get3($self->c->type, "properties", $string);
49 get($_[0]->c->type, "right");
53 get3($_[0]->c->type, "properties", "is_quotation");
57 get3($_[0]->c->type, "properties", "customervendor");
61 get3($_[0]->c->type, "properties", "is_customer");
65 get3($_[0]->c->type, "properties", "nr_key");
68 sub part_classification_query {
69 my ($self, $string) = @_;
70 get($self->c->type, "part_classification_query");
73 sub set_reqdate_by_type {
76 if (!$self->c->order->reqdate) {
77 $self->c->order->reqdate(DateTime->today_local->next_workday(extra_days => 1));
81 sub get_reqdate_by_type {
82 my ($self, $reqdate, $saved_reqdate) = @_;
84 if ($reqdate == $saved_reqdate) {
85 return DateTime->today_local->next_workday(extra_days => 1);