Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a6ad7d45

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID a6ad7d45c660ea3b7b4a99a5fd3ab5c075555e40
  • Vorgänger c08a8faf
  • Nachfolger a355598b

DispositionManager: Templates und js hinzugefügt

Unterschiede anzeigen:

js/kivi.DispositionManager.js
1
namespace('kivi.DispositionManager', function(ns) {
2
  ns.sort_vendors = function() {
3
    ns.display_vendor_parts($('#vendor_id2').val());
4
    $("tbody tr").each(function(index) {
5
      if ( index !== 0 ) {
6
        $row = $(this);
7
        if( $row.find("select[name='vendor_ids[]']").val() != $('#vendor_id2').val()) {
8
          $row.remove();
9
        }
10
      }
11
    });
12
  }
13

  
14
  ns.display_vendor_parts = function(vendor_id) {
15
    var url = 'controller.pl?action=DispositionManager/show_vendor_items&v_id=' + vendor_id;
16
    $('#vendor_parts').load(url);
17
  }
18

  
19
  ns.create_order = function() {
20
    var data = $('#purchasebasket').serializeArray();
21
    data.push({ name: 'action', value: 'DispositionManager/transfer_to_purchase_order' });
22
    $.post("controller.pl", data, kivi.eval_json_result);
23
  }
24

  
25
  ns.delete_purchase_basket_items = function() {
26
    var data = $('#purchasebasket').serializeArray();
27
    data.push({
28
      name:  'action',
29
      value: 'DispositionManager/delete_purchase_basket_items' });
30
    $.post("controller.pl", data, kivi.eval_json_result);
31
  }
32

  
33
  ns.show_detail_dialog = function(part_id,partnumber) {
34
    if ( part_id && partnumber ) {
35
        var title  = kivi.t8('Details of article number "#1"',[partnumber]);
36
        kivi.popup_dialog({
37
                         url:     'controller.pl',
38
                         data: {
39
                                 action: 'Part/showdetails',
40
                                 id    : part_id,
41
                               },
42
                         id:     'detail_menu',
43
                         dialog: { title: title
44
                                  , width:  1000
45
                                  , height: 450
46
                                  , modal:  false }
47
                        });
48
    }
49
    return true;
50
  };
51
});
templates/webpages/disposition_manager/_show_vendor_parts.html
1
[%- USE HTML -%]
2
[%- USE LxERP -%]
3
[%- USE L -%]
4
[%- USE T8 -%]
5
[%- USE P -%]
6

  
7
<h2>[% 'All parts of vendor odered by onhand' | $T8 %]</h2>
8
<table width="100%">
9
    <thead>
10
     <tr class="listheading">
11
       <th>[% 'Purchase basket' | $T8 %] </th>
12
       <th>[% 'Partnumber'      | $T8 %] </th>
13
       <th>[% 'Description'     | $T8 %] </th>
14
       <th>[% 'Onhand'          | $T8 %] </th>
15
       <th>[% 'Ordered purchase'| $T8 %] </th>
16
       <th>[% 'Rop'             | $T8 %] </th>
17
       <th>[% 'Order quantity'  | $T8 %] </th>
18
       <th>[% 'Vendor'          | $T8 %] </th>
19
     </tr>
20
    </thead>
21
    <tbody>
22
    [% FOREACH makemodel_item = MAKEMODEL_ITEMS %]
23

  
24
      <tr class="listrow">
25
        <td>[% L.checkbox_tag('vendor_part_ids[+]',
26
                 checked='0', value=makemodel_item.id) %]</td>
27
        <td>[% makemodel_item.presenter.part(target = '_blank') %]
28
          [% P.button_tag(
29
               "kivi.DispositionManager.show_detail_dialog("
30
                 _  makemodel_item.id _ "," _ makemodel_item.partnumber _
31
               ")",
32
               LxERP.t8('Details (one letter abbreviation)'),
33
               title=LxERP.t8('Article details'), class="button") %]
34
        </td>
35
        <td>[% HTML.escape(makemodel_item.description) %]</td>
36
        <td class="numeric">[% makemodel_item.onhand_as_number %]</td>
37
        <td class="numeric">[% LxERP.format_amount(makemodel_item.get_open_ordered_qty, 2) %]</td>
38
        <td class="numeric">[% makemodel_item.rop_as_number %]</td>
39
        <td class="numeric">[% makemodel_item.order_qty_as_number %]</td>
40
        <td>[% P.part.vendor_price_dropdown(
41
                 'vendor_ids[]', makemodel_item,
42
                 default=makemodel_item.makemodels.item(0).make,
43
                 style='width: 350px;'
44
                 ) %]
45
        </td>
46
      </tr>
47
    [% END %]
48
    </tbody>
49
</table>
templates/webpages/disposition_manager/list_parts.html
1
[%- USE HTML -%]
2
[%- USE LxERP -%]
3
[%- USE L -%]
4
[%- USE T8 -%]
5

  
6
[%- INCLUDE 'common/flash.html' %]
7
<hr>
8
<h2>[% 'Short onhand' | $T8 %]</h2>
9
<div style="margin:1em;">
10
<form id="form">
11
  <table width="100%">
12
    <thead>
13
     <tr class="listheading">
14
       <th>
15
         [% L.checkbox_tag('check_all', checkall='[data-checkall=1]') %]
16
         [% 'Purchase basket' | $T8 %]
17
       </th>
18
       <th>[% 'Partnumber'                                      | $T8 %] </th>
19
       <th>[% 'Description'                                     | $T8 %] </th>
20
       <th>[% 'Vendor'                                          | $T8 %] </th>
21
       <th>[% 'Onhand'                                          | $T8 %] </th>
22
       <th>[% 'Rop'                                             | $T8 %] </th>
23
       <th>[% 'Minimum order quantity'                          | $T8 %] </th>
24
     </tr>
25
    </thead>
26
    [% FOREACH part = PARTS %]
27
      [% IF !part.get_open_ordered_qty %]
28
      <tr class="listrow">
29
        <td>
30
          [% IF part.makemodels.size %]
31
            [% L.checkbox_tag('ids[+]', 'data-checkall'=1,
32
                 checked = '1', value=part.id) %]
33
          [% ELSE %]
34
            [% 'No Vendor' | $T8 %]
35
          [% END %]
36
        </td>
37
        <td>[% HTML.escape(part.partnumber) %]</td>
38
        <td>[% HTML.escape(part.description) %]</td>
39
        <td>[% P.part.vendor_price_dropdown(
40
                 'vendor_ids[]', part,
41
                 default=part.makemodels.item(0).make,
42
                 style='width: 350px;'
43
                 ) %]
44
        </td>
45
        <td class="numeric">[% LxERP.format_amount(part.onhandqty, 2) %]</td>
46
        <td class="numeric">[% part.rop_as_number %]</td>
47
        <td class="numeric">[% part.order_qty_as_number %]</td>
48
      </tr>
49
      [% END %]
50
    [% END %]
51
  </table>
52
</form>
53
<hr>
54
</div>
templates/webpages/disposition_manager/reorder_level_list/report_bottom.html
1
[% USE L %]
2
[%- L.paginate_controls(models=SELF.models)  %]
templates/webpages/disposition_manager/show_purchase_basket.html
1
[%- USE HTML -%]
2
[%- USE LxERP -%]
3
[%- USE L -%]
4
[%- USE T8 -%]
5
[%- USE P -%]
6

  
7
[%- INCLUDE 'common/flash.html' %]
8
<h1>[% title %]</h1>
9
<form id="purchasebasket" style="margin:1em;">
10
  <div>
11
    <p>
12
      [% 'Vendor' | $T8 %]:
13
      [% P.customer_vendor.picker('vendor_id2', FORM.vendor_id2, type='vendor') %]
14
    </p>
15
  </div>
16
<div>
17
  <table id="baskettable" width="100%">
18
    <thead>
19
     <tr class="listheading">
20
       <th>
21
         [% L.checkbox_tag("", id="check_all", checkall="[data-checkall=1]") %]
22
         [% 'Purchase basket' | $T8 %]
23
       </th>
24
       <th>[% 'Partnumber'                                      | $T8 %] </th>
25
       <th>[% 'Description'                                     | $T8 %] </th>
26
       <th>[% 'Onhand'                                          | $T8 %] </th>
27
       <th>[% 'Rop'                                             | $T8 %] </th>
28
       <th>[% 'Order quantity'                                  | $T8 %] </th>
29
       <th>[% 'Vendor'                                          | $T8 %] </th>
30
     </tr>
31
    </thead>
32
    <tbody>
33
    [% FOREACH basket_item = BASKET_ITEMS %]
34

  
35
      <tr class="listrow">
36
        <td>[% L.checkbox_tag('ids[+]', "data-checkall"=1, checked = '1',  value=basket_item.id) %] [% HTML.escape(basket_item.part.partsgroup.partsgroup) %]
37
            [% L.hidden_tag('partsgroup_ids[]', basket_item.part.partsgroup_id ) %]
38
        </td>
39
        <td> [% basket_item.part.presenter.part(target = '_blank') %]
40
          [% P.button_tag(
41
               "kivi.DispositionManager.show_detail_dialog("
42
                 _  basket_item.part.id _ "," _ basket_item.part.partnumber _
43
               ")",
44
               LxERP.t8('Details (one letter abbreviation)'),
45
               title=LxERP.t8('Article details'), class="button") %]
46
        </td>
47
        <td>[% HTML.escape(basket_item.part.description) %]</td>
48
        <td class="numeric">[% basket_item.part.onhand_as_number %]</td>
49
        <td class="numeric">[% basket_item.part.rop_as_number %]</td>
50
        <td class="numeric">[% basket_item.qty_as_number %]</td>
51
        <td>[% P.part.vendor_price_dropdown(
52
                 'vendor_ids[]', basket_item.part,
53
                 default=basket_item.part.makemodels.item(0).make,
54
                 style='width: 350px;'
55
                 ) %]
56
        </td>
57
      </tr>
58
    [% END %]
59
    </tbody>
60
  </table>
61
</div>
62
<hr>
63

  
64
<div id="vendor_parts"></div>
65
</form>
66
<hr>
67
<script type="text/javascript">
68
<!--
69

  
70
 $('#vendor_id2').change('set_item:CustomerVendorPicker', function(e,o) {
71
   kivi.DispositionManager.sort_vendors();
72
 })
73
-->
74
</script>

Auch abrufbar als: Unified diff