use SL::DB::MetaSetup::DeliveryOrder;
use SL::DB::Manager::DeliveryOrder;
+use SL::DB::Helper::AttrHTML;
use SL::DB::Helper::FlattenToForm;
use SL::DB::Helper::LinkedRecords;
use SL::DB::Helper::TransNumberGenerator;
__PACKAGE__->meta->initialize;
+__PACKAGE__->attr_html('notes');
+
__PACKAGE__->before_save('_before_save_set_donumber');
# hooks
use SL::DB::MetaSetup::Invoice;
use SL::DB::Manager::Invoice;
+use SL::DB::Helper::AttrHTML;
use SL::DB::Helper::FlattenToForm;
use SL::DB::Helper::LinkedRecords;
use SL::DB::Helper::PriceTaxCalculator;
__PACKAGE__->meta->initialize;
+__PACKAGE__->attr_html('notes');
+
__PACKAGE__->before_save('_before_save_set_invnumber');
# hooks
use SL::DB::MetaSetup::Order;
use SL::DB::Manager::Order;
+use SL::DB::Helper::AttrHTML;
use SL::DB::Helper::FlattenToForm;
use SL::DB::Helper::LinkedRecords;
use SL::DB::Helper::PriceTaxCalculator;
__PACKAGE__->meta->initialize;
+__PACKAGE__->attr_html('notes');
+
__PACKAGE__->before_save('_before_save_set_ord_quo_number');
# hooks
use SL::DB::MetaSetup::PurchaseInvoice;
use SL::DB::Manager::PurchaseInvoice;
+use SL::DB::Helper::AttrHTML;
use SL::DB::Helper::LinkedRecords;
use SL::Locale::String qw(t8);
__PACKAGE__->meta->initialize;
+__PACKAGE__->attr_html('notes');
+
sub items { goto &invoiceitems; }
sub add_items { goto &add_invoiceitems; }
$form->{cusordnumber}, conv_date($form->{transdate}),
conv_i($form->{vendor_id}), conv_i($form->{customer_id}),
conv_date($form->{reqdate}), $form->{shippingpoint}, $form->{shipvia},
- $form->{notes}, $form->{intnotes},
+ $restricter->process($form->{notes}), $form->{intnotes},
$form->{closed} ? 't' : 'f', $form->{delivered} ? "t" : "f",
conv_i($form->{department_id}), conv_i($form->{language_id}), conv_i($form->{shipto_id}),
conv_i($form->{globalproject_id}), conv_i($form->{employee_id}),
$form->{invnumber}, $form->{ordnumber}, $form->{quonumber}, conv_date($form->{invdate}),
conv_date($form->{orddate}), conv_date($form->{quodate}), conv_i($form->{vendor_id}), $amount,
$netamount, $form->{paid}, conv_date($form->{duedate}),
- '1', $taxzone_id, $form->{notes}, $form->{taxincluded} ? 't' : 'f',
+ '1', $taxzone_id, $restricter->process($form->{notes}), $form->{taxincluded} ? 't' : 'f',
$form->{intnotes}, conv_i($form->{storno_id}), $form->{storno} ? 't' : 'f',
conv_i($form->{cp_id}), conv_i($form->{employee_id}), conv_i($form->{department_id}), conv_i($form->{delivery_term_id}),
conv_i($form->{globalproject_id}),
conv_date($form->{"invdate"}), conv_date($form->{"orddate"}), conv_date($form->{"quodate"}), conv_i($form->{"customer_id"}),
$amount, $netamount, $form->{"paid"},
conv_date($form->{"duedate"}), conv_date($form->{"deliverydate"}), '1', $form->{"shippingpoint"},
- $form->{"shipvia"}, conv_i($form->{"terms"}), $form->{"notes"}, $form->{"intnotes"},
+ $form->{"shipvia"}, conv_i($form->{"terms"}), $restricter->process($form->{"notes"}), $form->{"intnotes"},
$form->{"currency"}, conv_i($form->{"department_id"}), conv_i($form->{"payment_id"}), $form->{"taxincluded"} ? 't' : 'f',
$form->{"type"}, conv_i($form->{"language_id"}), conv_i($form->{"taxzone_id"}), conv_i($form->{"shipto_id"}),
conv_i($form->{"employee_id"}), conv_i($form->{"salesman_id"}), conv_i($form->{storno_id}), $form->{"storno"} ? 't' : 'f',
conv_i($form->{vendor_id}), conv_i($form->{customer_id}),
$amount, $netamount, conv_date($reqdate),
$form->{taxincluded} ? 't' : 'f', $form->{shippingpoint},
- $form->{shipvia}, $form->{notes}, $form->{intnotes},
+ $form->{shipvia}, $restricter->process($form->{notes}), $form->{intnotes},
$form->{currency}, $form->{closed} ? 't' : 'f',
$form->{delivered} ? "t" : "f", $form->{proforma} ? 't' : 'f',
$quotation, conv_i($form->{department_id}),
$form->{TEMPLATE_DRIVER_OPTIONS}->{variable_content_types} = {
longdescription => 'html',
partnotes => 'html',
+ notes => 'html',
};
}
$form->{invtotal} = $form->{invsubtotal};
- my $rows = max 2, $form->numtextrows($form->{notes}, 25, 8);
- my $introws = max 2, $form->numtextrows($form->{intnotes}, 35, 8);
- $rows = max $rows, $introws;
+ my $introws = max 5, $form->numtextrows($form->{intnotes}, 35, 8);
- $TMPL_VAR{notes} = qq|<textarea name=notes rows="$rows" cols="25">| . H($form->{notes}) . qq|</textarea>|;
+ $TMPL_VAR{notes} = qq|<textarea name="notes" class="texteditor" wrap="soft" style="width: 350px; height: 150px">| . H($form->{notes}) . qq|</textarea>|;
$TMPL_VAR{intnotes} = qq|<textarea name=intnotes rows="$introws" cols="35">| . H($form->{intnotes}) . qq|</textarea>|;
if( $form->{customer_id} && !$form->{taxincluded_changed_by_user} ) {
--- /dev/null
+# @tag: oe_ar_ap_delivery_orders_edit_notes_as_html
+# @description: Einkaufs- und Verkaufsbelege: Bemerkungsfeld in HTML umwandeln
+# @depends: requirement_spec_edit_html
+package SL::DBUpgrade2::oe_ar_ap_delivery_orders_edit_notes_as_html;
+
+use strict;
+use utf8;
+
+use SL::DBUtils;
+
+use parent qw(SL::DBUpgrade2::Base);
+
+sub convert_column {
+ my ($self, $table, $column) = @_;
+
+ my $sth = $self->dbh->prepare(qq|UPDATE $table SET $column = ? WHERE id = ?|) || $self->dberror;
+
+ foreach my $row (selectall_hashref_query($::form, $self->dbh, qq|SELECT id, $column FROM $table WHERE $column IS NOT NULL|)) {
+ next if !$row->{$column} || (($row->{$column} =~ m{^<[a-z]+>}) && ($row->{$column} =~ m{</[a-z]+>$}));
+
+ my $new_content = "" . $::request->presenter->escape($row->{$column});
+ $new_content =~ s{\r}{}g;
+ $new_content =~ s{\n\n+}{</p><p>}g;
+ $new_content =~ s{\n}{<br />}g;
+ $new_content = "<p>${new_content}</p>" if $new_content;
+
+ $sth->execute($new_content, $row->{id}) if $new_content ne $row->{$column};
+ }
+
+ $sth->finish;
+}
+
+sub run {
+ my ($self) = @_;
+
+ $self->convert_column($_, 'notes') for qw(oe delivery_orders ar ap);
+
+ return 1;
+}
+
+1;
[%- USE T8 %]
-[% USE HTML %][% USE LxERP %][%- USE L -%]
+[% USE HTML %][% USE LxERP %][%- USE L -%][%- USE P -%]
[%- IF delivered %]
[%- SET RO = ' readonly' %]
[%- END %]
</tr>
<tr valign="top">
- <td><textarea name="notes" rows="[% LxERP.numtextrows(notes, 25, 8, 2) %]" cols="25" wrap="soft"[% RO %]>[% HTML.escape(notes) %]</textarea></td>
+ <td>
+ [% IF delivered %]
+ [% L.hidden_tag("notes", notes) %]
+ <div style="width: 350px; height: 150px; border: 1px solid black">[% P.restricted_html(notes) %]</div>
+ [% ELSE %]
+ [% L.textarea_tag("notes", notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
+ [% END %]
+ </td>
<td><textarea name="intnotes" rows="[% LxERP.numtextrows(intnotes, 35, 8, 2) %]" cols="35" wrap="soft"[% RO %]>[% HTML.escape(intnotes) %]</textarea></td>
</tr>
</tr>
<tr valign="top">
<td>
- <textarea name="notes" rows="[% rows %]" cols="26" wrap="soft">[% notes %]</textarea>
+ [% L.textarea_tag("notes", notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
</td>
<td>
<textarea name="intnotes" rows="[% rows %]" cols="35" wrap="soft">[% intnotes %]</textarea>
</tr>
<tr valign="top">
<td>
- <textarea name="notes" rows="[% rows %]" cols="26">[% notes %]</textarea>
+ [% L.textarea_tag("notes", notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
</td>
<td>
<textarea name="intnotes" rows="[% rows %]" cols="35">[% intnotes %]</textarea>