MT#5879 Add date values for fix for invoice.serial unique index.

mr3.3.1
Irina Peshinskaya 11 years ago
parent a050e6777e
commit aa3fd246b6

@ -296,6 +296,7 @@ sub get_invoice{
my $serial_tmp = "tmp".time.int(rand(99999));
$dbh->do('insert into invoices(contract_id,period_start,period_end,serial)values(?,?,?,?)', undef, $contract_id,$stime->ymd, $stime->ymd, $serial_tmp );
$invoice->{id} = $dbh->last_insert_id(undef,'billing','invoices','id');
@$invoice{qw/period_start period_end/} = ($stime,$etime);
$invoice->{serial} = NGCP::Panel::Utils::Invoice::get_invoice_serial(undef,{invoice => $invoice});
$dbh->do('update invoices set serial=? where id=?', undef, @$invoice{qw/serial id/} );
$invoice = $dbh->selectrow_hashref('select * from invoices where id=?',undef, $invoice->{id});

Loading…
Cancel
Save