diff --git a/lib/Pear/LocalLoop.pm b/lib/Pear/LocalLoop.pm index fe1d6f4..3dad2b6 100644 --- a/lib/Pear/LocalLoop.pm +++ b/lib/Pear/LocalLoop.pm @@ -246,6 +246,8 @@ sub startup { $admin_routes->get('/import/:set_id/import')->to('admin-import#run_import'); $admin_routes->get('/import_from')->to('admin-import_from#index'); + $admin_routes->post('/import_from/suppliers')->to('admin-import_from#post_suppliers'); + $admin_routes->post('/import_from/transactions')->to('admin-import_from#post_transactions'); # my $user_routes = $r->under('/')->to('root#under'); diff --git a/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm b/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm index 66b1129..83a2d78 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm @@ -1,4 +1,26 @@ package Pear::LocalLoop::Controller::Admin::ImportFrom; use Mojo::Base 'Mojolicious::Controller'; +use Devel::Dwarn; -1; \ No newline at end of file +sub index { + my $c = shift; + + $c->app->max_request_size(1048576); +} + +sub post_suppliers { + my $c = shift; + + Dwarn "yahoo!"; + return $c->redirect_to( '/admin/import_from' ); +} + +sub post_transactions { + my $c = shift; + + Dwarn "yahoo!"; + $c->flash( success => "CSV imported!" ); + return $c->redirect_to( '/admin/import_from' ); +} + +1; diff --git a/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm b/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm index a9d2635..721c24a 100644 --- a/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm +++ b/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm @@ -5,6 +5,8 @@ extends qw/Pear::LocalLoop::Import::LCCCsv/; sub import { my $self = shift; + + $import = Pear::LocalLoop::Import::LCCCsv->new; } sub _row_to_result { @@ -13,4 +15,4 @@ sub _row_to_result { } -1; \ No newline at end of file +1; diff --git a/templates/admin/import_from/index.html.ep b/templates/admin/import_from/index.html.ep index e9b45f1..c9e0f51 100644 --- a/templates/admin/import_from/index.html.ep +++ b/templates/admin/import_from/index.html.ep @@ -17,15 +17,25 @@
Various import options depending on source. Each one is custom.
+Various import options depending on source. Each one is custom. For Creditor reports from LCC.