);
my $dbh = $form->dbconnect(\%myconfig);
-
+ my $searchSNumber = $searchNo{$form->{'what2search'}} . qq|_| . $form->{'searchid'};
$restriction .= ($form->{mitarbeiter} eq "" ? ""
: ($form->{mitarbeiter} =~ /^[0-9]*$/
? " AND employee_id = " . $form->{mitarbeiter}
: " AND employee_id = " . &get_employee_id($form->{mitarbeiter}, $dbh)));
-
- my $query = qq|SELECT id FROM $search{$form->{what2search}}
- WHERE $searchNo{$form->{'what2search'}} ILIKE '$form->{"searchid"}'
- |;
-
- my $sth = $dbh->prepare($query);
+ my $query = qq|SELECT trans_id AS id FROM history_erp WHERE sNumbers = '$searchSNumber' |;
+
+ my $sth = $dbh->prepare($query);
$sth->execute() || $form->dberror($query);
+ if($sth->fetch() <= 0) {
+ $sth->finish();
+ my $query = qq|SELECT id FROM $search{$form->{what2search}}
+ WHERE $searchNo{$form->{'what2search'}} ILIKE '$form->{"searchid"}'
+ |;
+ }
+ $sth->execute() || $form->dberror($query);
$form->{title} = $locale->text("History Search");
$form->header();
-
+ my @daten;
while(my $hash_ref = $sth->fetchrow_hashref()){
- print $form->parse_html_template("/common/show_history",
- {"DATEN" => $form->get_history($dbh,$hash_ref->{id},$restriction),
- "SUCCESS" => ($form->get_history($dbh,$hash_ref->{id},$restriction) != 0),
- "NONEWWINDOW" => "1"
- }
- );
- }
+ push(@daten, $form->get_history($dbh,$hash_ref->{id},$restriction));
+ }
$dbh->disconnect();
-
+ print $form->parse_html_template("/common/show_history",
+ {"DATEN" => @daten,
+ "SUCCESS" => (length(@daten) > 0),
+ "NONEWWINDOW" => 1
+ });
$lxdebug->leave_sub();
}
if (AP->post_transaction(\%myconfig, \%$form)) {
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "POSTED";
$form->save_history($form->dbconnect(\%myconfig));
}
$form->{postasnew} = 1;
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "POSTED AS NEW";
$form->save_history($form->dbconnect(\%myconfig));
}
if (AP->delete_transaction(\%myconfig, \%$form, $spool)) {
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
# saving the history
if(!exists $form->{addition} && ($form->{id} ne "")) {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "ADDED";
$form->save_history($form->dbconnect(\%myconfig));
}
if (AR->post_transaction(\%myconfig, \%$form)) {
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "POSTED";
$form->save_history($form->dbconnect(\%myconfig));
}
$form->{postasnew} = 1;
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "POSTED AS NEW";
$form->save_history($form->dbconnect(\%myconfig));
}
if (AR->delete_transaction(\%myconfig, \%$form, $spool)) {
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
$form->{script} = "ap.pl";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
$form->{script} = "ar.pl";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
$form->{type} = "invoice";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
$form->{type} = "request_quotation";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
$form->{type} = "sales_quotation";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
($form->{db} eq 'customer') ? "sales_order" : "purchase_order";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
}
# saving the history
if(!exists $form->{addition}) {
- $form->{addition} = "SAVED";
+ $form->{snumber} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
+ $form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
}
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
$msg .= " deleted!";
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
if (GL->delete_transaction(\%myconfig, \%$form)){
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
undef($form->{callback});
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->{what_done} = $locale->text("Buchungsnummer") . " = " . $form->{id};
$form->save_history($form->dbconnect(\%myconfig));
$form->{storno} = 1;
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "STORNO";
$form->save_history($form->dbconnect(\%myconfig));
}
}
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|partnumber_| . $form->{partnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|partnumber_| . $form->{partnumber};
$form->{addition} = "SAVED AS NEW";
$form->save_history($form->dbconnect(\%myconfig));
}
$lxdebug->enter_sub();
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|partnumber_| . $form->{partnumber};
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
call_sub($display_form);
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "PRINTED";
$form->save_history($form->dbconnect(\%myconfig));
}
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
if($form->{media} =~ /printer/) {
$form->{addition} = "PRINTED";
}
if(!exists $form->{addition} && $form->{id} ne "") {
# saving the history
+ $form->{snumbers} = qq|invnumber|;
$form->{addition} = "PAYMENT POSTED";
$form->save_history($form->dbconnect(\%myconfig));
# /saving the history
if (IR->post_invoice(\%myconfig, \%$form)){
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
- $form->{addition} = "POSTED";
+ $form->{snumbers} = qq|invnumber|;
+ $form->{addition} = "POSTED";
#$form->{what_done} = $locale->text("Rechnungsnummer") . qq| | . $form->{invnumber};
$form->save_history($form->dbconnect(\%myconfig));
}
if (IR->delete_invoice(\%myconfig, \%$form)) {
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|invnumber|;
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
remove_draft() if $form->{remove_draft};
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = $print_post ? "PRINTED AND POSTED" :
$form->{storno} ? "STORNO" :
"POSTED";
if (IS->delete_invoice(\%myconfig, \%$form, $spool)) {
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
$form->redirect($msg);
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
}
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumber} = qq|projectnumber_| . $form->{projectnumber};
$form->{addition} = "SAVED";
$form->save_history($form->dbconnect(\%myconfig));
}
}
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumber} = qq|projectnumber_| . $form->{projectnumber};
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
}
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumber} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "PRINTED";
$form->{what_done} = $form->{type};
$form->save_history($form->dbconnect(\%myconfig));