mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
disable the invoicing module from the UI config panel
This commit is contained in:
parent
537743a740
commit
2d628d8826
@ -83,8 +83,6 @@ angular.module('application', ['ngCookies', 'ngResource', 'ngSanitize', 'ui.rout
|
||||
|
||||
// Global config: if true, all payments will be disabled in the application for the members (only admins will be able to proceed reservations)
|
||||
$rootScope.fablabWithoutOnlinePayment = Fablab.withoutOnlinePayment;
|
||||
// Global config: if true, no invoices will be generated
|
||||
$rootScope.fablabWithoutInvoices = Fablab.withoutInvoices;
|
||||
// Global config: if true, user must confirm his email to sign in
|
||||
$rootScope.userConfirmationNeededToSignIn = Fablab.userConfirmationNeededToSignIn;
|
||||
// Global config: if true, wallet will be disabled
|
||||
|
@ -28,7 +28,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
|
||||
|
||||
// default active tab
|
||||
$scope.tabs = {
|
||||
active: Fablab.withoutInvoices ? 1 : 0
|
||||
active: settings.invoicing_module === 'true' ? 0 : 1
|
||||
};
|
||||
|
||||
// List of all invoices
|
||||
@ -612,7 +612,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
|
||||
orphan: true
|
||||
});
|
||||
}
|
||||
if (!Fablab.withoutInvoices && $scope.invoices.length > 0) {
|
||||
if (settings.invoicing_module === 'true' && $scope.invoices.length > 0) {
|
||||
uitour.createStep({
|
||||
selector: '.invoices-management .invoices-list',
|
||||
stepId: 'list',
|
||||
|
@ -676,7 +676,7 @@ Application.Controllers.controller('EditPricingController', ['$scope', '$state',
|
||||
content: _t('app.admin.tour.pricing.machines.content'),
|
||||
placement: 'bottom'
|
||||
});
|
||||
if ($scope.spacesModule) {
|
||||
if ($scope.modules.spaces) {
|
||||
uitour.createStep({
|
||||
selector: '.plans-pricing .spaces-tab',
|
||||
stepId: 'spaces',
|
||||
|
@ -179,9 +179,9 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state',
|
||||
*/
|
||||
$scope.hiddenTab = function (tab) {
|
||||
if (tab.table) {
|
||||
if ((tab.es_type_key === 'subscription') && !$rootScope.plansModule) {
|
||||
if ((tab.es_type_key === 'subscription') && !$rootScope.modules.plans) {
|
||||
return true;
|
||||
} else return (tab.es_type_key === 'space') && !$rootScope.spacesModule;
|
||||
} else return (tab.es_type_key === 'space') && !$rootScope.modules.spaces;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
|
||||
content: _t('app.public.tour.welcome.machines.content'),
|
||||
placement: 'right'
|
||||
});
|
||||
if ($scope.spacesModule) {
|
||||
if ($scope.modules.spaces) {
|
||||
uitour.createStep({
|
||||
selector: '.nav-primary li.reserve-space-link',
|
||||
stepId: 'spaces',
|
||||
|
@ -58,7 +58,7 @@ Application.Controllers.controller('MainNavController', ['$scope', function ($sc
|
||||
|
||||
];
|
||||
|
||||
if ($scope.plansModule) {
|
||||
if ($scope.modules.plans) {
|
||||
$scope.navLinks.push({
|
||||
state: 'app.public.plans',
|
||||
linkText: 'app.public.common.subscriptions',
|
||||
@ -67,7 +67,7 @@ Application.Controllers.controller('MainNavController', ['$scope', function ($sc
|
||||
});
|
||||
}
|
||||
|
||||
if ($scope.spacesModule) {
|
||||
if ($scope.modules.spaces) {
|
||||
$scope.navLinks.splice(4, 0, {
|
||||
state: 'app.public.spaces_list',
|
||||
linkText: 'app.public.common.reserve_a_space',
|
||||
@ -153,7 +153,7 @@ Application.Controllers.controller('MainNavController', ['$scope', function ($sc
|
||||
|
||||
$scope.adminNavLinks = adminNavLinks;
|
||||
|
||||
if ($scope.spacesModule) {
|
||||
if ($scope.modules.spaces) {
|
||||
return $scope.adminNavLinks.splice(3, 0, {
|
||||
state: 'app.public.spaces_list',
|
||||
linkText: 'app.public.common.manage_the_spaces',
|
||||
|
@ -37,17 +37,19 @@ angular.module('application.router', ['ui.router'])
|
||||
logoFile: ['CustomAsset', function (CustomAsset) { return CustomAsset.get({ name: 'logo-file' }).$promise; }],
|
||||
logoBlackFile: ['CustomAsset', function (CustomAsset) { return CustomAsset.get({ name: 'logo-black-file' }).$promise; }],
|
||||
sharedTranslations: ['Translations', function (Translations) { return Translations.query(['app.shared', 'app.public.common']).$promise; }],
|
||||
spacesModulePromise: ['Setting', function (Setting) { return Setting.get({ name: 'spaces_module' }).$promise; }],
|
||||
plansModulePromise: ['Setting', function (Setting) { return Setting.get({ name: 'plans_module' }).$promise; }]
|
||||
modulesPromise: ['Setting', function (Setting) { return Setting.query({ names: "['spaces_module', 'plans_module', 'invoicing_module']" }).$promise; }]
|
||||
},
|
||||
onEnter: ['$rootScope', 'logoFile', 'logoBlackFile', 'spacesModulePromise', 'plansModulePromise', 'CSRF', function ($rootScope, logoFile, logoBlackFile, spacesModulePromise, plansModulePromise, CSRF) {
|
||||
onEnter: ['$rootScope', 'logoFile', 'logoBlackFile', 'modulesPromise', 'CSRF', function ($rootScope, logoFile, logoBlackFile, modulesPromise, CSRF) {
|
||||
// Retrieve Anti-CSRF tokens from cookies
|
||||
CSRF.setMetaTags();
|
||||
// Application logo
|
||||
$rootScope.logo = logoFile.custom_asset;
|
||||
$rootScope.logoBlack = logoBlackFile.custom_asset;
|
||||
$rootScope.spacesModule = (spacesModulePromise.setting.value === 'true');
|
||||
$rootScope.plansModule = (plansModulePromise.setting.value === 'true');
|
||||
$rootScope.modules = {
|
||||
spaces: (modulesPromise.spaces_module === 'true'),
|
||||
plans: (modulesPromise.plans_module === 'true'),
|
||||
invoicing: (modulesPromise.invoicing_module === 'true'),
|
||||
};
|
||||
}]
|
||||
})
|
||||
.state('app.public', {
|
||||
@ -761,8 +763,7 @@ angular.module('application.router', ['ui.router'])
|
||||
spacesPromise: ['Space', function (Space) { return Space.query().$promise; }],
|
||||
spacesPricesPromise: ['Price', function (Price) { return Price.query({ priceable_type: 'Space', plan_id: 'null' }).$promise; }],
|
||||
spacesCreditsPromise: ['Credit', function (Credit) { return Credit.query({ creditable_type: 'Space' }).$promise; }],
|
||||
slotDurationPromise: ['Setting', function (Setting) { return Setting.get({ name: 'slot_duration' }).$promise; }],
|
||||
spacesModulePromise: ['Setting', function (Setting) { return Setting.get({ name: 'spaces_module' }).$promise; }]
|
||||
slotDurationPromise: ['Setting', function (Setting) { return Setting.get({ name: 'slot_duration' }).$promise; }]
|
||||
}
|
||||
})
|
||||
|
||||
@ -837,7 +838,7 @@ angular.module('application.router', ['ui.router'])
|
||||
return Setting.query({
|
||||
names: `['invoice_legals', 'invoice_text', 'invoice_VAT-rate', 'invoice_VAT-active', 'invoice_order-nb', 'invoice_code-value', \
|
||||
'invoice_code-active', 'invoice_reference', 'invoice_logo', 'accounting_journal_code', 'accounting_card_client_code', \
|
||||
'accounting_card_client_label', 'accounting_wallet_client_code', 'accounting_wallet_client_label', \
|
||||
'accounting_card_client_label', 'accounting_wallet_client_code', 'accounting_wallet_client_label', 'invoicing_module', \
|
||||
'accounting_other_client_code', 'accounting_other_client_label', 'accounting_wallet_code', 'accounting_wallet_label', \
|
||||
'accounting_VAT_code', 'accounting_VAT_label', 'accounting_subscription_code', 'accounting_subscription_label', \
|
||||
'accounting_Machine_code', 'accounting_Machine_label', 'accounting_Training_code', 'accounting_Training_label', \
|
||||
@ -1024,7 +1025,7 @@ angular.module('application.router', ['ui.router'])
|
||||
settingsPromise: ['Setting', function (Setting) {
|
||||
return Setting.query({
|
||||
names: `['twitter_name', 'about_title', 'about_body', 'tracking_id', \
|
||||
'privacy_body', 'privacy_dpo', 'about_contacts', 'book_overlapping_slots', \
|
||||
'privacy_body', 'privacy_dpo', 'about_contacts', 'book_overlapping_slots', 'invoicing_module', \
|
||||
'home_blogpost', 'machine_explications_alert', 'training_explications_alert', 'slot_duration', \
|
||||
'training_information_message', 'subscription_explications_alert', 'event_explications_alert', \
|
||||
'space_explications_alert', 'booking_window_start', 'booking_window_end', 'events_in_calendar', \
|
||||
|
@ -38,7 +38,7 @@
|
||||
<div class="legends">
|
||||
<span class="calendar-legend text-sm border-formation" translate>{{ 'app.admin.calendar.trainings' }}</span><br>
|
||||
<span class="calendar-legend text-sm border-machine" translate>{{ 'app.admin.calendar.machines' }}</span><br>
|
||||
<span class="calendar-legend text-sm border-space" ng-show="spacesModule" translate>{{ 'app.admin.calendar.spaces' }}</span>
|
||||
<span class="calendar-legend text-sm border-space" ng-show="modules.spaces" translate>{{ 'app.admin.calendar.spaces' }}</span>
|
||||
<span class="calendar-legend text-sm border-event" ng-show="eventsInCalendar" translate>{{ 'app.admin.calendar.events' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<span translate>{{ 'app.admin.calendar.machine' }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio" ng-show="spacesModule">
|
||||
<div class="radio" ng-show="modules.spaces">
|
||||
<label>
|
||||
<input type="radio" id="space" name="available_type" value="space" ng-model="availability.available_type" ng-disabled="spaces.length === 0">
|
||||
<span translate>{{ 'app.admin.calendar.space' }}</span>
|
||||
|
@ -30,7 +30,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12" ng-if="isAuthorized('admin')">
|
||||
<uib-tabset justified="true" active="tabs.active">
|
||||
<uib-tab heading="{{ 'app.admin.invoices.invoices_list' | translate }}" ng-hide="fablabWithoutInvoices" index="0">
|
||||
<uib-tab heading="{{ 'app.admin.invoices.invoices_list' | translate }}" ng-show="modules.invoicing" index="0">
|
||||
<ng-include src="'<%= asset_path "admin/invoices/list.html" %>'"></ng-include>
|
||||
</uib-tab>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="alert alert-warning p-md m-t" role="alert" ng-show="fablabWithoutInvoices">
|
||||
<div class="alert alert-warning p-md m-t" role="alert" ng-hide="modules.invoicing">
|
||||
<i class="fa fa-warning m-r"></i>
|
||||
<span translate>{{ 'app.admin.invoices.warning_invoices_disabled' }}</span>
|
||||
</div>
|
||||
|
@ -60,7 +60,7 @@
|
||||
</form>
|
||||
</uib-tab>
|
||||
|
||||
<uib-tab heading="{{ 'app.admin.members_edit.subscription' | translate }}" ng-if="plansModule">
|
||||
<uib-tab heading="{{ 'app.admin.members_edit.subscription' | translate }}" ng-if="modules.plans">
|
||||
|
||||
|
||||
<section class="panel panel-default bg-light m-lg">
|
||||
@ -192,7 +192,7 @@
|
||||
</div>
|
||||
</uib-tab>
|
||||
|
||||
<uib-tab heading="{{ 'app.admin.members_edit.invoices' | translate }}" ng-hide="fablabWithoutInvoices">
|
||||
<uib-tab heading="{{ 'app.admin.members_edit.invoices' | translate }}" ng-show="modules.invoicing">
|
||||
<div class="col-md-12 m m-t-lg">
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
<a class="btn btn-default" ng-href="api/members/export_members.xlsx" target="export-frame" ng-click="alertExport('members')">
|
||||
<i class="fa fa-file-excel-o"></i> {{ 'app.admin.members.members' | translate }}
|
||||
</a>
|
||||
<a class="btn btn-default" ng-href="api/members/export_subscriptions.xlsx" target="export-frame" ng-if="plansModule" ng-click="alertExport('subscriptions')">
|
||||
<a class="btn btn-default" ng-href="api/members/export_subscriptions.xlsx" target="export-frame" ng-if="modules.plans" ng-click="alertExport('subscriptions')">
|
||||
<i class="fa fa-file-excel-o"></i> {{ 'app.admin.members.subscriptions' | translate }}
|
||||
</a>
|
||||
<a class="btn btn-default" ng-href="api/members/export_reservations.xlsx" target="export-frame" ng-click="alertExport('reservations')">
|
||||
|
@ -73,8 +73,8 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3 ng-show="spacesModule" translate>{{ 'app.admin.plans.edit.spaces' }}</h3>
|
||||
<table class="table" ng-show="spacesModule">
|
||||
<h3 ng-show="modules.spaces" translate>{{ 'app.admin.plans.edit.spaces' }}</h3>
|
||||
<table class="table" ng-show="modules.spaces">
|
||||
<thead>
|
||||
<th translate>{{ 'app.admin.plans.edit.space' }}</th>
|
||||
<th translate>{{ 'app.admin.plans.edit.hourly_rate' }}</th>
|
||||
|
@ -96,11 +96,11 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 ng-show="spacesModule" class="m-t-lg" translate>{{ 'app.admin.pricing.spaces' }}</h2>
|
||||
<div ng-show="spacesModule" class="btn-group m-t-md m-b-md">
|
||||
<h2 ng-show="modules.spaces" class="m-t-lg" translate>{{ 'app.admin.pricing.spaces' }}</h2>
|
||||
<div ng-show="modules.spaces" class="btn-group m-t-md m-b-md">
|
||||
<button type="button" class="btn btn-warning" ng-click="addSpaceCredit($event)" translate>{{ 'app.admin.pricing.add_a_space_credit' }}</button>
|
||||
</div>
|
||||
<table ng-show="spacesModule" class="table">
|
||||
<table ng-show="modules.spaces" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:20%" translate>{{ 'app.admin.pricing.space' }}</th>
|
||||
|
@ -39,7 +39,7 @@
|
||||
<ng-include src="'<%= asset_path "admin/pricing/machine_hours.html" %>'"></ng-include>
|
||||
</uib-tab>
|
||||
|
||||
<uib-tab heading="{{ 'app.admin.pricing.spaces' | translate }}" ng-show="spacesModule" index="3" class="spaces-tab">
|
||||
<uib-tab heading="{{ 'app.admin.pricing.spaces' | translate }}" ng-show="modules.spaces" index="3" class="spaces-tab">
|
||||
<ng-include src="'<%= asset_path "admin/pricing/spaces.html" %>'"></ng-include>
|
||||
</uib-tab>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<h2 translate>{{ 'app.admin.pricing.list_of_the_subscription_plans' }}</h2>
|
||||
|
||||
<div ng-hide="plansModule"
|
||||
<div ng-hide="modules.plans"
|
||||
class="alert alert-warning m-t"
|
||||
ng-bind-html="'app.admin.pricing.disabled_plans_info_html' | translate">
|
||||
</div>
|
||||
|
@ -94,7 +94,7 @@
|
||||
</div>
|
||||
<button name="button" class="btn btn-warning" ng-click="save(eventExplicationsAlert)" translate>{{ 'app.shared.buttons.save' }}</button>
|
||||
</div>
|
||||
<div class="col-md-3" ng-show="spacesModule">
|
||||
<div class="col-md-3" ng-show="modules.spaces">
|
||||
<h4 translate>{{ 'app.admin.settings.message_of_the_spaces_page' }}</h4>
|
||||
<div ng-model="spaceExplicationsAlert.value" medium-editor options='{"placeholder": "{{ "app.admin.settings.type_the_message_content" | translate }}",
|
||||
"buttons": ["bold", "italic", "unorderedlist", "header2" ]
|
||||
@ -374,5 +374,15 @@
|
||||
yes-label="app.shared.buttons.yes"
|
||||
no-label="app.shared.buttons.no"></boolean-setting>
|
||||
</div>
|
||||
<div class="row">
|
||||
<h3 class="m-l" translate>{{ 'app.admin.settings.invoicing' }}</h3>
|
||||
<p class="alert alert-warning m-h-md" ng-bind-html="'app.admin.settings.invoicing_info_html' | translate"></p>
|
||||
<boolean-setting name="invoicing_module"
|
||||
settings="allSettings"
|
||||
label="app.admin.settings.enable_invoicing"
|
||||
classes="m-l"
|
||||
yes-label="app.shared.buttons.yes"
|
||||
no-label="app.shared.buttons.no"></boolean-setting>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -102,7 +102,7 @@
|
||||
</form>
|
||||
|
||||
<uib-tabset justified="true">
|
||||
<uib-tab ng-repeat="stat in statistics" heading="{{stat.label}}" select="setActiveTab(stat)" ng-if="stat.graph && !(stat.es_type_key == 'subscription' && plansModule)" class="row">
|
||||
<uib-tab ng-repeat="stat in statistics" heading="{{stat.label}}" select="setActiveTab(stat)" ng-if="stat.graph && !(stat.es_type_key == 'subscription' && modules.plans)" class="row">
|
||||
|
||||
<div ng-if="stat.graph.chart_type == 'discreteBarChart'">
|
||||
<div id="rankingFilters">
|
||||
|
@ -18,7 +18,7 @@
|
||||
<input class="col-md-1 col-sm-1 col-xs-1" type="checkbox" ng-model="m.checked" ng-change="filterAvailabilities(filter)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-t" ng-show="spacesModule">
|
||||
<div class="m-t" ng-show="modules.spaces">
|
||||
<div class="row">
|
||||
<h3 class="col-md-11 col-sm-11 col-xs-11 text-cyan" translate>{{ 'app.public.calendar.spaces' }}</h3>
|
||||
<input class="col-md-1 col-sm-1 col-xs-1" type="checkbox" ng-model="filter.spaces" ng-change="toggleFilter('spaces', filter)">
|
||||
|
@ -15,7 +15,7 @@
|
||||
<li ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.projects" translate>{{ 'app.public.common.my_projects' }}</a></li>
|
||||
<li ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.trainings" translate>{{ 'app.public.common.my_trainings' }}</a></li>
|
||||
<li ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.events" translate>{{ 'app.public.common.my_events' }}</a></li>
|
||||
<li ui-sref-active="active" ng-hide="fablabWithoutInvoices"><a class="text-black" href="#" ui-sref="app.logged.dashboard.invoices" translate>{{ 'app.public.common.my_invoices' }}</a></li>
|
||||
<li ui-sref-active="active" ng-show="modules.invoicing"><a class="text-black" href="#" ui-sref="app.logged.dashboard.invoices" translate>{{ 'app.public.common.my_invoices' }}</a></li>
|
||||
<li ng-hide="fablabWithoutWallet" ui-sref-active="active"><a class="text-black" href="#" ui-sref="app.logged.dashboard.wallet" translate>{{ 'app.public.common.my_wallet' }}</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
@ -34,7 +34,7 @@
|
||||
<button class="btn btn-success m-t" ng-click="selectGroup()">Changer mon groupe</button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="plansModule">
|
||||
<div ng-show="modules.plans">
|
||||
<h3 class="text-u-c" translate>{{ 'app.logged.dashboard.settings.subscription' }}</h3>
|
||||
<div ng-show="user.subscribed_plan">
|
||||
<uib-alert type="warning">
|
||||
|
@ -19,7 +19,7 @@
|
||||
<div class="row no-gutter machine-reserve">
|
||||
<div class="col-sm-12 col-md-12 col-lg-9">
|
||||
<div ui-calendar="calendarConfig" ng-model="eventSources" calendar="calendar" class="wrapper-lg" ng-show="!plansAreShown"></div>
|
||||
<ng-include ng-if="plansModule" src="'<%= asset_path "plans/_plan.html" %>'"></ng-include>
|
||||
<ng-include ng-if="modules.plans" src="'<%= asset_path "plans/_plan.html" %>'"></ng-include>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
|
||||
<coupon show="isSlotsValid() && (!modePlans || selectedPlan)" coupon="coupon.applied" total="totalNoCoupon" user-id="{{user.id}}"></coupon>
|
||||
|
||||
<div ng-show="plansModule">
|
||||
<div ng-show="modules.plans">
|
||||
<div ng-if="isSlotsValid() && !user.subscribed_plan" ng-show="!modePlans">
|
||||
<p class="font-sbold text-base l-h-2x" translate>{{ 'app.shared.cart.to_benefit_from_attractive_prices' }}</p>
|
||||
<div><button class="btn btn-warning-full rounded btn-block text-xs" ng-click="showPlans()" translate>{{ 'app.shared.cart.view_our_subscriptions' }}</button></div>
|
||||
|
@ -38,7 +38,7 @@
|
||||
<li><a ui-sref="app.logged.dashboard.projects" translate>{{ 'app.public.common.my_projects' }}</a></li>
|
||||
<li><a ui-sref="app.logged.dashboard.trainings" translate>{{ 'app.public.common.my_trainings' }}</a></li>
|
||||
<li><a ui-sref="app.logged.dashboard.events" translate>{{ 'app.public.common.my_events' }}</a></li>
|
||||
<li><a ui-sref="app.logged.dashboard.invoices" ng-hide="fablabWithoutInvoices" translate>{{ 'app.public.common.my_invoices' }}</a></li>
|
||||
<li><a ui-sref="app.logged.dashboard.invoices" ng-show="modules.invoicing" translate>{{ 'app.public.common.my_invoices' }}</a></li>
|
||||
<li ng-hide="fablabWithoutWallet"><a ui-sref="app.logged.dashboard.wallet" translate>{{ 'app.public.common.my_wallet' }}</a></li>
|
||||
<li class="divider" ng-if="isAuthorized(['admin', 'manager'])"></li>
|
||||
<li><a class="text-black pointer" ng-click="help($event)" ng-if="isAuthorized(['admin', 'manager'])"><i class="fa fa-question-circle"></i> <span translate>{{ 'app.public.common.help' }}</span> </a></li>
|
||||
|
@ -56,7 +56,7 @@
|
||||
<i class="fa fa-calendar-o"></i> <span translate>{{ 'app.public.common.my_events' }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="hidden-sm hidden-md hidden-lg" ng-hide="fablabWithoutInvoices" ng-if-end>
|
||||
<li class="hidden-sm hidden-md hidden-lg" ng-show="modules.invoicing" ng-if-end>
|
||||
<a ui-sref="app.logged.dashboard.invoices">
|
||||
<i class="fa fa-file-pdf-o"></i> <span translate>{{ 'app.public.common.my_invoices' }}</span>
|
||||
</a>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<div class="row no-gutter training-reserve">
|
||||
<div class="col-sm-12 col-md-12 col-lg-9">
|
||||
<div ui-calendar="calendarConfig" ng-model="eventSources" calendar="calendar" class="wrapper-lg" ng-show="!plansAreShown"></div>
|
||||
<ng-include ng-if="plansModule" src="'<%= asset_path "plans/_plan.html" %>'"></ng-include>
|
||||
<ng-include ng-if="modules.plans" src="'<%= asset_path "plans/_plan.html" %>'"></ng-include>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
<div class="row no-gutter training-reserve">
|
||||
<div class="col-sm-12 col-md-12 col-lg-9">
|
||||
<div ui-calendar="calendarConfig" ng-model="eventSources" calendar="calendar" class="wrapper-lg" ng-show="!plansAreShown"></div>
|
||||
<ng-include ng-if="plansModule" src="'<%= asset_path "plans/_plan.html" %>'"></ng-include>
|
||||
<ng-include ng-if="modules.plans" src="'<%= asset_path "plans/_plan.html" %>'"></ng-include>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
<div class="text-right m-t" ng-hide="fablabWithoutInvoices">
|
||||
<div class="text-right m-t" ng-show="modules.invoicing">
|
||||
<label for="generate_avoir" translate>{{ 'app.shared.wallet.generate_a_refund_invoice' }}</label>
|
||||
<div class="inline m-l">
|
||||
<input bs-switch
|
||||
|
@ -188,7 +188,7 @@ class Invoice < ApplicationRecord
|
||||
private
|
||||
|
||||
def generate_and_send_invoice
|
||||
return if Rails.application.secrets.fablab_without_invoices == 'true'
|
||||
return unless Setting.get('invoicing_module')
|
||||
|
||||
unless Rails.env.test?
|
||||
puts "Creating an InvoiceWorker job to generate the following invoice: id(#{id}), invoiced_id(#{invoiced_id}), " \
|
||||
|
@ -82,7 +82,8 @@ class Setting < ApplicationRecord
|
||||
slot_duration
|
||||
events_in_calendar
|
||||
spaces_module
|
||||
plans_module] }
|
||||
plans_module
|
||||
invoicing_module] }
|
||||
def value
|
||||
last_value = history_values.order(HistoryValue.arel_table['created_at'].desc).first
|
||||
last_value&.value
|
||||
|
@ -42,7 +42,7 @@ class HealthService
|
||||
plans: Settings.get('plans_module'),
|
||||
spaces: Setting.get('spaces_module'),
|
||||
online_payment: !Rails.application.secrets.fablab_without_online_payments,
|
||||
invoices: !Rails.application.secrets.fablab_without_invoices,
|
||||
invoices: Setting.get('invoicing_module'),
|
||||
openlab: Rails.application.secrets.openlab_app_secret.present?
|
||||
}
|
||||
end
|
||||
|
@ -26,7 +26,6 @@
|
||||
Fablab.plansModule = ('<%= Setting.get('plans_module') %>' === 'true');
|
||||
Fablab.spacesModule = ('<%= Setting.get('spaces_module') %>' === 'true');
|
||||
Fablab.withoutOnlinePayment = ('<%= Rails.application.secrets.fablab_without_online_payments %>' === 'true');
|
||||
Fablab.withoutInvoices = ('<%= Rails.application.secrets.fablab_without_invoices %>' === 'true');
|
||||
Fablab.fablabWithoutWallet = ('<%= Rails.application.secrets.fablab_without_wallet %>' === 'true');
|
||||
Fablab.featureTourDisplay = "<%= Rails.application.secrets.feature_tour_display %>";
|
||||
Fablab.disqusShortname = "<%= Rails.application.secrets.disqus_shortname %>";
|
||||
|
@ -271,9 +271,6 @@ en:
|
||||
trainings: "Trainings"
|
||||
list_of_the_subscription_plans: "List of the subscription plans"
|
||||
disabled_plans_info_html: "<p><strong>Warning:</strong> the subscriptions are disabled on this application.</p><p>You can still create some, but they won't be available until the activation of the plans module, from the « Customization » section.</p>"
|
||||
beware_the_subscriptions_are_disabled_on_this_application: "Beware, the subscriptions are disabled on this application."
|
||||
you_can_create_some_but_they_wont_be_available_until_the_project_is_redeployed_by_the_server_manager: "You can create some but they won't be available until the project is redeployed by the server manager."
|
||||
for_safety_reasons_please_dont_create_subscriptions_if_you_dont_want_intend_to_use_them_later: "For safety reasons, please don't create subscriptions if you don't intend to use them later."
|
||||
add_a_new_subscription_plan: "Add a new subscription plan"
|
||||
type: "Type"
|
||||
partner: "Partner"
|
||||
@ -1050,6 +1047,10 @@ en:
|
||||
plans_info_html: "<p>Subscriptions provide a way to segment your prices and provide benefits to regular users.</p><p><strong>Warning:</strong> It is not recommended to disable plans if at least one subscription is active on the system.</p>"
|
||||
enable_plans: "Enable the plans"
|
||||
plans_module: "plans module"
|
||||
invoicing: "Invoicing"
|
||||
invoicing_info_html: "<p>You can fully disable the invoicing module.</p><p>This is useful if you have your own invoicing system, and you don't want Fab-manager generates and sends invoices to the members.</p><p><strong>Warning:</strong> even if you disable the invoicing module, you must to configure the VAT to prevent errors in accounting and prices. Do it from the « Invoices > Invoicing settings » section.</p>"
|
||||
enable_invoicing: "Enable invoicing"
|
||||
invoicing_module: "invoicing module"
|
||||
sort_by:
|
||||
default: "Default"
|
||||
name: "Name"
|
||||
|
@ -1047,6 +1047,10 @@ fr:
|
||||
plans_info_html: "<p>Les abonnements offrent un moyen de segmenter vos tarifs et d'accorder des avantages aux utilisateurs réguliers.</p><p><strong>Attention :</strong> Il n'est pas recommandé de désactiver les abonnements si au moins un abonnement est en cours.</p>"
|
||||
enable_plans: "Activer les abonnements"
|
||||
plans_module: "module abonnements"
|
||||
invoicing: "Facturation"
|
||||
invoicing_info_html: "<p>Vous pouvez complètement désactiver le module de facturation.</p><p>Cela est utile si vous possédez votre propre système de facturation, et que vous ne souhaitez pas que Fab-manager génère et envoie des factures aux membres.</p><p><strong>Attention :</strong> même si vous désactivez le module de facturation, vous devez configurer la TVA pour éviter des erreurs de prix et de comptabilité. Faites le depuis la section « Factures > Paramètres de facturation ».</p>"
|
||||
enable_invoicing: "Activer la facturation"
|
||||
invoicing_module: "module de facturation"
|
||||
sort_by:
|
||||
default: "Défaut"
|
||||
name: "Nom"
|
||||
|
@ -17,7 +17,6 @@ development:
|
||||
stripe_currency: <%= ENV["STRIPE_CURRENCY"] %>
|
||||
disqus_shortname: <%= ENV["DISQUS_SHORTNAME"] %>
|
||||
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
|
||||
fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %>
|
||||
fablab_without_wallet: <%= ENV["FABLAB_WITHOUT_WALLET"] %>
|
||||
user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
|
||||
feature_tour_display: <%= ENV["FEATURE_TOUR_DISPLAY"] %>
|
||||
@ -59,7 +58,6 @@ test:
|
||||
stripe_currency: usd
|
||||
disqus_shortname: fablab-sleede
|
||||
fablab_without_online_payments: false
|
||||
fablab_without_invoices: false
|
||||
fablab_without_wallet: false
|
||||
user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
|
||||
feature_tour_display: <%= ENV["FEATURE_TOUR_DISPLAY"] %>
|
||||
@ -101,7 +99,6 @@ staging:
|
||||
stripe_currency: <%= ENV["STRIPE_CURRENCY"] %>
|
||||
disqus_shortname: <%= ENV["DISQUS_SHORTNAME"] %>
|
||||
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
|
||||
fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %>
|
||||
fablab_without_wallet: <%= ENV["FABLAB_WITHOUT_WALLET"] %>
|
||||
user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
|
||||
feature_tour_display: <%= ENV["FEATURE_TOUR_DISPLAY"] %>
|
||||
@ -154,7 +151,6 @@ production:
|
||||
stripe_currency: <%= ENV["STRIPE_CURRENCY"] %>
|
||||
disqus_shortname: <%= ENV["DISQUS_SHORTNAME"] %>
|
||||
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
|
||||
fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %>
|
||||
fablab_without_wallet: <%= ENV["FABLAB_WITHOUT_WALLET"] %>
|
||||
user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
|
||||
feature_tour_display: <%= ENV["FEATURE_TOUR_DISPLAY"] %>
|
||||
|
@ -851,6 +851,10 @@ Setting.set('slot_duration', 60) unless Setting.find_by(name: 'slot_duration').t
|
||||
|
||||
Setting.set('spaces_module', false) unless Setting.find_by(name: 'spaces_module').try(:value)
|
||||
|
||||
Setting.set('plans_module', true) unless Setting.find_by(name: 'plans_module').try(:value)
|
||||
|
||||
Setting.set('invoicing_module', true) unless Setting.find_by(name: 'invoicing_module').try(:value)
|
||||
|
||||
if StatisticCustomAggregation.count.zero?
|
||||
# available reservations hours for machines
|
||||
machine_hours = StatisticType.find_by(key: 'hour', statistic_index_id: 2)
|
||||
|
@ -87,13 +87,6 @@ The PDF file name will be of the form "(INVOICE_PREFIX) - (invoice ID) _ (invoic
|
||||
|
||||
If set to 'true', the online payment won't be available and the you'll be only able to process reservations when logged as admin.
|
||||
Valid stripe API keys are still required, even if you don't require online payments.
|
||||
<a name="FABLAB_WITHOUT_INVOICES"></a>
|
||||
|
||||
FABLAB_WITHOUT_INVOICES
|
||||
|
||||
If set to 'true', the invoices will be disabled.
|
||||
This is useful if you have your own invoicing system and you want to prevent Fab-manager from generating and sending invoices to members.
|
||||
**Very important**: if you disable invoices, you still have to configure VAT in the interface to prevent errors in accounting and prices.
|
||||
<a name="FABLAB_WITHOUT_WALLET"></a>
|
||||
|
||||
FABLAB_WITHOUT_WALLET
|
||||
|
@ -17,7 +17,6 @@ INVOICE_PREFIX=Demo-FabLab_facture
|
||||
|
||||
# FabLab optional modules
|
||||
FABLAB_WITHOUT_ONLINE_PAYMENT=false
|
||||
FABLAB_WITHOUT_INVOICES=false
|
||||
PHONE_REQUIRED=true
|
||||
FABLAB_WITHOUT_WALLET=false
|
||||
|
||||
|
@ -112,7 +112,8 @@ namespace :fablab do
|
||||
%w[_ SLOT_DURATION slot_duration 60],
|
||||
%w[_ EVENTS_IN_CALENDAR events_in_calendar false],
|
||||
%w[! FABLAB_WITHOUT_SPACES spaces_module true],
|
||||
%w[! FABLAB_WITHOUT_PLANS plans_module false]
|
||||
%w[! FABLAB_WITHOUT_PLANS plans_module false],
|
||||
%w[! FABLAB_WITHOUT_INVOICES invoicing_module false]
|
||||
]
|
||||
|
||||
mapping.each do |m|
|
||||
|
@ -10,7 +10,6 @@ STRIPE_CURRENCY=eur
|
||||
|
||||
INVOICE_PREFIX=Demo-FabLab_facture
|
||||
FABLAB_WITHOUT_ONLINE_PAYMENT=false
|
||||
FABLAB_WITHOUT_INVOICES=false
|
||||
PHONE_REQUIRED=false
|
||||
FABLAB_WITHOUT_WALLET=false
|
||||
|
||||
|
@ -234,7 +234,7 @@ configure_env_file()
|
||||
|
||||
local doc variables secret
|
||||
doc=$(\curl -sSL https://raw.githubusercontent.com/sleede/fab-manager/master/doc/environment.md)
|
||||
variables=(STRIPE_API_KEY STRIPE_PUBLISHABLE_KEY STRIPE_CURRENCY INVOICE_PREFIX FABLAB_WITHOUT_ONLINE_PAYMENT FABLAB_WITHOUT_INVOICES FABLAB_WITHOUT_WALLET \
|
||||
variables=(STRIPE_API_KEY STRIPE_PUBLISHABLE_KEY STRIPE_CURRENCY INVOICE_PREFIX FABLAB_WITHOUT_ONLINE_PAYMENT FABLAB_WITHOUT_WALLET \
|
||||
USER_CONFIRMATION_NEEDED_TO_SIGN_IN DEFAULT_MAIL_FROM DELIVERY_METHOD DEFAULT_HOST DEFAULT_PROTOCOL SMTP_ADDRESS SMTP_PORT SMTP_USER_NAME SMTP_PASSWORD SMTP_AUTHENTICATION \
|
||||
SMTP_ENABLE_STARTTLS_AUTO SMTP_OPENSSL_VERIFY_MODE SMTP_TLS RECAPTCHA_SITE_KEY RECAPTCHA_SECRET_KEY DISQUS_SHORTNAME TWITTER_NAME \
|
||||
FACEBOOK_APP_ID LOG_LEVEL ALLOWED_EXTENSIONS ALLOWED_MIME_TYPES MAX_IMAGE_SIZE MAX_CAO_SIZE MAX_IMPORT_SIZE DISK_SPACE_MB_ALERT FEATURE_TOUR_DISPLAY \
|
||||
|
Loading…
Reference in New Issue
Block a user