X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fhelper%2Fattr.t;h=cad0a0f9cf6b42eba79131fa4ae8abbae0393433;hb=05cb19d573c8e414f020bd1fef84e861651ff16c;hp=9f91865a427a6a321187a049b2119cdd438afc02;hpb=c616c9090b5e839938707d1ca3bf70b2de46b858;p=kivitendo-erp.git diff --git a/t/helper/attr.t b/t/helper/attr.t index 9f91865a4..cad0a0f9c 100644 --- a/t/helper/attr.t +++ b/t/helper/attr.t @@ -1,9 +1,10 @@ -use Test::More tests => 25; +use Test::More tests => 29; use DateTime; use_ok 'SL::DB::Part'; use_ok 'SL::DB::Order'; +use_ok 'SL::DB::Invoice'; use_ok 'SL::Dispatcher'; SL::Dispatcher::pre_startup_setup(); @@ -30,11 +31,20 @@ is($o->reqdate_as_date, '11.12.2007'); $o->reqdate(DateTime->new(year => 2010, month => 4, day => 12)); is($o->reqdate_as_date, '12.04.2010'); -is($o->marge_percent_as_percent('40'), '40,00'); +is($o->marge_percent_as_percent('40'), '40'); is($o->marge_percent, 0.40); -is($o->marge_percent_as_percent, '40,00'); +is($o->marge_percent_as_percent, '40'); is($o->marge_percent_as_percent('22,4'), '22,40'); is($o->marge_percent, 0.224); -is($o->marge_percent_as_percent, '22,40'); +is($o->marge_percent_as_percent, '22'); is($o->marge_percent(0.231), 0.231); -is($o->marge_percent_as_percent, '23,10'); +is($o->marge_percent_as_percent, '23'); + +# overloaded attr: invoice taxamount +my $i = new_ok 'SL::DB::Invoice'; + +is($i->taxamount_as_number, '0,00'); +$i->amount(12); +$i->netamount(10.34); +is($i->taxamount_as_number, '1,66'); +