Revision 306fad80
Von G. Richardson vor mehr als 13 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
687 | 687 |
|
688 | 688 |
if ($form->{"assembly_$i"}) { |
689 | 689 |
# record assembly item as allocated |
690 |
&process_assembly($dbh, $form, $form->{"id_$i"}, $baseqty); |
|
690 |
&process_assembly($dbh, $myconfig, $form, $form->{"id_$i"}, $baseqty);
|
|
691 | 691 |
|
692 | 692 |
} else { |
693 |
$allocated = &cogs($dbh, $form, $form->{"id_$i"}, $baseqty, $basefactor, $i); |
|
693 |
$allocated = &cogs($dbh, $myconfig, $form, $form->{"id_$i"}, $baseqty, $basefactor, $i);
|
|
694 | 694 |
} |
695 | 695 |
} |
696 | 696 |
|
... | ... | |
1185 | 1185 |
sub process_assembly { |
1186 | 1186 |
$main::lxdebug->enter_sub(); |
1187 | 1187 |
|
1188 |
my ($dbh, $form, $id, $totalqty) = @_; |
|
1188 |
my ($dbh, $myconfig, $form, $id, $totalqty) = @_;
|
|
1189 | 1189 |
|
1190 | 1190 |
my $query = |
1191 | 1191 |
qq|SELECT a.parts_id, a.qty, p.assembly, p.partnumber, p.description, p.unit, |
... | ... | |
1206 | 1206 |
$ref->{qty} *= $totalqty; |
1207 | 1207 |
|
1208 | 1208 |
if ($ref->{assembly}) { |
1209 |
&process_assembly($dbh, $form, $ref->{parts_id}, $ref->{qty}); |
|
1209 |
&process_assembly($dbh, $myconfig, $form, $ref->{parts_id}, $ref->{qty});
|
|
1210 | 1210 |
next; |
1211 | 1211 |
} else { |
1212 | 1212 |
if ($ref->{inventory_accno_id}) { |
1213 |
$allocated = &cogs($dbh, $form, $ref->{parts_id}, $ref->{qty}); |
|
1213 |
$allocated = &cogs($dbh, $myconfig, $form, $ref->{parts_id}, $ref->{qty});
|
|
1214 | 1214 |
} |
1215 | 1215 |
} |
1216 | 1216 |
|
... | ... | |
1231 | 1231 |
sub cogs { |
1232 | 1232 |
$main::lxdebug->enter_sub(); |
1233 | 1233 |
|
1234 |
my ($dbh, $form, $id, $totalqty, $basefactor, $row) = @_; |
|
1234 |
# adjust allocated in table invoice according to FIFO princicple |
|
1235 |
# for a certain part with part_id $id |
|
1236 |
|
|
1237 |
my ($dbh, $myconfig, $form, $id, $totalqty, $basefactor, $row) = @_; |
|
1235 | 1238 |
|
1236 | 1239 |
$basefactor ||= 1; |
1237 | 1240 |
|
Auch abrufbar als: Unified diff
myconfig bei cogs und process_assembly übergeben