flash fixes on import

This commit is contained in:
Finn 2019-09-11 15:02:08 +01:00
parent c9e272e380
commit f33100ba87
3 changed files with 10 additions and 14 deletions

View file

@ -37,7 +37,9 @@ sub post_suppliers {
my $job_id = $c->minion->enqueue('csv_supplier_import' => [ $filename ]);
$c->flash(success => "CSV import started, see status of minion job at: " . $c->link_to( 'Minion Job', "/admin/minion/jobs?id=$job_id"));
my $job_url = $c->url_for("/admin/minion/jobs?id=$job_id")->to_abs;
$c->flash(success => "CSV import started, see status of minion job at: $job_url");
return $c->redirect_to('/admin/import_from');
}
@ -63,7 +65,9 @@ sub post_postcodes {
my $job_id = $c->minion->enqueue('csv_postcode_import' => [ $filename ]);
$c->flash(success => "CSV import started, see status of minion job at: " . $c->link_to( 'Minion Job', "/admin/minion/jobs?id=$job_id"));
my $job_url = $c->url_for("/admin/minion/jobs?id=$job_id")->to_abs;
$c->flash(success => "CSV import started, see status of minion job at: $job_url");
return $c->redirect_to('/admin/import_from');
}
@ -94,7 +98,9 @@ sub post_transactions {
my $job_id = $c->minion->enqueue('csv_transaction_import' => [ $filename, $c->param('entity_id') ]);
$c->flash(success => "CSV import started, see status of minion job at: " . $c->link_to( 'Minion Job', "/admin/minion/jobs?id=$job_id"));
my $job_url = $c->url_for("/admin/minion/jobs?id=$job_id")->to_abs;
$c->flash(success => "CSV import started, see status of minion job at: $job_url");
return $c->redirect_to('/admin/import_from');
}

View file

@ -87,7 +87,7 @@ sub _row_to_result {
pattern => '%m/%d/%Y',
time_zone => 'Europe/London'
);
my $paid_date = ( $row->{paid_date} ?
$date_formatter->parse_datetime($row->{paid_date}) :
$date_formatter->parse_datetime($row->{invoice_date}) );