Revision ebc1082f
Von Kivitendo Admin vor fast 2 Jahren hinzugefügt
t/model/records.t | ||
---|---|---|
78 | 78 |
note " testing from quotation -> $target_record_type"; |
79 | 79 |
my $new_record = SL::Model::Record->new_from_workflow($sales_quotation1, $target_record_type); |
80 | 80 |
|
81 |
SL::Model::Record->save($new_record); |
|
81 |
is($new_record->closed, 0, "new quotation is open"); |
|
82 |
# in the future closing sales quotations should probably happen as an after-save hook of orders, |
|
83 |
# but for now we copy the behaviour of the controller and pass the sales quotations as an argument |
|
84 |
SL::Model::Record->save($new_record, objects_to_close => [ $sales_quotation1 ]); |
|
85 |
|
|
82 | 86 |
$new_record->load; |
83 | 87 |
cmp_ok($new_record->netamount, '==', 710, "converted $target_record_type netamount ok") if $new_record->can('netamount'); |
88 |
|
|
89 |
# test whether quotations get closed when sales_order is created |
|
90 |
if ( $target_record_type eq 'sales_order' ) { |
|
91 |
$sales_quotation1->load; |
|
92 |
is($sales_quotation1->closed, 1, "quotation is closed after creating an order"); |
|
93 |
} |
|
94 |
|
|
95 |
# TODO: test whether orders get closed when all items are deliverd |
|
96 |
|
|
84 | 97 |
my $record_history = SL::DB::Manager::History->find_by(trans_id => $new_record->id, addition => 'SAVED'); |
85 | 98 |
ok($record_history->snumbers =~ m/_/, "history snumbers of record " . $record_history->snumbers . " ok"); |
86 | 99 |
test_record_links($new_record, "converted $target_record_type"); |
Auch abrufbar als: Unified diff
t/model/records - Angebot schließen nach Auftragserstellung testen