Pflichtenhefte: Maske fürs Erstellen von Angeboten/Aufträgen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 10 Jul 2013 13:47:06 +0000 (15:47 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 1 Apr 2014 11:05:57 +0000 (13:05 +0200)
SL/Controller/RequirementSpecOrder.pm
locale/de/all
templates/webpages/requirement_spec_order/_assignment_form.html
templates/webpages/requirement_spec_order/new.html [new file with mode: 0644]

index 1822e2b..696b862 100644 (file)
@@ -6,6 +6,7 @@ use utf8;
 use parent qw(SL::Controller::Base);
 
 use SL::ClientJS;
+use SL::DB::Customer;
 use SL::DB::Part;
 use SL::DB::RequirementSpec;
 use SL::DB::RequirementSpecOrder;
@@ -14,7 +15,7 @@ use SL::Locale::String;
 
 use Rose::Object::MakeMethods::Generic
 (
-  'scalar --get_set_init' => [ qw(requirement_spec js all_parts) ],
+  'scalar --get_set_init' => [ qw(requirement_spec js all_customers all_parts) ],
 );
 
 __PACKAGE__->run_before('setup');
@@ -30,6 +31,14 @@ sub action_list {
   $self->render('requirement_spec_order/list', { layout => 0 });
 }
 
+sub action_new {
+  my ($self) = @_;
+
+  my $html   = $self->render('requirement_spec_order/new', { output => 0 }, make_part_title => sub { $_[0]->partnumber . ' ' . $_[0]->description });
+  $self->js->html('#ui-tabs-4', $html)
+           ->render($self);
+}
+
 sub action_edit_assignment {
   my ($self) = @_;
 
@@ -84,6 +93,7 @@ sub init_js {
 # helpers
 #
 
-sub init_all_parts { SL::DB::Manager::Part->get_all_sorted }
+sub init_all_customers { SL::DB::Manager::Customer->get_all_sorted }
+sub init_all_parts     { SL::DB::Manager::Part->get_all_sorted     }
 
 1;
index 2057098..d1cefb9 100755 (executable)
@@ -592,6 +592,7 @@ $self->{texts} = {
   'Create new department'       => 'Neue Abteilung erfassen',
   'Create new payment term'     => 'Neue Zahlungsbedingung anlegen',
   'Create new project type'     => 'Neuen Projekttypen anlegen',
+  'Create new quotation or order' => 'Neues Angebot oder neuen Auftrag anlegen',
   'Create new qutoation/order'  => 'Neues Angebot/neuen Auftrag anlegen',
   'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
   'Create new version'          => 'Neue Version anlegen',
@@ -1843,6 +1844,7 @@ $self->{texts} = {
   'Record Vendor Invoice'       => 'Einkaufsrechnung erfassen',
   'Record in'                   => 'Buchen auf',
   'Record number'               => 'Belegnummer',
+  'Record type to create'       => 'Anzulegender Belegtyp',
   'Recorded Tax'                => 'Gespeicherte Steuern',
   'Recorded taxkey'             => 'Gespeicherter Steuerschlüssel',
   'Reference'                   => 'Referenz',
index cee29d0..f32e715 100644 (file)
@@ -1,9 +1,27 @@
 [%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE P -%]
-<div>
- [% LxERP.t8("Assign the following article to all sections") %]:
- [% 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') %]
- [% L.button_tag('kivi.requirement_spec.assign_order_part_id_to_all()', LxERP.t8('Assign article')) %]
-</div>
+[% SET style="width: 400px" %]
+
+<table>
+[% IF for_new %]
+ <tr>
+  <td>[% LxERP.t8("Record type to create") %]:</td>
+  <td>[% L.select_tag('quotation', [ [ 1, LxERP.t8('Sales quotation') ], [ 0, LxERP.t8('Sales Order') ] ], style=style, no_id=1) %]</td>
+ </tr>
+
+ <tr>
+  <td>[% LxERP.t8("Customer") %]:</td>
+  <td>[% L.select_tag('customer_id', SELF.all_customers, default=SELF.requirement_spec.customer_id, title_key='name', style=style, no_id=1) %]</td>
+ </tr>
+[% END %]
+
+ <tr>
+  <td>[% LxERP.t8("Assign the following article to all sections") %]:</td>
+  <td>
+   [% 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) %]
+   [% L.button_tag('kivi.requirement_spec.assign_order_part_id_to_all()', LxERP.t8('Assign article')) %]
+  </td>
+ </tr>
+</table>
 
 <form id="quotations_and_orders_article_assignment_form">
  <table style="width: 100%">
@@ -23,7 +41,7 @@
     <td>[% HTML.escape(section.fb_number) %]</td>
     <td>[% HTML.escape(section.title) %]</td>
     <td>[% HTML.escape(P.truncate(section.description)) %]</td>
-    <td>[% L.select_tag('sections[].order_part_id', SELF.all_parts, default=section.order_part_id, with_empty=1, title_sub=\make_part_title, no_id=1) %]</td>
+    <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>
    </tr>
    [% END %]
   </tbody>
diff --git a/templates/webpages/requirement_spec_order/new.html b/templates/webpages/requirement_spec_order/new.html
new file mode 100644 (file)
index 0000000..7aaabd7
--- /dev/null
@@ -0,0 +1,7 @@
+[%- USE LxERP -%][%- USE L -%]
+<div id="quotations_and_orders_new" class="quotations-and-orders-edit-assignment-context-menu">
+ <h2>[% LxERP.t8("Create new quotation or order") %]</h2>
+
+ [% INCLUDE 'requirement_spec_order/_assignment_form.html'
+            for_new=1 %]
+</div>