Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0aa885f4

Von Sven Schöling vor etwa 7 Jahren hinzugefügt

  • ID 0aa885f4f0bb531a7691a641f954ff296ffa04a5
  • Vorgänger 6ef53d3f
  • Nachfolger 9c29f718

Presenter: Neue Struktur in Belegen umgesetzt

Unterschiede anzeigen:

SL/Controller/Order.pm
4 4
use parent qw(SL::Controller::Base);
5 5

  
6 6
use SL::Helper::Flash qw(flash_later);
7
use SL::Presenter;
7
use SL::Presenter::Tag qw(select_tag);
8 8
use SL::Locale::String qw(t8);
9 9
use SL::SessionFile::Random;
10 10
use SL::PriceSource;
......
771 771
sub build_contact_select {
772 772
  my ($self) = @_;
773 773

  
774
  $self->p->select_tag('order.cp_id', [ $self->order->{$self->cv}->contacts ],
775
                       value_key  => 'cp_id',
776
                       title_key  => 'full_name_dep',
777
                       default    => $self->order->cp_id,
778
                       with_empty => 1,
779
                       style      => 'width: 300px',
774
  select_tag('order.cp_id', [ $self->order->{$self->cv}->contacts ],
775
    value_key  => 'cp_id',
776
    title_key  => 'full_name_dep',
777
    default    => $self->order->cp_id,
778
    with_empty => 1,
779
    style      => 'width: 300px',
780 780
  );
781 781
}
782 782

  
......
786 786
sub build_shipto_select {
787 787
  my ($self) = @_;
788 788

  
789
  $self->p->select_tag('order.shipto_id', [ $self->order->{$self->cv}->shipto ],
790
                       value_key  => 'shipto_id',
791
                       title_key  => 'displayable_id',
792
                       default    => $self->order->shipto_id,
793
                       with_empty => 1,
794
                       style      => 'width: 300px',
789
  select_tag('order.shipto_id', [ $self->order->{$self->cv}->shipto ],
790
    value_key  => 'shipto_id',
791
    title_key  => 'displayable_id',
792
    default    => $self->order->shipto_id,
793
    with_empty => 1,
794
    style      => 'width: 300px',
795 795
  );
796 796
}
797 797

  
SL/DB/DeliveryOrderItem.pm
43 43

  
44 44
  $dec //= 2;
45 45

  
46
  return SL::Presenter->get->sales_delivery_order($self->delivery_order, display => 'inline')
46
  $self->delivery_order->presenter->sales_delivery_order(display => 'inline')
47 47
         . " " . $::form->format_amount(\%::myconfig, $self->qty, $dec) . " " . $self->unit
48 48
         . " (" . $self->delivery_order->transdate->to_kivitendo . ")";
49 49
};
SL/DB/GLTransaction.pm
46 46
  my ($self) = @_;
47 47

  
48 48
  my $html;
49
  $html   = SL::Presenter->get->gl_transaction($self, display => 'inline');
49
  $html   = $self->presenter->gl_transaction(display => 'inline');
50 50

  
51 51
  return $html;
52 52
}
SL/DB/Invoice.pm
578 578
  my ($self) = @_;
579 579

  
580 580
  my $html;
581
  $html   = SL::Presenter->get->sales_invoice($self, display => 'inline') if $self->invoice;
582
  $html   = SL::Presenter->get->ar_transaction($self, display => 'inline') if !$self->invoice;
581
  $html   = $self->presenter->sales_invoice(display => 'inline') if $self->invoice;
582
  $html   = $self->presenter->ar_transaction(display => 'inline') if !$self->invoice;
583 583

  
584 584
  return $html;
585 585
}
SL/DB/PurchaseInvoice.pm
99 99
  my ($self) = @_;
100 100

  
101 101
  my $html;
102
  $html   = SL::Presenter->get->purchase_invoice($self, display => 'inline') if $self->invoice;
103
  $html   = SL::Presenter->get->ap_transaction($self, display => 'inline') if !$self->invoice;
102
  $html   = $self->presenter->purchase_invoice(display => 'inline') if $self->invoice;
103
  $html   = $self->presenter->ap_transaction(display => 'inline') if !$self->invoice;
104 104

  
105 105
  return $html;
106 106
}
SL/IR.pm
50 50
use SL::DB::Default;
51 51
use SL::DB::TaxZone;
52 52
use SL::DB;
53
use SL::Presenter::Part qw(type_abbreviation classification_abbreviation);
53 54
use List::Util qw(min);
54 55

  
55 56
use strict;
......
1309 1310
    if (($::form->{"partnumber_$i"} ne '') && ($ref->{ean} eq $::form->{"partnumber_$i"})) {
1310 1311
      push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean};
1311 1312
    }
1312
    $ref->{type_and_classific} = $::request->presenter->type_abbreviation($ref->{part_type}).
1313
                                 $::request->presenter->classification_abbreviation($ref->{classification_id});
1313
    $ref->{type_and_classific} = type_abbreviation($ref->{part_type}) .
1314
                                 classification_abbreviation($ref->{classification_id});
1314 1315

  
1315 1316
    if (! $ref->{used_for_purchase} ) {
1316 1317
       $has_wrong_pclass = PCLASS_NOTFORPURCHASE;
SL/IS.pm
57 57
use SL::DB::TaxZone;
58 58
use SL::TransNumber;
59 59
use SL::DB;
60
use SL::Presenter::Part qw(type_abbreviation classification_abbreviation);
60 61
use Data::Dumper;
61 62

  
62 63
use strict;
......
2353 2354
      push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean};
2354 2355
    }
2355 2356

  
2356
    $ref->{type_and_classific} = $::request->presenter->type_abbreviation($ref->{part_type}).
2357
                                 $::request->presenter->classification_abbreviation($ref->{classification_id});
2357
    $ref->{type_and_classific} = type_abbreviation($ref->{part_type}) .
2358
                                 classification_abbreviation($ref->{classification_id});
2358 2359
    if (! $ref->{used_for_sale} ) {
2359 2360
      $has_wrong_pclass = PCLASS_NOTFORSALE ;
2360 2361
      next;
bin/mozilla/io.pl
53 53
use SL::IO;
54 54
use SL::File;
55 55
use SL::PriceSource;
56
use SL::Presenter::Part;
56 57

  
57 58
use SL::DB::Contact;
58 59
use SL::DB::Customer;
......
308 309

  
309 310

  
310 311
    $column_data{partnumber}    = $cgi->textfield(-name => "partnumber_$i",    -id => "partnumber_$i",    -size => 12, -value => $form->{"partnumber_$i"});
311
    $column_data{type_and_classific} = $::request->presenter->type_abbreviation($form->{"part_type_$i"}).
312
                                       $::request->presenter->classification_abbreviation($form->{"classification_id_$i"}) if $form->{"id_$i"};
312
    $column_data{type_and_classific} = SL::Presenter::Part::type_abbreviation($form->{"part_type_$i"}).
313
                                       SL::Presenter::Part::classification_abbreviation($form->{"classification_id_$i"}) if $form->{"id_$i"};
313 314
    $column_data{description} = (($rows > 1) # if description is too large, use a textbox instead
314 315
                                ? $cgi->textarea( -name => "description_$i", -id => "description_$i", -default => $form->{"description_$i"}, -rows => $rows, -columns => 30)
315 316
                                : $cgi->textfield(-name => "description_$i", -id => "description_$i",   -value => $form->{"description_$i"}, -size => 30))
templates/webpages/ap/form_header.html
1 1
[%- USE L %]
2
[%- USE P %]
2 3
[%- USE HTML %]
3 4
[%- USE T8 %]
4 5
[%- USE LxERP %][%- USE P -%]
......
82 83
              <tr>
83 84
                <th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
84 85
                <td colspan="3">
85
                 [% P.customer_vendor_picker("vendor_id", vendor_id, type="vendor", style="width: 300px", onchange="\$('#update_button').click()") %]
86
                 [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", style="width: 300px", onchange="\$('#update_button').click()") %]
86 87
                 [% L.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)')) %]
87 88
                 [% L.hidden_tag("previous_vendor_id", vendor_id) %]
88 89
                </td>
......
188 189
          <tr>
189 190
            <td>
190 191
              [% SET selected_chart_id = "AP_amount_chart_id_"_ i %]
191
              [% P.chart_picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
192
              [% P.chart.picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
192 193
              [% L.hidden_tag("previous_AP_amount_chart_id_" _ i, $selected_chart_id) %]
193 194
              <input type="hidden" name="tax_[% i %]" value="[% temp = "tax"_ i %][% $temp | html %]">
194 195
            </td>
......
217 218
        </tr>
218 219
        <tr>
219 220
          <td>
220
            [% P.chart_picker('AP_chart_id', AP_chart_id, style="width: 400px", type="AP") %]
221
            [% P.chart.picker('AP_chart_id', AP_chart_id, style="width: 400px", type="AP") %]
221 222
          </td>
222 223
          <th align="left">[% invtotal | html %]</th>
223 224
          <td colspan="4"></td>
templates/webpages/ap/search.html
37 37
     </tr>
38 38
     <tr>
39 39
      <th align="right">[% 'Project Number' | $T8 %]</th>
40
      <td>[% P.project_picker("project_id", project_id, style=style) %]</td>
40
      <td>[% P.project.picker("project_id", project_id, style=style) %]</td>
41 41
      <th align="right">[% 'Part Number' | $T8 %]</th>
42 42
      <td>[% L.input_tag("parts_partnumber", "", style=style) %]</td>
43 43
     </tr>
templates/webpages/ar/form_header.html
47 47
              <tr>
48 48
                <th align="right" nowrap>[% 'Customer' | $T8 %]</th>
49 49
                <td colspan=3>
50
                 [% P.customer_vendor_picker("customer_id", customer_id, type="customer", style="width: 300px", class=(initial_focus == 'customer_id' ? "initial_focus" : ""), onchange="\$('#update_button').click()") %]
50
                 [% P.customer_vendor.picker("customer_id", customer_id, type="customer", style="width: 300px", class=(initial_focus == 'customer_id' ? "initial_focus" : ""), onchange="\$('#update_button').click()") %]
51 51
                 [% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %]
52 52
                 [% L.hidden_tag("previous_customer_id", customer_id) %]
53 53
                 [% L.hidden_tag('terms', terms) %]
......
181 181
          </td>
182 182
        </tr>
183 183
        <tr>
184
          <td>[% P.chart_picker("AR_chart_id", AR_chart_id, style="width: 400px", type="AR") %]</td>
184
          <td>[% P.chart.picker("AR_chart_id", AR_chart_id, style="width: 400px", type="AR") %]</td>
185 185
          <th align=left>[% LxERP.format_amount(invtotal, 2) | html %]</th>
186 186

  
187 187
          <input type=hidden name=oldinvtotal value='[% oldinvtotal %]'>
templates/webpages/ar/search.html
56 56
     </tr>
57 57
     <tr>
58 58
      <th align="right">[% 'Project Number' | $T8 %]</th>
59
      <td>[% P.project_picker("project_id", project_id, style=style) %]</td>
59
      <td>[% P.project.picker("project_id", project_id, style=style) %]</td>
60 60
     </tr>
61 61
    [% IF ALL_BUSINESS_TYPES.as_list.size > 0 %]
62 62
     <tr>
templates/webpages/do/form_header.html
136 136
          [% P.hidden_tag(vc_id, $vc_id) %]
137 137
          [% HTML.escape(VC_OBJ.name) %]
138 138
         [% ELSE %]
139
          [% P.customer_vendor_picker(vc_id, $vc_id, type=vc, class="fixed_width", onchange="\$('#update_button').click()") %]
139
          [% P.customer_vendor.picker(vc_id, $vc_id, type=vc, class="fixed_width", onchange="\$('#update_button').click()") %]
140 140
         [% END %]
141 141
         [% P.hidden_tag("previous_" _ vc_id, $vc_id) %]
142 142
         [% P.button_tag("show_vc_details('" _ HTML.escape(vc) _ "')", LxERP.t8("Details (one letter abbreviation)")) %]
templates/webpages/ir/form_header.html
51 51
        <tr>
52 52
          <th align="right">[% 'Vendor' | $T8 %]</th>
53 53
          <td>
54
           [% P.customer_vendor_picker("vendor_id", vendor_id, type="vendor", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
54
           [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
55 55
           [% P.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)')) %]
56 56
           [% P.hidden_tag("previous_vendor_id", vendor_id) %]
57 57
          </td>
......
181 181
        </tr>
182 182
        <tr>
183 183
          <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
184
          <td>[% P.project_picker('globalproject_id', globalproject_id) %]</td>
184
          <td>[% P.project.picker('globalproject_id', globalproject_id) %]</td>
185 185
        </tr>
186 186
      </table>
187 187
    </td>
templates/webpages/is/form_header.html
54 54
        <tr>
55 55
          <th align="right">[% 'Customer' | $T8 %]</th>
56 56
          <td>
57
           [% P.customer_vendor_picker("customer_id", customer_id, type="customer", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
57
           [% P.customer_vendor.picker("customer_id", customer_id, type="customer", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
58 58
           [% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %]
59 59
           [% L.hidden_tag("previous_customer_id", customer_id) %]
60 60
           [% L.hidden_tag("customer_pricegroup_id", customer_pricegroup_id) %]
templates/webpages/oe/form_header.html
60 60
                    <th align="right">[% IF vc == 'customer' %][% 'Customer' | $T8 %][% ELSE %][% 'Vendor' | $T8 %][% END %]</th>
61 61
                    <td>
62 62
                     [%- SET vc_id = vc _ "_id" %]
63
                     [% P.customer_vendor_picker(vc_id, $vc_id, type=vc, style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
63
                     [% P.customer_vendor.picker(vc_id, $vc_id, type=vc, style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
64 64
                     [% P.button_tag("show_vc_details('" _ HTML.escape(vc) _  "')", LxERP.t8("Details (one letter abbreviation)")) %]
65 65
                     [% P.hidden_tag("previous_" _ vc_id, $vc_id) %]
66 66
                    </td>
templates/webpages/oe/search.html
65 65
    </tr>
66 66
    <tr>
67 67
     <th align="right">[% 'Project' | $T8 %]</th>
68
     <td>[% P.project_picker("project_id", '', style=style) %]</td>
68
     <td>[% P.project.picker("project_id", '', style=style) %]</td>
69 69

  
70 70
     <th align="right">[% 'Part Number' | $T8 %]</th>
71 71
     <td>[% L.input_tag("parts_partnumber", "", style=style) %]</td>
templates/webpages/order/tabs/_item_input.html
1
[%- USE T8 %][%- USE HTML %][%- USE LxERP %][%- USE L %]
1
[%- USE T8 %][%- USE HTML %][%- USE LxERP %][%- USE L %][%- USE P %]
2 2

  
3 3
 <div>
4 4
  <table id="input_row_table_id">
......
14 14
    </thead>
15 15
    <tbody>
16 16
      <tr valign="top" class="listrow">
17
        <td>[% L.part_picker('add_item.parts_id', '', fat_set_item=1, style='width: 300px', class="add_item_input") %]</td>
17
        <td>[% P.part.picker('add_item.parts_id', '', fat_set_item=1, style='width: 300px', class="add_item_input") %]</td>
18 18
        <td>[% L.input_tag('add_item.description', '', class="add_item_input") %]</td>
19 19
        <td>
20 20
          [% L.input_tag('add_item.qty_as_number', '', size = 5, class="add_item_input numeric") %]
templates/webpages/order/tabs/_row.html
35 35
      <div name="partnumber">[% HTML.escape(ITEM.part.partnumber) %]</div>
36 36
    </td>
37 37
    <td>
38
      <div name="partclassification">[% P.typeclass_abbreviation(ITEM.part) %]</div>
38
      <div name="partclassification">[% ITEM.part.presenter.typeclass_abbreviation %]</div>
39 39
    </td>
40 40
    <td>
41 41
      [% L.areainput_tag("order.orderitems[].description",
templates/webpages/order/tabs/_second_row.html
2 2
[%- USE HTML %]
3 3
[%- USE LxERP %]
4 4
[%- USE L %]
5
[%- USE P %]
5 6

  
6 7
<table>
7 8
  <tr><td colspan="100%">
8 9
    <b>[%- 'Serial No.' | $T8 %]</b>&nbsp;
9 10
    [%- L.input_tag("order.orderitems[].serialnumber", ITEM.serialnumber, size = 15) %]&nbsp;
10 11
    <b>[%- 'Project' | $T8 %]</b>&nbsp;
11
    [% L.project_picker("order.orderitems[].project_id", ITEM.project_id, size = 15) %]&nbsp;
12
    [% P.project.picker("order.orderitems[].project_id", ITEM.project_id, size = 15) %]&nbsp;
12 13
    <b>[%- 'Reqdate' | $T8 %]</b>&nbsp;
13 14
    [% L.date_tag("order.orderitems[].reqdate", ITEM.reqdate) %]&nbsp;
14 15
    <b>[%- 'Subtotal' | $T8 %]</b>&nbsp;
templates/webpages/order/tabs/basic_data.html
2 2
[%- USE HTML %]
3 3
[%- USE LxERP %]
4 4
[%- USE L %]
5
[%- USE P %]
5 6

  
6 7
[%- INCLUDE 'generic/set_longdescription.html' %]
7 8

  
......
13 14
          <tr>
14 15
            <th align="right">[% SELF.cv | $T8 %]</th>
15 16
            [% SET cv_id = SELF.cv _ '_id' %]
16
            <td>[% L.customer_vendor_picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %]</td>
17
            <td>[% P.customer_vendor.picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %]</td>
17 18
          </tr>
18 19

  
19 20
          <tr id='cp_row' [%- IF !SELF.order.${SELF.cv}.contacts.size %]style='display:none'[%- END %]>
......
69 70

  
70 71
          <tr>
71 72
            <th align="right">[% 'Project Number' | $T8 %]</th>
72
            <td>[% L.project_picker('order.globalproject_id', SELF.order.globalproject_id, style='width: 300px') %]</td>
73
            <td>[% P.project.picker('order.globalproject_id', SELF.order.globalproject_id, style='width: 300px') %]</td>
73 74
          </tr>
74 75

  
75 76
        </table>
templates/webpages/order_items_search/_order_item_list.html
21 21
 </tr>
22 22
 [% FOREACH order_item = SELF.orderitems %]
23 23
 <tr id="tr_[% loop.count %]" class="listrow[% loop.count % 2 %]">
24
  <td>                 [% P.part(order_item.part, no_link => 0)               %]</td>
25
  <td>                 [% P.customer(order_item.order.customer, no_link => 0) %]</td>
26
  <td class="numeric"> [% P.sales_order(order_item.order, no_link => 0)       %]</td>
24
  <td>                 [% order_item.part.presenter.part(no_link => 0)               %]</td>
25
  <td>                 [% order_item.order.customer.presenter.customer(no_link => 0) %]</td>
26
  <td class="numeric"> [% order_item.order.presenter.sales_order(no_link => 0)       %]</td>
27 27
  <td>                 [% order_item.order.transdate.to_kivitendo             %]</td>
28 28
  <td class="numeric [% IF order_item.delivered_qty == order_item.qty %]shipped[% ELSE %]not_shipped[% END %]">
29 29
    [% LxERP.format_amount(order_item.qty, qty_round) %] [% order_item.unit | html %]
templates/webpages/order_items_search/order_items.html
2 2
[%- USE LxERP %]
3 3
[%- USE T8 %]
4 4
[%- USE L %]
5
[%- USE P %]
5 6

  
6 7
[% SET size=50 %]
7 8
[% SET show_images=0 %]
......
13 14
 <table>
14 15
  </tr>
15 16
    <td>[% 'Customer' | $T8 %]</td>
16
    <td>[% L.customer_vendor_picker('filter.order.customer.id', FORM.customer_id, type='customer', class="filter", size=size) %]</td>
17
    <td>[% P.customer_vendor.picker('filter.order.customer.id', FORM.customer_id, type='customer', class="filter", size=size) %]</td>
17 18
  </tr>
18 19
  <tr>
19 20
    <td>[% 'Part' | $T8 %]</td>

Auch abrufbar als: Unified diff