my $vc = $form->{vc} eq "customer" ? "customer" : "vendor";
my $query =
- qq|SELECT dord.id, dord.donumber, dord.ordnumber,
+ qq|SELECT dord.id, dord.donumber, dord.ordnumber, dord.cusordnumber,
dord.transdate, dord.reqdate,
ct.${vc}number, ct.name, dord.${vc}_id, dord.globalproject_id,
dord.closed, dord.delivered, dord.shippingpoint, dord.shipvia,
my $rc = $dbh->commit();
$form->{saved_donumber} = $form->{donumber};
-
+ $form->{saved_ordnumber} = $form->{ordnumber};
+ $form->{saved_cusordnumber} = $form->{cusordnumber};
+
Common::webdav_folder($form);
$main::lxdebug->leave_sub();
$sth = prepare_execute_query($form, $dbh, $query, @do_ids);
delete $form->{"${vc}_id"};
+ my $pos = 0;
+ $form->{ordnumber_array} = ' ';
+ $form->{cusordnumber_array} = ' ';
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
if ($form->{"${vc}_id"} && ($ref->{"${vc}_id"} != $form->{"${vc}_id"})) {
$sth->finish();
map { $form->{$_} = $ref->{$_} } keys %$ref if ($ref);
$form->{donumber_array} .= $form->{donumber} . ' ';
+ $pos = index($form->{ordnumber_array},' ' . $form->{ordnumber} . ' ');
+ if ($pos == -1) {
+ $form->{ordnumber_array} .= $form->{ordnumber} . ' ';
+ }
+ $pos = index($form->{cusordnumber_array},' ' . $form->{cusordnumber} . ' ');
+ if ($pos == -1) {
+ $form->{cusordnumber_array} .= $form->{cusordnumber} . ' ';
+ }
}
$sth->finish();
$form->{donumber_array} =~ s/\s*$//g;
+ $form->{ordnumber_array} =~ s/ //;
+ $form->{ordnumber_array} =~ s/\s*$//g;
+ $form->{cusordnumber_array} =~ s/ //;
+ $form->{cusordnumber_array} =~ s/\s*$//g;
$form->{saved_donumber} = $form->{donumber};
+ $form->{saved_ordnumber} = $form->{ordnumber};
+ $form->{saved_cusordnumber} = $form->{cusordnumber};
# if not given, fill transdate with current_date
$form->{transdate} = $form->current_date($myconfig) unless $form->{transdate};
my @columns = qw(
ids transdate reqdate
id donumber
- ordnumber customernumber
+ ordnumber customernumber cusordnumber
name employee salesman
shipvia globalprojectnumber
transaction_description department
my $report = SL::ReportGenerator->new(\%myconfig, $form);
my @hidden_variables = map { "l_${_}" } @columns;
- push @hidden_variables, $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered donumber ordnumber serialnumber
+ push @hidden_variables, $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered donumber ordnumber serialnumber cusordnumber
transaction_description transdatefrom transdateto reqdatefrom reqdateto
type vc employee_id salesman_id project_id);
'donumber' => { 'text' => $locale->text('Delivery Order'), },
'ordnumber' => { 'text' => $locale->text('Order'), },
'customernumber' => { 'text' => $locale->text('Customer Number'), },
+ 'cusordnumber' => { 'text' => $locale->text('Customer Order Number'), },
'name' => { 'text' => $form->{vc} eq 'customer' ? $locale->text('Customer') : $locale->text('Vendor'), },
'employee' => { 'text' => $locale->text('Employee'), },
'salesman' => { 'text' => $locale->text('Salesman'), },
# Hinweis: delete gibt den wert zurueck und loescht danach das element (nett und einfach)
# $shell: perldoc perlunc; /delete EXPR
$form->{donumber} = delete $form->{donumber_array};
+ $form->{ordnumber} = delete $form->{ordnumber_array};
+ $form->{cusordnumber} = delete $form->{cusordnumber_array};
$form->{deliverydate} = $form->{transdate};
$form->{transdate} = $form->current_date(\%myconfig);
$form->{duedate} = $form->current_date(\%myconfig, $form->{invdate}, $form->{terms} * 1);