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 my @export_types = qw(SALES_DELIVERY_ORDER_TYPE PURCHASE_DELIVERY_ORDER_TYPE SUPPLIER_DELIVERY_ORDER_TYPE RMA_DELIVERY_ORDER_TYPE);
11 our @EXPORT_OK = (@export_types);
12 our %EXPORT_TAGS = (types => \@export_types);
14 use Rose::Object::MakeMethods::Generic scalar => [ qw(c) ];
17 my ($class, $controller) = @_;
18 my $o = bless {}, $class;
29 my ($self, $string) = @_;
30 validate_type($string);
34 my ($self, $string) = @_;
35 get3($self->c->type, "text", $string);
39 my ($self, $string) = @_;
40 get3($self->c->type, "show_menu", $string);
44 my ($self, $string) = @_;
45 get3($self->c->type, "workflow", $string);
49 my ($self, $string) = @_;
50 get3($self->c->type, "properties", $string);
54 my ($self, $string) = @_;
55 get3($_[0]->c->type, "rights", $string);
59 get3($_[0]->c->type, "properties", "is_quotation");
63 get3($_[0]->c->type, "properties", "customervendor");
67 get3($_[0]->c->type, "properties", "is_customer");
71 get3($_[0]->c->type, "properties", "nr_key");
75 get3($_[0]->c->type, "properties", "transfer");
78 sub part_classification_query {
79 my ($self, $string) = @_;
80 get($self->c->type, "part_classification_query");
83 sub set_reqdate_by_type {
86 if (!$self->c->order->reqdate) {
87 $self->c->order->reqdate(DateTime->today_local->next_workday(extra_days => 1));
91 sub get_reqdate_by_type {
92 my ($self, $reqdate, $saved_reqdate) = @_;
94 if ($reqdate == $saved_reqdate) {
95 return DateTime->today_local->next_workday(extra_days => 1);