Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8ef7fee7

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 8ef7fee7f6007ddf758de0e74839da386c3446f3
  • Vorgänger e142cf7d
  • Nachfolger bf6510a2

Pflichtenhefte -> Angebote/Aufträge: nur Artikel mit Zeit-basierenden Einheiten

Unterschiede anzeigen:

SL/Controller/ClientConfig.pm
19 19
__PACKAGE__->run_before('check_auth');
20 20

  
21 21
use Rose::Object::MakeMethods::Generic (
22
  'scalar --get_set_init' => [ qw(defaults all_warehouses all_weightunits all_languages all_currencies all_templates all_parts posting_options payment_options accounting_options inventory_options profit_options accounts balance_startdate_method_options) ],
22
  'scalar --get_set_init' => [ qw(defaults all_warehouses all_weightunits all_languages all_currencies all_templates all_parts_time_unit
23
                                  posting_options payment_options accounting_options inventory_options profit_options accounts balance_startdate_method_options) ],
23 24
);
24 25

  
25 26
sub action_edit {
......
140 141
sub init_all_warehouses  { SL::DB::Manager::Warehouse->get_all_sorted                                                    }
141 142
sub init_all_languages   { SL::DB::Manager::Language->get_all_sorted                                                     }
142 143
sub init_all_currencies  { SL::DB::Manager::Currency->get_all_sorted                                                     }
143
sub init_all_parts       { SL::DB::Manager::Part->get_all_sorted                                                         }
144 144
sub init_all_weightunits { my $unit = SL::DB::Manager::Unit->find_by(name => 'kg'); $unit ? $unit->convertible_units : [] }
145 145
sub init_all_templates   { +{ SL::Template->available_templates }                                                        }
146 146

  
147
sub init_all_parts_time_unit {
148
  my $h_unit = first { $_ } map { SL::DB::Manager::Unit->find_by(name => $_) } qw(Std h Stunde);
149
  return [] unless $h_unit;
150

  
151
  my @convertible_unit_names = map { $_->name } @{ $h_unit->convertible_units };
152

  
153
  return SL::DB::Manager::Part->get_all_sorted(where => [ unit => \@convertible_unit_names ]);
154
}
155

  
147 156
sub init_posting_options {
148 157
  [ { title => t8("never"),           value => 0           },
149 158
    { title => t8("every time"),      value => 1           },
SL/Controller/RequirementSpecOrder.pm
22 22
use Rose::Object::MakeMethods::Generic
23 23
(
24 24
  scalar                  => [ qw(parts) ],
25
  'scalar --get_set_init' => [ qw(requirement_spec rs_order js h_unit_name all_customers all_parts) ],
25
  'scalar --get_set_init' => [ qw(requirement_spec rs_order js h_unit_name all_customers all_parts_time_unit) ],
26 26
);
27 27

  
28 28
__PACKAGE__->run_before('setup');
......
40 40
sub action_new {
41 41
  my ($self) = @_;
42 42

  
43
  if (!@{ $self->all_parts_time_unit }) {
44
    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

  
43 47
  my $html   = $self->render('requirement_spec_order/new', { output => 0 }, make_part_title => sub { $_[0]->partnumber . ' ' . $_[0]->description });
44 48
  $self->js->html('#' . TAB_ID(), $html)
45 49
           ->render($self);
......
139 143
sub action_edit_assignment {
140 144
  my ($self) = @_;
141 145

  
146
  if (!@{ $self->all_parts_time_unit }) {
147
    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);
148
  }
149

  
142 150
  my $html   = $self->render('requirement_spec_order/edit_assignment', { output => 0 }, make_part_title => sub { $_[0]->partnumber . ' ' . $_[0]->description });
143 151
  $self->js->html('#' . TAB_ID(), $html)
144 152
           ->render($self);
......
201 209
}
202 210

  
203 211
sub init_all_customers { SL::DB::Manager::Customer->get_all_sorted }
204
sub init_all_parts     { SL::DB::Manager::Part->get_all_sorted     }
205 212
sub init_h_unit_name   { first { SL::DB::Manager::Unit->find_by(name => $_) } qw(Std h Stunde) };
206 213
sub init_rs_order      { SL::DB::RequirementSpecOrder->new(id => $::form->{rs_order_id})->load };
207 214

  
215
sub init_all_parts_time_unit {
216
  my ($self) = @_;
217

  
218
  return [] unless $self->h_unit_name;
219

  
220
  my @convertible_unit_names = map { $_->name } @{ SL::DB::Manager::Unit->find_by(name => $self->h_unit_name)->convertible_units };
221

  
222
  return SL::DB::Manager::Part->get_all_sorted(where => [ unit => \@convertible_unit_names ]);
223
}
224

  
208 225
#
209 226
# helpers
210 227
#
locale/de/all
2511 2511
  'This could have happened for two reasons:' => 'Dies kann aus zwei Gründen geschehen sein:',
2512 2512
  'This customer number is already in use.' => 'Diese Kundennummer wird bereits verwendet.',
2513 2513
  'This feature especially prevents mistakes by mixing up prior tax and sales tax.' => 'Dieses Feature vermeidet insbesondere Verwechslungen von Umsatz- und Vorsteuer.',
2514
  'This function requires the presence of articles with a time-based unit such as "h" or "min".' => 'Für diese Funktion mussen Artikel mit einer Zeit-basierten Einheit wie "Std" oder "min" existieren.',
2514 2515
  'This group is valid for the following clients' => 'Diese Gruppe ist für die folgenden Mandanten gültig',
2515 2516
  'This has been changed in this version, therefore please change the "old" bins to some real warehouse bins.' => 'Das wurde in dieser Version umgestellt, bitte ändern Sie die Freitext-Lagerplätze auf vorhandene Lagerplätze.',
2516 2517
  'This has been changed in this version.' => 'Ab dieser Version ist dies nicht mehr so.',
templates/webpages/client_config/_features.html
61 61

  
62 62
  <tr>
63 63
   <td align="right">[% LxERP.t8('Default article for converting into quotations and orders') %]</td>
64
   <td>[% L.select_tag('defaults.requirement_spec_section_order_part_id', SELF.all_parts, default=SELF.defaults.requirement_spec_section_order_part_id, with_empty=1, title_sub=\make_part_title) %]</td>
64
   <td>[% L.select_tag('defaults.requirement_spec_section_order_part_id', SELF.all_parts_time_unit, default=SELF.defaults.requirement_spec_section_order_part_id, with_empty=1, title_sub=\make_part_title) %]</td>
65 65
   <td>[% LxERP.t8('When converting a requirement spec into a quotation or an oder each section gets converted into a line position in the new record. This is the article used by default for this conversion.') %]</td>
66 66
  </tr>
67 67
 </table>
templates/webpages/requirement_spec_order/_assignment_form.html
18 18
  <tr>
19 19
   <td>[% LxERP.t8("Assign the following article to all sections") %]:</td>
20 20
   <td>
21
    [% L.select_tag('quotations_and_orders_dummy', SELF.all_parts, default=INSTANCE_CONF.get_requirement_spec_section_order_part_id, title_sub=\make_part_title, id='quoations_and_orders_order_id', style=style) %]
21
    [% L.select_tag('quotations_and_orders_dummy', SELF.all_parts_time_unit, default=INSTANCE_CONF.get_requirement_spec_section_order_part_id, title_sub=\make_part_title, id='quoations_and_orders_order_id', style=style) %]
22 22
    [% L.button_tag('kivi.requirement_spec.assign_order_part_id_to_all()', LxERP.t8('Assign article')) %]
23 23
   </td>
24 24
  </tr>
......
41 41
    <td>[% HTML.escape(section.fb_number) %]</td>
42 42
    <td>[% HTML.escape(section.title) %]</td>
43 43
    <td>[% HTML.escape(P.truncate(section.description)) %]</td>
44
    <td>[% L.select_tag('sections[].order_part_id', SELF.all_parts, default=section.order_part_id, with_empty=!for_new, title_sub=\make_part_title, style=style, no_id=1) %]</td>
44
    <td>[% L.select_tag('sections[].order_part_id', SELF.all_parts_time_unit, default=section.order_part_id, with_empty=!for_new, title_sub=\make_part_title, style=style, no_id=1) %]</td>
45 45
   </tr>
46 46
   [% END %]
47 47
  </tbody>

Auch abrufbar als: Unified diff