projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Anpassung Erfolgsrechnung
[kivitendo-erp.git]
/
t
/
controllers
/
financial_controlling
/
sales_order_with_periodic_invoices_config.t
diff --git
a/t/controllers/financial_controlling/sales_order_with_periodic_invoices_config.t
b/t/controllers/financial_controlling/sales_order_with_periodic_invoices_config.t
index
1dab1e8
..
8541cb7
100644
(file)
--- a/
t/controllers/financial_controlling/sales_order_with_periodic_invoices_config.t
+++ b/
t/controllers/financial_controlling/sales_order_with_periodic_invoices_config.t
@@
-37,6
+37,10
@@
Support::TestSetup::login();
our ($ar_chart, $buchungsgruppe, $ctrl, $currency_id, $customer, $employee, $order, $part, $tax_zone, $unit, @invoices);
our ($ar_chart, $buchungsgruppe, $ctrl, $currency_id, $customer, $employee, $order, $part, $tax_zone, $unit, @invoices);
+sub cleanup {
+ "SL::DB::Manager::${_}"->delete_all(all => 1) for qw(InvoiceItem Invoice OrderItem Order Customer Part);
+}
+
sub init_common_state {
$ar_chart = SL::DB::Manager::Chart->find_by(accno => '1400') || croak "No AR chart";
$buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group";
sub init_common_state {
$ar_chart = SL::DB::Manager::Chart->find_by(accno => '1400') || croak "No AR chart";
$buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group";
@@
-49,10
+53,9
@@
sub init_common_state {
sub create_sales_order {
my %params = @_;
sub create_sales_order {
my %params = @_;
-
$params{$_} ||= {} for qw(customer part tax order orderitem
);
+
cleanup(
);
- # Clean up: remove invoices, orders, parts and customers
- "SL::DB::Manager::${_}"->delete_all(all => 1) for qw(InvoiceItem Invoice OrderItem Order Customer Part);
+ $params{$_} ||= {} for qw(customer part tax order orderitem);
$customer = SL::DB::Customer->new(
name => 'Test Customer',
$customer = SL::DB::Customer->new(
name => 'Test Customer',
@@
-66,6
+69,7
@@
sub create_sales_order {
description => 'Fourty-two fifty-four',
lastcost => 222.22,
sellprice => 333.33,
description => 'Fourty-two fifty-four',
lastcost => 222.22,
sellprice => 333.33,
+ part_type => 'part',
buchungsgruppen_id => $buchungsgruppe->id,
unit => $unit->name,
%{ $params{part} }
buchungsgruppen_id => $buchungsgruppe->id,
unit => $unit->name,
%{ $params{part} }
@@
-100,7
+104,7
@@
sub create_sales_order {
ok($order->save(cascade => 1));
ok($order->save(cascade => 1));
- $::form =
Form->new('')
;
+ $::form =
Support::TestSetup->create_new_form
;
$ctrl = SL::Controller::FinancialControllingReport->new;
$ctrl->orders($ctrl->models->get);
$ctrl = SL::Controller::FinancialControllingReport->new;
$ctrl->orders($ctrl->models->get);
@@
-544,5
+548,6
@@
run_tests(
end_date => DateTime->from_kivitendo('30.04.2014'),
});
end_date => DateTime->from_kivitendo('30.04.2014'),
});
+cleanup();
done_testing();
done_testing();