if (!$main::auth->assert('sales_all_edit', 1)) {
$query .= " AND o.employee_id = (select id from employee where login= ?)";
- push @values, $form->{login};
+ push @values, $::myconfig{login};
}
if ($form->{employee_id}) {
$query .= " AND o.employee_id = ?";
my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig);
my $query = qq|SELECT id FROM employee WHERE login = ?|;
- my ($e_id) = selectrow_query($form, $dbh, $query, $form->{login});
+ my ($e_id) = selectrow_query($form, $dbh, $query, $::myconfig{login});
$query =
qq|SELECT oe.id, oe.transdate, oe.reqdate, oe.quonumber, oe.transaction_description, oe.amount,
CVar->get_non_editable_ic_cvars(form => $form,
dbh => $dbh,
- row => $i,
+ row => $i,
sub_module => 'orderitems',
may_converted_from => ['orderitems', 'invoice']);
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}),
delete $form->{convert_from_oe_ids};
@{ $form->{convert_from_oe_ids} } = @convert_from_oe_ids;
foreach (qw(ar oe)) {
- if ($form->{"convert_from_${_}_ids"}) {
+ if (!$form->{useasnew} && $form->{"convert_from_${_}_ids"}) {
RecordLinks->create_links('dbh' => $dbh,
'mode' => 'ids',
'from_table' => $_,
my $config_obj = SL::DB::Manager::PeriodicInvoicesConfig->find_by(oe_id => $form->{id});
if ($config_obj) {
- my $config = { map { $_ => $config_obj->$_ } qw(active terminated periodicity start_date_as_date end_date_as_date first_billing_date_as_date extend_automatically_by ar_chart_id
+ my $config = { map { $_ => $config_obj->$_ } qw(active terminated periodicity order_value_periodicity start_date_as_date end_date_as_date first_billing_date_as_date extend_automatically_by ar_chart_id
print printer_id copies) };
$form->{periodic_invoices_config} = YAML::Dump($config);
}
if ($form->{"rowcount"} and $#ids == 0) {
$form->{"id"} = $ids[0];
undef @ids;
+ delete $form->{convert_from_oe_ids};
}
# and remember for the rest of the function
CVar->get_non_editable_ic_cvars(form => $form,
dbh => $dbh,
- row => $i,
+ row => $i,
sub_module => 'orderitems',
may_converted_from => ['orderitems', 'invoice']);