Revision c2eb03d4
Von Kivitendo Admin vor etwa 9 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
42 | 42 |
use SL::CVar; |
43 | 43 |
use SL::DB::Order; |
44 | 44 |
use SL::DB::PeriodicInvoicesConfig; |
45 |
use SL::DB::Project; |
|
46 |
use SL::DB::ProjectType; |
|
45 | 47 |
use SL::DB::Status; |
46 | 48 |
use SL::DB::Tax; |
47 | 49 |
use SL::DBUtils; |
... | ... | |
402 | 404 |
|
403 | 405 |
my $number_field = $form->{type} =~ m{order} ? 'ordnumber' : 'quonumber'; |
404 | 406 |
my $trans_number = SL::TransNumber->new(type => $form->{type}, dbh => $dbh, number => $form->{$number_field}, id => $form->{id}); |
405 |
$form->{$number_field} ||= $trans_number->create_unique; |
|
407 |
$form->{$number_field} ||= $trans_number->create_unique; # set $form->{ordnumber} or $form->{quonumber}
|
|
406 | 408 |
|
407 | 409 |
if ($form->{id}) { |
408 | 410 |
$query = qq|DELETE FROM shipto | . |
... | ... | |
533 | 535 |
$pricegroup_id *= 1; |
534 | 536 |
$pricegroup_id = undef if !$pricegroup_id; |
535 | 537 |
|
538 |
if ( $::instance_conf->get_order_always_project && !$form->{"globalproject_id"} && ( $form->{type} eq 'sales_order' ) ) { |
|
539 |
my $new_project = SL::DB::Project->new( |
|
540 |
projectnumber => $form->{ordnumber}, |
|
541 |
description => $form->{customer}, |
|
542 |
active => 1, |
|
543 |
project_type_id => $::instance_conf->get_project_type_id, |
|
544 |
project_status_id => $::instance_conf->get_project_status_id, |
|
545 |
# id => $form->{globalproject_id} |
|
546 |
); |
|
547 |
$new_project->save; |
|
548 |
$form->{"globalproject_id"} = $new_project->id; |
|
549 |
}; |
|
550 |
|
|
536 | 551 |
CVar->get_non_editable_ic_cvars(form => $form, |
537 | 552 |
dbh => $dbh, |
538 | 553 |
row => $i, |
Auch abrufbar als: Unified diff
Verkaufsauftrag immer mit neuem Projekt speichern
sofern kein Projekt angegeben wurde. Die Projektnummer entspricht der
Auftragsnummer.