"country", "shippingpoint",
"taxzone", "insertdate",
"order_probability", "expected_billing_date", "expected_netamount",
- "payment_terms",
+ "payment_terms", "intnotes",
);
# only show checkboxes if gotten here via sales_order form.
reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive
business_id shippingpoint taxzone_id reqdate_unset_or_old insertdatefrom insertdateto
order_probability_op order_probability_value expected_billing_date_from expected_billing_date_to
- parts_partnumber parts_description all department_id);
+ parts_partnumber parts_description all department_id intnotes);
push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables;
my @keys_for_url = grep { $form->{$_} } @hidden_variables;
'expected_billing_date' => { 'text' => $locale->text('Exp. bill. date'), },
'expected_netamount' => { 'text' => $locale->text('Exp. netamount'), },
'payment_terms' => { 'text' => $locale->text('Payment Terms'), },
+ 'intnotes' => { 'text' => $locale->text('Internal Notes'), },
%column_defs_cvars,
);
- foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone insertdate payment_terms department)) {
+ foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone insertdate payment_terms department intnotes)) {
my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
$column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
}
push @options, $locale->text('Order Number') . " : $form->{ordnumber}" if $form->{ordnumber};
push @options, $locale->text('Customer Order Number') . " : $form->{cusordnumber}" if $form->{cusordnumber};
push @options, $locale->text('Notes') . " : $form->{notes}" if $form->{notes};
+ push @options, $locale->text('Internal Notes') . " : $form->{intnotes}" if $form->{intnotes};
push @options, $locale->text('Transaction description') . " : $form->{transaction_description}" if $form->{transaction_description};
push @options, $locale->text('Quick Search') . " : $form->{all}" if $form->{all};
push @options, $locale->text('Shipping Point') . " : $form->{shippingpoint}" if $form->{shippingpoint};
$main::lxdebug->leave_sub();
}
-sub oe_delivery_order_from_order {
-
+sub oe_prepare_xyz_from_order {
return if !$::form->{id};
my $order = SL::DB::Order->new(id => $::form->{id})->load;
$::form->{rowcount}++;
_update_ship();
+}
+
+sub oe_delivery_order_from_order {
+ oe_prepare_xyz_from_order();
delivery_order();
}
sub oe_invoice_from_order {
-
- return if !$::form->{id};
-
- my $order = SL::DB::Order->new(id => $::form->{id})->load;
- $order->flatten_to_form($::form, format_amounts => 1);
-
- # hack: add partsgroup for first row if it does not exists,
- # because _remove_billed_or_delivered_rows and _remove_full_delivered_rows
- # determine fields to handled by existing fields for the first row. If partsgroup
- # is missing there, for deleted rows the partsgroup_field is not emptied and in
- # update_delivery_order it will not considered an empty row ...
- $::form->{partsgroup_1} = '' if !exists $::form->{partsgroup_1};
-
- # fake last empty row
- $::form->{rowcount}++;
-
- _update_ship();
+ oe_prepare_xyz_from_order();
invoice();
}
next unless $::form->{"id_$row"};
my $base_factor = SL::DB::Manager::Unit->find_by(name => $::form->{"unit_$row"})->base_factor;
my $base_qty = $::form->parse_amount(\%::myconfig, $::form->{"qty_$row"}) * $base_factor;
- my $ship_qty = $::form->parse_amount(\%::myconfig, $::form->{"ship_$row"}) * $base_factor;
+ my $ship_qty = $::form->{"ship_$row"} * $base_factor;
#$main::lxdebug->message(LXDebug->DEBUG2(),"shipto=".$ship_qty." qty=".$base_qty);
if (!$ship_qty || ($ship_qty < $base_qty)) {