Revision 3c1ceacd
Von Moritz Bunkus vor mehr als 16 Jahren hinzugefügt
SL/DO.pm | ||
---|---|---|
342 | 342 |
# save printed, emailed, queued |
343 | 343 |
$form->save_status($dbh); |
344 | 344 |
|
345 |
$self->close_order_if_delivered('do_id' => $form->{id},
|
|
346 |
'type' => $form->{type} eq 'sales_delivery_order' ? 'sales' : 'purchase',
|
|
347 |
'dbh' => $dbh,);
|
|
345 |
$self->mark_order_if_delivered('do_id' => $form->{id},
|
|
346 |
'type' => $form->{type} eq 'sales_delivery_order' ? 'sales' : 'purchase', |
|
347 |
'dbh' => $dbh,); |
|
348 | 348 |
|
349 | 349 |
my $rc = $dbh->commit(); |
350 | 350 |
|
... | ... | |
357 | 357 |
return $rc; |
358 | 358 |
} |
359 | 359 |
|
360 |
sub close_order_if_delivered {
|
|
360 |
sub mark_order_if_delivered {
|
|
361 | 361 |
$main::lxdebug->enter_sub(); |
362 | 362 |
|
363 | 363 |
my $self = shift; |
... | ... | |
434 | 434 |
$main::lxdebug->leave_sub(); |
435 | 435 |
} |
436 | 436 |
|
437 |
sub close_orders { |
|
438 |
$main::lxdebug->enter_sub(); |
|
439 |
|
|
440 |
my $self = shift; |
|
441 |
my %params = @_; |
|
442 |
|
|
443 |
Common::check_params(\%params, qw(ids)); |
|
444 |
|
|
445 |
if (('ARRAY' ne ref $params{ids}) || !scalar @{ $params{ids} }) { |
|
446 |
$main::lxdebug->leave_sub(); |
|
447 |
return; |
|
448 |
} |
|
449 |
|
|
450 |
my $myconfig = \%main::myconfig; |
|
451 |
my $form = $main::form; |
|
452 |
|
|
453 |
my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); |
|
454 |
|
|
455 |
my $query = qq|UPDATE delivery_orders SET closed = TRUE WHERE id IN (| . join(', ', ('?') x scalar(@{ $params{ids} })) . qq|)|; |
|
456 |
|
|
457 |
do_query($form, $dbh, $query, map { conv_i($_) } @{ $params{ids} }); |
|
458 |
|
|
459 |
$dbh->commit() unless ($params{dbh}); |
|
460 |
|
|
461 |
$main::lxdebug->leave_sub(); |
|
462 |
} |
|
463 |
|
|
437 | 464 |
sub delete { |
438 | 465 |
$main::lxdebug->enter_sub(); |
439 | 466 |
|
Auch abrufbar als: Unified diff
------------------------------------------------------------------------
r7135 | mbunkus | 2008-06-20 10:56:08 +0200 (Fri, 20 Jun 2008) | 1 line
Wenn eine Rechnung aus einem oder mehreren Lieferscheinen erstellt wird, so wird beim Buchen der Rechnung automatisch alle Lieferscheine als geschlossen markiert, aus denen die Rechnung erstellt wurde.
------------------------------------------------------------------------