]> wagnertech.de Git - mfinanz.git/blobdiff - templates/webpages/order/tabs/basic_data.html
Auftrags-Controller: Bemerkungen und interne Bemerkungen
[mfinanz.git] / templates / webpages / order / tabs / basic_data.html
index 3bc64558e3d432e3ddfc9e30e47536d9d977131b..64d73eae24b2eb128ac0f55e9533752f928c5db0 100644 (file)
               title_key='safe_name') %]</td>
           </tr>
 
+          [% IF SELF.cv == 'customer' %]
+          <tr>
+            <th align="right">[% 'Salesman' | $T8 %]</th>
+            <td>[% L.select_tag('order.employee_id',
+              SELF.all_employees,
+              default=(SELF.order.salesman_id ? SELF.order.salesman_id : SELF.current_employee_id),
+              title_key='safe_name') %]</td>
+          </tr>
+          [% END %]
+
           <tr>
             <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
             <td>[% L.input_tag('order.ordnumber', SELF.order.ordnumber, size = 11) %]</td>
           </tr>
 
+          <tr>
+            <th width="70%" align="right" nowrap>[% 'Quotation Number' | $T8 %]</th>
+            <td>[% L.input_tag('order.quonumber', SELF.order.quonumber, size = 11) %]</td>
+          </tr>
+
           <tr>
             <th width="70%" align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
             <td>[% L.input_tag('order.cusordnumber', SELF.order.cusordnumber, size = 11) %]</td>
             <td>[% L.date_tag('order.transdate', SELF.order.transdate) %]</td>
           </tr>
 
+          <tr>
+            <th width="70%" align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
+            <td>[% SELF.order.itime_as_date %]</td>
+          </tr>
+
           <tr>
             <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
             <td>[%- L.select_tag('order.globalproject_id', SELF.all_projects, default=SELF.order.globalproject_id, title_key='projectnumber', with_empty = 1) %]</td>
   <table width="100%">
     <tr>
       <td>
-        <table id="row_table_id" width="100%">
-          <thead>
-            <tr class="listheading">
-              <th class="listheading" style='display:none'></th>
-              <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
-              <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
-              <th class="listheading" nowrap width="15">[%- 'Partnumber'  | $T8 %] </th>
-              <th class="listheading" nowrap           >[%- 'Description'  | $T8 %] </th>
-              <th class="listheading" nowrap width="5" >[%- 'Qty'          | $T8 %] </th>
-              <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
-              <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
-              <th class="listheading" nowrap width="15">[%- 'Price'        | $T8 %] </th>
-              <th class="listheading" nowrap width="5" >[%- 'Discount'     | $T8 %] </th>
-              <th class="listheading" nowrap width="10">[%- 'Extended'     | $T8 %] </th>
-            </tr>
-          </thead>
-
-          <tbody>
+
+        <div id="row_table_scroll_id" style="overflow-y: auto; height: 45vh;">
+          <table id="row_table_id" width="100%">
+            <thead>
+              <tr class="listheading">
+                <th class="listheading" style='display:none'></th>
+                <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
+                <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
+                <th class="listheading" nowrap width="15">[%- 'Partnumber'  | $T8 %] </th>
+                <th class="listheading" nowrap           >[%- 'Description'  | $T8 %] </th>
+                <th class="listheading" nowrap width="5" >[%- 'Qty'          | $T8 %] </th>
+                <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
+                <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
+                <th class="listheading" nowrap width="15">[%- 'Price'        | $T8 %] </th>
+                <th class="listheading" nowrap width="5" >[%- 'Discount'     | $T8 %] </th>
+                <th class="listheading" nowrap width="10">[%- 'Extended'     | $T8 %] </th>
+              </tr>
+            </thead>
+
             [%- FOREACH item = SELF.order.items_sorted %]
               [%- PROCESS order/tabs/_row.html ITEM=item %]
             [%- END %]
-          </tbody>
 
-        </table>
+          </table>
+        </div>
+
       </td>
     </tr>
 
     </tr>
 
     <tr>
-      <td align="right">
-        <table>
-          [%- IF NOT taxincluded %]
+      <td colspan="100%" width="100%">
+        <table width="100%">
           <tr>
-            <th align="right">[%- 'Subtotal' | $T8 %]</th>
-            <td align="right">
-              [%- L.div_tag(SELF.order.netamount_as_number, id='netamount_id') %]
+            <td>
+              <table>
+                <tr>
+                  <th align="left">[% 'Notes' | $T8 %]</th>
+                  <th align="left">[% 'Internal Notes' | $T8 %]</th>
+                </tr>
+                <tr valign="top">
+                  <td>
+                    [% L.textarea_tag('order.notes', SELF.order.notes, wrap="soft", style="width: 350px; height: 150px;", class="texteditor") %]
+                  </td>
+                  <td>
+                    [% L.textarea_tag('order.intnotes', SELF.order.intnotes, wrap="soft", style="width: 350px; height: 150px;") %]
+                  </td>
+                </tr>
+              </table>
             </td>
-          </tr>
-          [%- END %]
-          [%- FOREACH tax = SELF.taxes %]
-            [%- PROCESS order/tabs/_tax_row.html TAX=tax %]
-          [%- END %]
-          <tr id="amount_row_id">
-            <th align="right">[%- 'Total' | $T8 %]</th>
+
+            <td>
+              <table>
+                <tr>
+                  <th align="right">[% 'Payment Terms' | $T8 %]</th>
+                  <td>[% L.select_tag('order.payment_id',
+                                      SELF.all_payment_terms,
+                                      default = SELF.order.payment_id,
+                                      with_empty = 1,
+                                      title_key = 'description',
+                                      style = 'width: 250px;') %]</td>
+                </tr>
+                <tr>
+                  <th align="right">[% 'Delivery Terms' | $T8 %]</th>
+                  <td>[% L.select_tag('order.delivery_term_id',
+                                      SELF.all_delivery_terms,
+                                      default = SELF.order.delivery_term_id,
+                                      with_empty = 1,
+                                      title_key = 'description',
+                                      style = 'width: 250px;') %]</td>
+                </tr>
+              </table>
+            </td>
+
             <td align="right">
-              [%- L.div_tag(SELF.order.amount_as_number, id='amount_id') %]
+              <table>
+                [%- IF NOT taxincluded %]
+                <tr>
+                  <th align="right">[%- 'Subtotal' | $T8 %]</th>
+                  <td align="right">
+                    [%- L.div_tag(SELF.order.netamount_as_number, id='netamount_id') %]
+                  </td>
+                </tr>
+                [%- END %]
+                [%- FOREACH tax = SELF.taxes %]
+                  [%- PROCESS order/tabs/_tax_row.html TAX=tax %]
+                [%- END %]
+                <tr id="amount_row_id">
+                  <th align="right">[%- 'Total' | $T8 %]</th>
+                  <td align="right">
+                    [%- L.div_tag(SELF.order.amount_as_number, id='amount_id') %]
+                </tr>
+              </table>
+            </td>
+
           </tr>
         </table>
       </td>
 </div>
 
 
-[% L.sortable_element('#row_table_id tbody') %]
+[% L.sortable_element('#row_table_id') %]
 
 <script type='text/javascript'>
 function reload_cv_dependend_selections() {
@@ -180,6 +249,8 @@ function reload_cv_dependend_selections() {
 }
 
 function add_item() {
+  if ($('#add_item_parts_id').val() == '') return;
+
   var data = $('#order_form').serialize();
   data += '&action=Order/add_item';
   data += '&type=' + $('#type').val();
@@ -188,10 +259,10 @@ function add_item() {
 }
 
 function delete_order_item_row(clicked) {
-  var row = $(clicked).parents("tr").first();
+  var row = $(clicked).parents("tbody").first();
   $(row).remove();
 
-  recalc_amounts_and_taxes()
+  recalc_amounts_and_taxes();
 }
 
 function recalc_amounts_and_taxes() {
@@ -202,10 +273,47 @@ function recalc_amounts_and_taxes() {
   $.post("controller.pl", data, kivi.eval_json_result);
 }
 
-function display_linetotal(item_id, amount) {
-  $('#item_' + item_id).parents("tr").first().find('[name="linetotal"]').html(amount);
+function redisplay_linetotals(data) {
+  $('.row_entry [name="linetotal"]').each(function(idx, elt) {
+    $(elt).html(data[idx]);    
+  });
 }
 
+function row_table_scroll_down() {
+  $('#row_table_scroll_id').scrollTop($('#row_table_scroll_id')[0].scrollHeight);
+}
+
+function row_set_keyboard_events_by_id(item_id) {
+  var row = $('#item_' + item_id).parents("tbody").first();
+
+  row_set_keyboard_events(row);
+}
+
+function row_set_keyboard_events(rows) {
+  $(rows).keydown(function(event) {
+    if(event.keyCode == 40 && event.shiftKey == true) {
+      // shift arrow down
+      event.preventDefault();
+      var row = $(event.target).parents(".row_entry").first();
+      $(row).children().not(':first').show();
+      return false;
+    }
+    if(event.keyCode == 38 && event.shiftKey == true) {
+      // shift arrow up
+      event.preventDefault();
+      var row = $(event.target).parents(".row_entry").first();
+      $(row).children().not(':first').hide();
+      return false;
+    }
+  });
+
+  $(rows).dblclick(function(event) {
+      event.preventDefault();
+      var row = $(event.target).parents(".row_entry").first();
+      $(row).children().not(':first').toggle();
+      return false;
+  });
+}
 
 $(function(){
   $('#order_[%- cv_id %]').change(reload_cv_dependend_selections);
@@ -218,6 +326,8 @@ $(function(){
       return false;
     }
   });
+  row_set_keyboard_events($('.row_entry'));
+  $('.recalc').change(recalc_amounts_and_taxes);
 });
 
 </script>