my$svg=$dbh->selectrow_array('select data from invoice_templates where type = "svg" and reseller_id=?',undef,$provider_contract->{reseller_core_id});#is_active = 1 and
$dbh->do('insert into invoices(contract_id,period_start,period_end,serial)values(?,?,?,?)',undef,$contract_id,$stime->ymd,$stime->ymd,$serial_tmp);
$dbh->do('insert into invoices(contract_id,period_start,period_end,serial)values(?,?,?,?)',undef,$contract_id,$stime->ymd.' '.$stime->hms,$etime->ymd.' '.$etime->hms,$serial_tmp);