$lxdebug->leave_sub();
} #end search()
-
sub search_update_prices {
$lxdebug->enter_sub();
sub edit {
$lxdebug->enter_sub();
-
+ # show history button
+ $form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|;
+ #/show hhistory button
IC->get_part(\%myconfig, \%$form);
$form->{"original_partnumber"} = $form->{"partnumber"};
}
}
+ if (!$form->{previousform}) {
+ if ($form->{menubar}) {
+ require "$form->{path}/menu.pl";
+ &menubar;
+ }
+ }
+# button for saving history
+ if($form->{id} ne "") {
+ print qq|
+ <input type=button class=submit onclick=set_history_window(|
+ . $form->{id}
+ . qq|); name=history id=history value=|
+ . $locale->text('history')
+ . qq|>|;
+ }
+# /button for saving history
print qq|
</form>
+
<script type="text/javascript" src="js/wz_tooltip.js"></script>
</body>
}
if ($form->{item} eq 'service') {
- map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
- qw(sellprice listprice);
+ map({ $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
+ qw(sellprice listprice lastcost));
&form_header;
&price_row;
&form_footer;
if ($rc == 3) {
$form->error($locale->text('Partnumber not unique!'));
}
+ # saving the history
+ if(!exists $form->{addition}) {
+ $form->{addition} = "SAVED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$parts_id = $form->{id};
# load previous variables
sub save_as_new {
$lxdebug->enter_sub();
+ # saving the history
+ if(!exists $form->{addition}) {
+ $form->{addition} = "SAVED AS NEW";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$form->{id} = 0;
if ($form->{"original_partnumber"} &&
($form->{"partnumber"} eq $form->{"original_partnumber"})) {
$form->{partnumber} = "";
}
&save;
-
$lxdebug->leave_sub();
}
sub delete {
$lxdebug->enter_sub();
-
+ # saving the history
+ if(!exists $form->{addition}) {
+ $form->{addition} = "DELETED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$rc = IC->delete(\%myconfig, \%$form);
# redirect
$lxdebug->leave_sub();
}
-
sub parts_language_selection {
$lxdebug->enter_sub();