diff --git a/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm b/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm index 7a42d10..69ce211 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm @@ -41,6 +41,7 @@ sub add_org_submit { $validation->optional('postcode')->postcode; $validation->optional('pending'); $validation->optional('is_local'); + $validation->optional('is_fair'); if ( $validation->has_error ) { $c->flash( error => 'The validation has failed' ); @@ -60,6 +61,7 @@ sub add_org_submit { submitted_by_id => $c->current_user->id, pending => defined $validation->param('pending') ? 0 : 1, is_local => $validation->param('is_local'), + is_fair => $validation->param('is_fair'), }, type => 'organisation', }); @@ -78,7 +80,7 @@ sub add_org_submit { sub valid_read { my $c = shift; my $valid_org = $c->schema->resultset('Organisation')->find( $c->param('id') ); - my $transactions = $valid_org->entity->sales->search( + my $transactions = $valid_org->entity->purchases->search( undef, { page => $c->param('page') || 1, rows => 10, @@ -109,6 +111,7 @@ sub valid_edit { $validation->required('postcode')->postcode; $validation->optional('pending'); $validation->optional('is_local'); + $validation->optional('is_fair'); $validation->optional('is_lis'); $validation->optional('is_esta'); @@ -129,6 +132,7 @@ sub valid_edit { postcode => $validation->param('postcode'), pending => defined $validation->param('pending') ? 0 : 1, is_local => $validation->param('is_local'), + is_fair => $validation->param('is_fair'), }); $valid_org->entity->update_or_create_related( 'associations', { lis => $validation->param('is_lis'), diff --git a/templates/admin/organisations/add_org.html.ep b/templates/admin/organisations/add_org.html.ep index be22d3c..7a964a8 100644 --- a/templates/admin/organisations/add_org.html.ep +++ b/templates/admin/organisations/add_org.html.ep @@ -55,6 +55,24 @@ +