Hello again. I've lost hope to solve by myself. I've created payment schedule
...
$f->setDefaults(array('contract'=>$r['id'],'payment_amount'=>($r['premium']/$r['payments_per_period']),'count'=>$r['payments_per_period'],'payment_commission_rate'=>$r['commission_rate____']));
$f->addElement('text', 'count', __('Payments per period')); // add input to choose number
$f->addRule('count', __('Only integer numbers are allowed.'), 'regex', '/^[0-9]*$/');
$f->addElement('text', 'contract', __('Contract ID'));
$f->addElement('datepicker','payment_date', __('Payment Date'));
$f->addElement('currency','payment_amount', __('Payment Amount'));
$f->addElement('text', 'payment_commission_rate', __('Payment commission rate'));
$f->addElement('submit','submit',__('Create Schedule'));
$ff->addElement('submit','delete',__('Delete Schedule')); // delete button
if ($f->validate() && $f->exportValue('submited')) {
$values = $f->exportValues();
for ($i = 0; $i < $values['count']; $i++) {
$rs->new_record($values);
}
...
, everything works fine. What I need is, that 'payment_date' would be filled with increased date: for ex. contract period 1 year, 4 payments, so first "payment_date' equals contract date and every other is increased by 1year/4 (or 3 months). Did I explained clear? Thank for Your help in advance.