17 |
17 |
use SL::Helper::Flash;
|
18 |
18 |
use SL::Locale::String;
|
19 |
19 |
|
20 |
|
use constant TAB_ID => 'ui-tabs-4';
|
|
20 |
use constant LIST_SELECTOR => '#quotations_and_orders';
|
|
21 |
use constant FORMS_SELECTOR => '#quotations_and_orders_article_assignment,#quotations_and_orders_new,#quotations_and_orders_update';
|
21 |
22 |
|
22 |
23 |
use Rose::Object::MakeMethods::Generic
|
23 |
24 |
(
|
... | ... | |
44 |
45 |
return $self->js->flash('error', t8('This function requires the presence of articles with a time-based unit such as "h" or "min".'))->render($self);
|
45 |
46 |
}
|
46 |
47 |
|
47 |
|
my $html = $self->render('requirement_spec_order/new', { output => 0 }, make_part_title => sub { $_[0]->partnumber . ' ' . $_[0]->description });
|
48 |
|
$self->js->html('#' . TAB_ID(), $html)
|
|
48 |
my $html = $self->render('requirement_spec_order/new', { output => 0 }, make_part_title => sub { $_[0]->partnumber . ' ' . $_[0]->description });
|
|
49 |
$self->js->hide(LIST_SELECTOR())
|
|
50 |
->after(LIST_SELECTOR(), $html)
|
49 |
51 |
->render($self);
|
50 |
52 |
}
|
51 |
53 |
|
... | ... | |
72 |
74 |
|
73 |
75 |
# 3. Notify the user and return to list.
|
74 |
76 |
my $html = $self->render('requirement_spec_order/list', { output => 0 });
|
75 |
|
$self->js->html('#' . TAB_ID(), $html)
|
|
77 |
$self->js->replaceWith(LIST_SELECTOR(), $html)
|
|
78 |
->remove(FORMS_SELECTOR())
|
76 |
79 |
->flash('info', $::form->{quotation} ? t8('Sales quotation #1 has been created.', $order->quonumber) : t8('Sales order #1 has been created.', $order->ordnumber))
|
77 |
80 |
->render($self);
|
78 |
81 |
}
|
... | ... | |
99 |
102 |
make_section_title => sub { $_[0]->fb_number . ' ' . $_[0]->title },
|
100 |
103 |
);
|
101 |
104 |
|
102 |
|
$self->js->html('#' . TAB_ID(), $html)
|
|
105 |
$self->js->hide(LIST_SELECTOR())
|
|
106 |
->after(LIST_SELECTOR(), $html)
|
103 |
107 |
->render($self);
|
104 |
108 |
}
|
105 |
109 |
|
... | ... | |
136 |
140 |
$self->init_requirement_spec;
|
137 |
141 |
|
138 |
142 |
my $html = $self->render('requirement_spec_order/list', { output => 0 });
|
139 |
|
$self->js->html('#' . TAB_ID(), $html)
|
|
143 |
$self->js->replaceWith(LIST_SELECTOR(), $html)
|
|
144 |
->remove(FORMS_SELECTOR())
|
140 |
145 |
->flash('info', $::form->{quotation} ? t8('Sales quotation #1 has been updated.', $order->quonumber) : t8('Sales order #1 has been updated.', $order->ordnumber))
|
141 |
146 |
->render($self);
|
142 |
147 |
}
|
... | ... | |
149 |
154 |
}
|
150 |
155 |
|
151 |
156 |
my $html = $self->render('requirement_spec_order/edit_assignment', { output => 0 }, make_part_title => sub { $_[0]->partnumber . ' ' . $_[0]->description });
|
152 |
|
$self->js->html('#' . TAB_ID(), $html)
|
|
157 |
$self->js->hide(LIST_SELECTOR())
|
|
158 |
->after(LIST_SELECTOR(), $html)
|
153 |
159 |
->render($self);
|
154 |
160 |
}
|
155 |
161 |
|
... | ... | |
159 |
165 |
SL::DB::RequirementSpecItem->new(id => $_->{id})->load->update_attributes(order_part_id => ($_->{order_part_id} || undef)) for @{ $sections };
|
160 |
166 |
|
161 |
167 |
my $html = $self->render('requirement_spec_order/list', { output => 0 });
|
162 |
|
$self->js->html('#' . TAB_ID(), $html)
|
|
168 |
$self->js->replaceWith(LIST_SELECTOR(), $html)
|
|
169 |
->remove(FORMS_SELECTOR())
|
163 |
170 |
->render($self);
|
164 |
171 |
}
|
165 |
172 |
|
... | ... | |
172 |
179 |
$self->init_requirement_spec;
|
173 |
180 |
|
174 |
181 |
my $html = $self->render('requirement_spec_order/list', { output => 0 });
|
175 |
|
$self->js->html('#' . TAB_ID(), $html)
|
|
182 |
$self->js->replaceWith(LIST_SELECTOR(), $html)
|
176 |
183 |
->flash('info', $order->quotation ? t8('Sales quotation #1 has been deleted.', $order->quonumber) : t8('Sales order #1 has been deleted.', $order->ordnumber))
|
177 |
184 |
->render($self);
|
178 |
185 |
}
|
179 |
186 |
|
180 |
|
sub action_cancel {
|
181 |
|
my ($self) = @_;
|
182 |
|
|
183 |
|
my $html = $self->render('requirement_spec_order/list', { output => 0 });
|
184 |
|
$self->js->html('#' . TAB_ID(), $html)
|
185 |
|
->render($self);
|
186 |
|
}
|
187 |
|
|
188 |
187 |
#
|
189 |
188 |
# filters
|
190 |
189 |
#
|
Pflichtenheft Angebote/Aufträge: "Abbrechen" ohne AJAX-Call nur in JS