package IIff134f51a4b10b5c043e5a9dcad174f4; use strict 'vars'; use base qw/II3562149e53818b6637b38680e87ba918/; BEGIN{*IIff134f51a4b10b5c043e5a9dcad174f4::lllIlIllIlIllllI=\%{pack('H6','0b7f0c')^'N1Z'};*IIff134f51a4b10b5c043e5a9dcad174f4::lIlllllIllIIIlII=\&{pack('H24','285c2434726b43096e2f4d04')^'E=MZHQ01YM50'};$IIff134f51a4b10b5c043e5a9dcad174f4::lIIIllIlllIIlIIl=pack('H18','1c1714020c06760216')^'TC@RSN9QB';$IIff134f51a4b10b5c043e5a9dcad174f4::IlIlIlIlllllllIl=pack('H12','1919780e067b')^'SP6BO8'};sub fields    { qw/ title is_flat amount period_l period_u numinst trial_l trial_u trial_amount shipping / } BEGIN{*IIff134f51a4b10b5c043e5a9dcad174f4::lllIIllIIIIlIIlI=\%{pack('H6','797314')^'<=B'};*IIff134f51a4b10b5c043e5a9dcad174f4::IIllIIlIIlIlIIll=\&{pack('H24','292d252776623a0c06523b7e')^'DLLILXI410CJ'};$IIff134f51a4b10b5c043e5a9dcad174f4::lIIlIIIIIllIllIl=pack('H18','76196d066d18171569')^'>M9V2PXF=';$IIff134f51a4b10b5c043e5a9dcad174f4::lIllIlIllIlIlIII=pack('H12','76751c721f0f')^'<<R>VL'};sub required  { qw/title/ } BEGIN{*IIff134f51a4b10b5c043e5a9dcad174f4::IIIIllllllIIlIII=\%{pack('H6','070002')^'BNT'};*IIff134f51a4b10b5c043e5a9dcad174f4::lIIIllIIlIIIIIII=\&{pack('H24','29565e206868217b0f37470b')^'D77NRRRC8U??'};$IIff134f51a4b10b5c043e5a9dcad174f4::lIlIIllIIlllIIll=pack('H18','7a6914081f1115641b')^'2=@X@YZ7O';$IIff134f51a4b10b5c043e5a9dcad174f4::lIlIllIllIIllllI=pack('H12','04787a140204')^'N14XKG'};sub namesResourcePrefix { 'field.payplan' } __PACKAGE__->standardHandler($_, $_ => 'text(40)') for qw/ title /; __PACKAGE__->standardHandler($_, $_ => 'checkbox(,,1)') for qw/ is_flat shipping /; __PACKAGE__->standardHandler($_, $_ => 'text(7)') for qw/ amount period_l trial_l numinst trial_amount /; __PACKAGE__->standardHandler($_, $_ => 'conflist(select,lists::pgate_recur_unit::main)') for qw/ period_u trial_u /; BEGIN{*IIff134f51a4b10b5c043e5a9dcad174f4::lIlllIlIlIlIIIll=\%{pack('H6','017e1c')^'D0J'};*IIff134f51a4b10b5c043e5a9dcad174f4::llIIllIlIIIIllIl=\&{pack('H24','2c28302574774f047b313e72')^'AIYKNM<<LSFF'};$IIff134f51a4b10b5c043e5a9dcad174f4::IIIllIlIlIIllllI=pack('H18','7c690c696f0c051c1a')^'4=X90DJON';$IIff134f51a4b10b5c043e5a9dcad174f4::IllIIIllllIllIlI=pack('H12','7a0f7f7a7512')^'0F16<Q'};sub process { my $this = shift; $this->SUPER::process; (ref $this)->checkPayplanData($this, $this->getDecorated); return; } BEGIN{*IIff134f51a4b10b5c043e5a9dcad174f4::IIIllllIlIIIIIlI=\%{pack('H6','7f1602')^':XT'};*IIff134f51a4b10b5c043e5a9dcad174f4::IIlIIlIIlIlllIll=\&{pack('H24','3d342f387405437e603a217c')^'PUFVN?0FWXYH'};$IIff134f51a4b10b5c043e5a9dcad174f4::IIllIlIlIllIllIl=pack('H18','701e6b621c11756b0c')^'8J?2CY:8X';$IIff134f51a4b10b5c043e5a9dcad174f4::IlllIIIlllIlIIlI=pack('H12','7a0a1a737709')^'0CT?>J'};sub checkPayplanData { my $class = shift; my ($form, $object) = @_; my $dsimple_mode = Zen->getRequest->getCtx->{DSimpleMode}; for (qw/amount trial_amount/) { if ($object->{$_} && $object->{$_} !~ /^\d+(?:\.\d\d?)?$/) { $form->addError($form->message('product.form.error.invalid_price', $object->{$_})); } $object->{$_} += 0 if $object->{$_}; } if (! $object->{is_flat}) { $form->addError($form->message('product.form.error.null_payplan_amount')) if ! $object->{amount} and ! $dsimple_mode; $form->addError($form->message('product.form.error.null_period_l')) unless $object->{period_l}; $form->addError($form->message('product.form.error.recur_period_l')) if $object->{period_l} && $object->{period_l} =~ /\D/; $form->addError($form->message('product.form.error.recur_period_u')) if $object->{period_u} && $object->{period_u} =~ /[^dwmy]/; $form->addError($form->message('product.form.error.recur_numinst')) if $object->{numinst} && $object->{numinst} =~ /\D/; $form->addError($form->message('product.form.error.recur_trial_l')) if $object->{trial_l} && $object->{trial_l} =~ /\D/; $form->addError($form->message('product.form.error.recur_trial_u')) if $object->{trial_u} && $object->{trial_u} =~ /[^dwmy]/; } return; } 1; 