use parent qw(SL::Controller::Base);
use SL::Helper::Flash qw(flash_later);
-use SL::Presenter;
+use SL::Presenter::Tag qw(select_tag);
use SL::Locale::String qw(t8);
use SL::SessionFile::Random;
use SL::PriceSource;
sub build_contact_select {
my ($self) = @_;
- $self->p->select_tag('order.cp_id', [ $self->order->{$self->cv}->contacts ],
- value_key => 'cp_id',
- title_key => 'full_name_dep',
- default => $self->order->cp_id,
- with_empty => 1,
- style => 'width: 300px',
+ select_tag('order.cp_id', [ $self->order->{$self->cv}->contacts ],
+ value_key => 'cp_id',
+ title_key => 'full_name_dep',
+ default => $self->order->cp_id,
+ with_empty => 1,
+ style => 'width: 300px',
);
}
sub build_shipto_select {
my ($self) = @_;
- $self->p->select_tag('order.shipto_id', [ $self->order->{$self->cv}->shipto ],
- value_key => 'shipto_id',
- title_key => 'displayable_id',
- default => $self->order->shipto_id,
- with_empty => 1,
- style => 'width: 300px',
+ select_tag('order.shipto_id', [ $self->order->{$self->cv}->shipto ],
+ value_key => 'shipto_id',
+ title_key => 'displayable_id',
+ default => $self->order->shipto_id,
+ with_empty => 1,
+ style => 'width: 300px',
);
}
$dec //= 2;
- return SL::Presenter->get->sales_delivery_order($self->delivery_order, display => 'inline')
+ $self->delivery_order->presenter->sales_delivery_order(display => 'inline')
. " " . $::form->format_amount(\%::myconfig, $self->qty, $dec) . " " . $self->unit
. " (" . $self->delivery_order->transdate->to_kivitendo . ")";
};
my ($self) = @_;
my $html;
- $html = SL::Presenter->get->gl_transaction($self, display => 'inline');
+ $html = $self->presenter->gl_transaction(display => 'inline');
return $html;
}
my ($self) = @_;
my $html;
- $html = SL::Presenter->get->sales_invoice($self, display => 'inline') if $self->invoice;
- $html = SL::Presenter->get->ar_transaction($self, display => 'inline') if !$self->invoice;
+ $html = $self->presenter->sales_invoice(display => 'inline') if $self->invoice;
+ $html = $self->presenter->ar_transaction(display => 'inline') if !$self->invoice;
return $html;
}
my ($self) = @_;
my $html;
- $html = SL::Presenter->get->purchase_invoice($self, display => 'inline') if $self->invoice;
- $html = SL::Presenter->get->ap_transaction($self, display => 'inline') if !$self->invoice;
+ $html = $self->presenter->purchase_invoice(display => 'inline') if $self->invoice;
+ $html = $self->presenter->ap_transaction(display => 'inline') if !$self->invoice;
return $html;
}
use SL::DB::Default;
use SL::DB::TaxZone;
use SL::DB;
+use SL::Presenter::Part qw(type_abbreviation classification_abbreviation);
use List::Util qw(min);
use strict;
if (($::form->{"partnumber_$i"} ne '') && ($ref->{ean} eq $::form->{"partnumber_$i"})) {
push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean};
}
- $ref->{type_and_classific} = $::request->presenter->type_abbreviation($ref->{part_type}).
- $::request->presenter->classification_abbreviation($ref->{classification_id});
+ $ref->{type_and_classific} = type_abbreviation($ref->{part_type}) .
+ classification_abbreviation($ref->{classification_id});
if (! $ref->{used_for_purchase} ) {
$has_wrong_pclass = PCLASS_NOTFORPURCHASE;
use SL::DB::TaxZone;
use SL::TransNumber;
use SL::DB;
+use SL::Presenter::Part qw(type_abbreviation classification_abbreviation);
use Data::Dumper;
use strict;
push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean};
}
- $ref->{type_and_classific} = $::request->presenter->type_abbreviation($ref->{part_type}).
- $::request->presenter->classification_abbreviation($ref->{classification_id});
+ $ref->{type_and_classific} = type_abbreviation($ref->{part_type}) .
+ classification_abbreviation($ref->{classification_id});
if (! $ref->{used_for_sale} ) {
$has_wrong_pclass = PCLASS_NOTFORSALE ;
next;
use SL::IO;
use SL::File;
use SL::PriceSource;
+use SL::Presenter::Part;
use SL::DB::Contact;
use SL::DB::Customer;
$column_data{partnumber} = $cgi->textfield(-name => "partnumber_$i", -id => "partnumber_$i", -size => 12, -value => $form->{"partnumber_$i"});
- $column_data{type_and_classific} = $::request->presenter->type_abbreviation($form->{"part_type_$i"}).
- $::request->presenter->classification_abbreviation($form->{"classification_id_$i"}) if $form->{"id_$i"};
+ $column_data{type_and_classific} = SL::Presenter::Part::type_abbreviation($form->{"part_type_$i"}).
+ SL::Presenter::Part::classification_abbreviation($form->{"classification_id_$i"}) if $form->{"id_$i"};
$column_data{description} = (($rows > 1) # if description is too large, use a textbox instead
? $cgi->textarea( -name => "description_$i", -id => "description_$i", -default => $form->{"description_$i"}, -rows => $rows, -columns => 30)
: $cgi->textfield(-name => "description_$i", -id => "description_$i", -value => $form->{"description_$i"}, -size => 30))
[%- USE L %]
+[%- USE P %]
[%- USE HTML %]
[%- USE T8 %]
[%- USE LxERP %][%- USE P -%]
<tr>
<th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
<td colspan="3">
- [% P.customer_vendor_picker("vendor_id", vendor_id, type="vendor", style="width: 300px", onchange="\$('#update_button').click()") %]
+ [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", style="width: 300px", onchange="\$('#update_button').click()") %]
[% L.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)')) %]
[% L.hidden_tag("previous_vendor_id", vendor_id) %]
</td>
<tr>
<td>
[% SET selected_chart_id = "AP_amount_chart_id_"_ i %]
- [% P.chart_picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
+ [% P.chart.picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
[% L.hidden_tag("previous_AP_amount_chart_id_" _ i, $selected_chart_id) %]
<input type="hidden" name="tax_[% i %]" value="[% temp = "tax"_ i %][% $temp | html %]">
</td>
</tr>
<tr>
<td>
- [% P.chart_picker('AP_chart_id', AP_chart_id, style="width: 400px", type="AP") %]
+ [% P.chart.picker('AP_chart_id', AP_chart_id, style="width: 400px", type="AP") %]
</td>
<th align="left">[% invtotal | html %]</th>
<td colspan="4"></td>
</tr>
<tr>
<th align="right">[% 'Project Number' | $T8 %]</th>
- <td>[% P.project_picker("project_id", project_id, style=style) %]</td>
+ <td>[% P.project.picker("project_id", project_id, style=style) %]</td>
<th align="right">[% 'Part Number' | $T8 %]</th>
<td>[% L.input_tag("parts_partnumber", "", style=style) %]</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Customer' | $T8 %]</th>
<td colspan=3>
- [% P.customer_vendor_picker("customer_id", customer_id, type="customer", style="width: 300px", class=(initial_focus == 'customer_id' ? "initial_focus" : ""), onchange="\$('#update_button').click()") %]
+ [% P.customer_vendor.picker("customer_id", customer_id, type="customer", style="width: 300px", class=(initial_focus == 'customer_id' ? "initial_focus" : ""), onchange="\$('#update_button').click()") %]
[% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %]
[% L.hidden_tag("previous_customer_id", customer_id) %]
[% L.hidden_tag('terms', terms) %]
</td>
</tr>
<tr>
- <td>[% P.chart_picker("AR_chart_id", AR_chart_id, style="width: 400px", type="AR") %]</td>
+ <td>[% P.chart.picker("AR_chart_id", AR_chart_id, style="width: 400px", type="AR") %]</td>
<th align=left>[% LxERP.format_amount(invtotal, 2) | html %]</th>
<input type=hidden name=oldinvtotal value='[% oldinvtotal %]'>
</tr>
<tr>
<th align="right">[% 'Project Number' | $T8 %]</th>
- <td>[% P.project_picker("project_id", project_id, style=style) %]</td>
+ <td>[% P.project.picker("project_id", project_id, style=style) %]</td>
</tr>
[% IF ALL_BUSINESS_TYPES.as_list.size > 0 %]
<tr>
[% P.hidden_tag(vc_id, $vc_id) %]
[% HTML.escape(VC_OBJ.name) %]
[% ELSE %]
- [% P.customer_vendor_picker(vc_id, $vc_id, type=vc, class="fixed_width", onchange="\$('#update_button').click()") %]
+ [% P.customer_vendor.picker(vc_id, $vc_id, type=vc, class="fixed_width", onchange="\$('#update_button').click()") %]
[% END %]
[% P.hidden_tag("previous_" _ vc_id, $vc_id) %]
[% P.button_tag("show_vc_details('" _ HTML.escape(vc) _ "')", LxERP.t8("Details (one letter abbreviation)")) %]
<tr>
<th align="right">[% 'Vendor' | $T8 %]</th>
<td>
- [% P.customer_vendor_picker("vendor_id", vendor_id, type="vendor", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
+ [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
[% P.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)')) %]
[% P.hidden_tag("previous_vendor_id", vendor_id) %]
</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
- <td>[% P.project_picker('globalproject_id', globalproject_id) %]</td>
+ <td>[% P.project.picker('globalproject_id', globalproject_id) %]</td>
</tr>
</table>
</td>
<tr>
<th align="right">[% 'Customer' | $T8 %]</th>
<td>
- [% P.customer_vendor_picker("customer_id", customer_id, type="customer", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
+ [% P.customer_vendor.picker("customer_id", customer_id, type="customer", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
[% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %]
[% L.hidden_tag("previous_customer_id", customer_id) %]
[% L.hidden_tag("customer_pricegroup_id", customer_pricegroup_id) %]
<th align="right">[% IF vc == 'customer' %][% 'Customer' | $T8 %][% ELSE %][% 'Vendor' | $T8 %][% END %]</th>
<td>
[%- SET vc_id = vc _ "_id" %]
- [% P.customer_vendor_picker(vc_id, $vc_id, type=vc, style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
+ [% P.customer_vendor.picker(vc_id, $vc_id, type=vc, style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
[% P.button_tag("show_vc_details('" _ HTML.escape(vc) _ "')", LxERP.t8("Details (one letter abbreviation)")) %]
[% P.hidden_tag("previous_" _ vc_id, $vc_id) %]
</td>
</tr>
<tr>
<th align="right">[% 'Project' | $T8 %]</th>
- <td>[% P.project_picker("project_id", '', style=style) %]</td>
+ <td>[% P.project.picker("project_id", '', style=style) %]</td>
<th align="right">[% 'Part Number' | $T8 %]</th>
<td>[% L.input_tag("parts_partnumber", "", style=style) %]</td>
-[%- USE T8 %][%- USE HTML %][%- USE LxERP %][%- USE L %]
+[%- USE T8 %][%- USE HTML %][%- USE LxERP %][%- USE L %][%- USE P %]
<div>
<table id="input_row_table_id">
</thead>
<tbody>
<tr valign="top" class="listrow">
- <td>[% L.part_picker('add_item.parts_id', '', fat_set_item=1, style='width: 300px', class="add_item_input") %]</td>
+ <td>[% P.part.picker('add_item.parts_id', '', fat_set_item=1, style='width: 300px', class="add_item_input") %]</td>
<td>[% L.input_tag('add_item.description', '', class="add_item_input") %]</td>
<td>
[% L.input_tag('add_item.qty_as_number', '', size = 5, class="add_item_input numeric") %]
<div name="partnumber">[% HTML.escape(ITEM.part.partnumber) %]</div>
</td>
<td>
- <div name="partclassification">[% P.typeclass_abbreviation(ITEM.part) %]</div>
+ <div name="partclassification">[% ITEM.part.presenter.typeclass_abbreviation %]</div>
</td>
<td>
[% L.areainput_tag("order.orderitems[].description",
[%- USE HTML %]
[%- USE LxERP %]
[%- USE L %]
+[%- USE P %]
<table>
<tr><td colspan="100%">
<b>[%- 'Serial No.' | $T8 %]</b>
[%- L.input_tag("order.orderitems[].serialnumber", ITEM.serialnumber, size = 15) %]
<b>[%- 'Project' | $T8 %]</b>
- [% L.project_picker("order.orderitems[].project_id", ITEM.project_id, size = 15) %]
+ [% P.project.picker("order.orderitems[].project_id", ITEM.project_id, size = 15) %]
<b>[%- 'Reqdate' | $T8 %]</b>
[% L.date_tag("order.orderitems[].reqdate", ITEM.reqdate) %]
<b>[%- 'Subtotal' | $T8 %]</b>
[%- USE HTML %]
[%- USE LxERP %]
[%- USE L %]
+[%- USE P %]
[%- INCLUDE 'generic/set_longdescription.html' %]
<tr>
<th align="right">[% SELF.cv | $T8 %]</th>
[% SET cv_id = SELF.cv _ '_id' %]
- <td>[% L.customer_vendor_picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %]</td>
+ <td>[% P.customer_vendor.picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %]</td>
</tr>
<tr id='cp_row' [%- IF !SELF.order.${SELF.cv}.contacts.size %]style='display:none'[%- END %]>
<tr>
<th align="right">[% 'Project Number' | $T8 %]</th>
- <td>[% L.project_picker('order.globalproject_id', SELF.order.globalproject_id, style='width: 300px') %]</td>
+ <td>[% P.project.picker('order.globalproject_id', SELF.order.globalproject_id, style='width: 300px') %]</td>
</tr>
</table>
</tr>
[% FOREACH order_item = SELF.orderitems %]
<tr id="tr_[% loop.count %]" class="listrow[% loop.count % 2 %]">
- <td> [% P.part(order_item.part, no_link => 0) %]</td>
- <td> [% P.customer(order_item.order.customer, no_link => 0) %]</td>
- <td class="numeric"> [% P.sales_order(order_item.order, no_link => 0) %]</td>
+ <td> [% order_item.part.presenter.part(no_link => 0) %]</td>
+ <td> [% order_item.order.customer.presenter.customer(no_link => 0) %]</td>
+ <td class="numeric"> [% order_item.order.presenter.sales_order(no_link => 0) %]</td>
<td> [% order_item.order.transdate.to_kivitendo %]</td>
<td class="numeric [% IF order_item.delivered_qty == order_item.qty %]shipped[% ELSE %]not_shipped[% END %]">
[% LxERP.format_amount(order_item.qty, qty_round) %] [% order_item.unit | html %]
[%- USE LxERP %]
[%- USE T8 %]
[%- USE L %]
+[%- USE P %]
[% SET size=50 %]
[% SET show_images=0 %]
<table>
</tr>
<td>[% 'Customer' | $T8 %]</td>
- <td>[% L.customer_vendor_picker('filter.order.customer.id', FORM.customer_id, type='customer', class="filter", size=size) %]</td>
+ <td>[% P.customer_vendor.picker('filter.order.customer.id', FORM.customer_id, type='customer', class="filter", size=size) %]</td>
</tr>
<tr>
<td>[% 'Part' | $T8 %]</td>