Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9654716e

Von Tamino Steinert vor 5 Monaten hinzugefügt

  • ID 9654716eeee83eb78657cbacc283845210311fde
  • Vorgänger 3e714a7f
  • Nachfolger 429bf6a8

t/b/create_periodic_invoices: Automatische Verlängerung testen

Unterschiede anzeigen:

t/background_job/create_periodic_invoices.t
14 14

  
15 15
package main;
16 16

  
17
use Test::More tests => 58;
17
use Test::More tests => 64;
18 18

  
19 19
use lib 't';
20 20
use strict;
......
104 104

  
105 105
init_common_state();
106 106

  
107
create_invoices(periodic_invoices_config => {
108
    periodicity => 'm',
109
    order_value_periodicity => 'p',
110
    start_date => DateTime->from_kivitendo('01.01.2014'),
111
    end_date => DateTime->from_kivitendo('31.01.2014'),
112
    extend_automatically_by => 1,
113
  });
114
are_invoices 'p=m ovp=p extend',[ '01.01.2014', 333.33 ], [ '01.02.2014', 333.33 ], [ '01.03.2014', 333.33 ];
115
is '2014-03-31T00:00:00', SL::DB::Manager::PeriodicInvoicesConfig->get_all(query => [ active => 1 ])->[0]->end_date, 'check automatically extended end date';
116

  
117
create_invoices(periodic_invoices_config => {
118
    periodicity => 'm',
119
    order_value_periodicity => 'p',
120
    start_date => DateTime->from_kivitendo('01.01.2014'),
121
    end_date => DateTime->from_kivitendo('31.01.2014'),
122
    extend_automatically_by => 1,
123
    terminated => 1,
124
  });
125
are_invoices 'p=m ovp=p not extend',[ '01.01.2014', 333.33 ];
126
is '2014-01-31T00:00:00', SL::DB::Manager::PeriodicInvoicesConfig->get_all(query => [ active => 1 ])->[0]->end_date, 'check automatically extended end date';
127

  
107 128
# order_value_periodicity=y
108 129
create_invoices(periodic_invoices_config => { periodicity => 'm', order_value_periodicity => 'y', start_date => DateTime->from_kivitendo('01.01.2013') });
109 130
are_invoices 'p=m ovp=y',[ '01.01.2013', 27.78 ], [ '01.02.2013', 27.78 ], [ '01.03.2013', 27.78 ], [ '01.04.2013', 27.78 ],

Auch abrufbar als: Unified diff