projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CVar: Dokumentation um Lieferadressen-CVars ergänzt
[kivitendo-erp.git]
/
SL
/
IC.pm
diff --git
a/SL/IC.pm
b/SL/IC.pm
index
e25e13e
..
1a02c59
100644
(file)
--- a/
SL/IC.pm
+++ b/
SL/IC.pm
@@
-72,6
+72,8
@@
sub get_part {
# copy to $form variables
map { $form->{$_} = $ref->{$_} } (keys %{$ref});
# copy to $form variables
map { $form->{$_} = $ref->{$_} } (keys %{$ref});
+ $form->{mtime} = $form->{itime} if !$form->{mtime};
+ $form->{lastmtime} = $form->{mtime};
$form->{onhand} *= 1;
# part or service item
$form->{onhand} *= 1;
# part or service item
@@
-397,6
+399,8
@@
sub save {
);
do_query($form, $dbh, $query, @values);
);
do_query($form, $dbh, $query, @values);
+ $form->new_lastmtime('parts');
+
# delete translation records
do_query($form, $dbh, qq|DELETE FROM translation WHERE parts_id = ?|, conv_i($form->{id}));
# delete translation records
do_query($form, $dbh, qq|DELETE FROM translation WHERE parts_id = ?|, conv_i($form->{id}));
@@
-568,6
+572,8
@@
sub update_assembly {
$qty * ($form->{weight} - $weight), conv_i($id));
do_query($form, $dbh, $query, @values);
$qty * ($form->{weight} - $weight), conv_i($id));
do_query($form, $dbh, $query, @values);
+ $form->new_lastmtime('parts') if $id == $form->{id};
+
$main::lxdebug->leave_sub();
}
$main::lxdebug->leave_sub();
}
@@
-671,7
+677,7
@@
sub assembly_item {
my $query =
qq|SELECT p.id, p.partnumber, p.description, p.sellprice,
p.weight, p.onhand, p.unit, pg.partsgroup, p.lastcost,
my $query =
qq|SELECT p.id, p.partnumber, p.description, p.sellprice,
p.weight, p.onhand, p.unit, pg.partsgroup, p.lastcost,
- p.price_factor_id, pfac.factor AS price_factor
+ p.price_factor_id, pfac.factor AS price_factor
, p.notes as longdescription
FROM parts p
LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
LEFT JOIN price_factors pfac ON pfac.id = p.price_factor_id
FROM parts p
LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
LEFT JOIN price_factors pfac ON pfac.id = p.price_factor_id
@@
-866,6
+872,13
@@
sub all_parts {
}
}
}
}
+ # special case smart search
+ if ($form->{all}) {
+ $form->{"l_$_"} = 1 for qw(partnumber description unit sellprice lastcost cvar_packaging linetotal);
+ push @where_tokens, "p.partnumber ILIKE ? OR p.description ILIKE ?";
+ push @bind_vars, "%$form->{all}%", "%$form->{all}%";
+ }
+
# special case insertdate
if (grep { $form->{$_} } qw(insertdatefrom insertdateto)) {
$form->{"l_insertdate"} = 1;
# special case insertdate
if (grep { $form->{$_} } qw(insertdatefrom insertdateto)) {
$form->{"l_insertdate"} = 1;
@@
-1713,7
+1726,7
@@
sub prepare_parts_for_printing {
$sth->finish();
$sth->finish();
- my @columns = qw(ean image microfiche drawing
weight
);
+ my @columns = qw(ean image microfiche drawing);
$query = qq|SELECT id, | . join(', ', @columns) . qq|
FROM parts
$query = qq|SELECT id, | . join(', ', @columns) . qq|
FROM parts
@@
-1721,7
+1734,8
@@
sub prepare_parts_for_printing {
my %data = selectall_as_map($form, $dbh, $query, 'id', \@columns, @part_ids);
my %data = selectall_as_map($form, $dbh, $query, 'id', \@columns, @part_ids);
- map { $form->{TEMPLATE_ARRAYS}{$_} = [] } (qw(make model), @columns);
+ my %template_arrays;
+ map { $template_arrays{$_} = [] } (qw(make model), @columns);
foreach my $i (1 .. $rowcount) {
my $id = $form->{"${prefix}${i}"};
foreach my $i (1 .. $rowcount) {
my $id = $form->{"${prefix}${i}"};
@@
-1729,16
+1743,16
@@
sub prepare_parts_for_printing {
next if (!$id);
foreach (@columns) {
next if (!$id);
foreach (@columns) {
- push @{ $
form->{TEMPLATE_ARRAYS}
{$_} }, $data{$id}->{$_};
+ push @{ $
template_arrays
{$_} }, $data{$id}->{$_};
}
}
- push @{ $
form->{TEMPLATE_ARRAYS}
{make} }, [];
- push @{ $
form->{TEMPLATE_ARRAYS}
{model} }, [];
+ push @{ $
template_arrays
{make} }, [];
+ push @{ $
template_arrays
{model} }, [];
next if (!$makemodel{$id});
foreach my $ref (@{ $makemodel{$id} }) {
next if (!$makemodel{$id});
foreach my $ref (@{ $makemodel{$id} }) {
- map { push @{ $
form->{TEMPLATE_ARRAYS}
{$_}->[-1] }, $ref->{$_} } qw(make model);
+ map { push @{ $
template_arrays
{$_}->[-1] }, $ref->{$_} } qw(make model);
}
}
}
}
@@
-1749,9
+1763,10
@@
sub prepare_parts_for_printing {
my $id = $form->{"${prefix}${i}"};
next unless $id;
my $id = $form->{"${prefix}${i}"};
next unless $id;
- push @{ $
form->{TEMPLATE_ARRAYS}
{part_type} }, $parts_by_id{$id}->type;
+ push @{ $
template_arrays
{part_type} }, $parts_by_id{$id}->type;
}
}
+ return %template_arrays;
$main::lxdebug->leave_sub();
}
$main::lxdebug->leave_sub();
}