From 6f3a1d0c6acdb11c7d6537fe68f5db8bc2dec5a9 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 26 Aug 2020 11:35:27 +0200 Subject: [PATCH 1/4] [bug] unable to run task find_incoherent_invoices --- CHANGELOG.md | 2 ++ lib/tasks/fablab/stripe.rake | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eb0526b2..2fb738a9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog Fab-manager +- Fix a bug: unable to run task find_incoherent_invoices + ## v4.5.5 2020 August 26 - Improved portuguese translations diff --git a/lib/tasks/fablab/stripe.rake b/lib/tasks/fablab/stripe.rake index 8fa685318..3b88fa376 100644 --- a/lib/tasks/fablab/stripe.rake +++ b/lib/tasks/fablab/stripe.rake @@ -25,7 +25,7 @@ namespace :fablab do end end Invoice.where('created_at > ? AND stp_invoice_id IS NOT NULL', date).each do |invoice| - stp_invoice = Stripe::Invoice.retrieve(invoice.stp_invoice_id) + stp_invoice = Stripe::Invoice.retrieve(invoice.stp_invoice_id, api_key: Setting.get('stripe_secret_key')) next if invoice.amount_paid == stp_invoice.total puts "Id: #{invoice.id}, reference: #{invoice.reference}, stripe id: #{stp_invoice.id}, " \ From 730ebb87424b67b5a7fc79f2f01bb9cc0d248ca5 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 31 Aug 2020 10:58:39 +0200 Subject: [PATCH 2/4] updated db structure --- db/structure.sql | 57 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/db/structure.sql b/db/structure.sql index 6ca27d22d..d94aa5d6e 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -108,8 +108,8 @@ SET default_tablespace = ''; CREATE TABLE public.abuses ( id integer NOT NULL, - signaled_type character varying, signaled_id integer, + signaled_type character varying, first_name character varying, last_name character varying, email character varying, @@ -187,8 +187,8 @@ CREATE TABLE public.addresses ( locality character varying, country character varying, postal_code character varying, - placeable_type character varying, placeable_id integer, + placeable_type character varying, created_at timestamp without time zone, updated_at timestamp without time zone ); @@ -263,8 +263,8 @@ CREATE TABLE public.ar_internal_metadata ( CREATE TABLE public.assets ( id integer NOT NULL, - viewable_type character varying, viewable_id integer, + viewable_type character varying, attachment character varying, type character varying, created_at timestamp without time zone, @@ -504,8 +504,8 @@ ALTER SEQUENCE public.coupons_id_seq OWNED BY public.coupons.id; CREATE TABLE public.credits ( id integer NOT NULL, - creditable_type character varying, creditable_id integer, + creditable_type character varying, plan_id integer, hours integer, created_at timestamp without time zone, @@ -1046,8 +1046,8 @@ ALTER SEQUENCE public.invoice_items_id_seq OWNED BY public.invoice_items.id; CREATE TABLE public.invoices ( id integer NOT NULL, - invoiced_type character varying, invoiced_id integer, + invoiced_type character varying, stp_invoice_id character varying, total integer, created_at timestamp without time zone, @@ -1226,15 +1226,15 @@ ALTER SEQUENCE public.machines_id_seq OWNED BY public.machines.id; CREATE TABLE public.notifications ( id integer NOT NULL, receiver_id integer, - attached_object_type character varying, attached_object_id integer, + attached_object_type character varying, notification_type_id integer, is_read boolean DEFAULT false, created_at timestamp without time zone, updated_at timestamp without time zone, receiver_type character varying, is_send boolean DEFAULT false, - meta_data jsonb DEFAULT '"{}"'::jsonb + meta_data jsonb DEFAULT '{}'::jsonb ); @@ -1575,8 +1575,8 @@ CREATE TABLE public.prices ( id integer NOT NULL, group_id integer, plan_id integer, - priceable_type character varying, priceable_id integer, + priceable_type character varying, amount integer, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL @@ -1891,8 +1891,8 @@ CREATE TABLE public.reservations ( message text, created_at timestamp without time zone, updated_at timestamp without time zone, - reservable_type character varying, reservable_id integer, + reservable_type character varying, nb_reserve_places integer, statistic_profile_id integer ); @@ -1924,8 +1924,8 @@ ALTER SEQUENCE public.reservations_id_seq OWNED BY public.reservations.id; CREATE TABLE public.roles ( id integer NOT NULL, name character varying, - resource_type character varying, resource_id integer, + resource_type character varying, created_at timestamp without time zone, updated_at timestamp without time zone ); @@ -2859,8 +2859,8 @@ CREATE TABLE public.users_roles ( CREATE TABLE public.wallet_transactions ( id integer NOT NULL, wallet_id integer, - transactable_type character varying, transactable_id integer, + transactable_type character varying, transaction_type character varying, amount integer, created_at timestamp without time zone NOT NULL, @@ -3919,14 +3919,6 @@ ALTER TABLE ONLY public.roles ADD CONSTRAINT roles_pkey PRIMARY KEY (id); --- --- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.schema_migrations - ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); - - -- -- Name: settings settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -4942,6 +4934,29 @@ CREATE INDEX profiles_lower_unaccent_last_name_trgm_idx ON public.profiles USING CREATE INDEX projects_search_vector_idx ON public.projects USING gin (search_vector); +-- +-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version); + + +-- +-- Name: accounting_periods accounting_periods_del_protect; Type: RULE; Schema: public; Owner: - +-- + +CREATE RULE accounting_periods_del_protect AS + ON DELETE TO public.accounting_periods DO INSTEAD NOTHING; + + +-- +-- Name: accounting_periods accounting_periods_upd_protect; Type: RULE; Schema: public; Owner: - +-- + +CREATE RULE accounting_periods_upd_protect AS + ON UPDATE TO public.accounting_periods DO INSTEAD NOTHING; + + -- -- Name: projects projects_search_content_trigger; Type: TRIGGER; Schema: public; Owner: - -- @@ -5428,6 +5443,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20140605125131'), ('20140605142133'), ('20140605151442'), +('20140606133116'), ('20140609092700'), ('20140609092827'), ('20140610153123'), @@ -5496,12 +5512,14 @@ INSERT INTO "schema_migrations" (version) VALUES ('20150507075620'), ('20150512123546'), ('20150520132030'), +('20150520133409'), ('20150526130729'), ('20150527153312'), ('20150529113555'), ('20150601125944'), ('20150603104502'), ('20150603104658'), +('20150603133050'), ('20150604081757'), ('20150604131525'), ('20150608142234'), @@ -5583,6 +5601,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20160905142700'), ('20160906094739'), ('20160906094847'), +('20160906145713'), ('20160915105234'), ('20161123104604'), ('20170109085345'), From 2083ce6778a116e29a8d29a913031b59dbea70fd Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 31 Aug 2020 17:39:50 +0200 Subject: [PATCH 3/4] [bug] unable to pay by card for events reservation (#229) The setting online_payment_module was not requested by the router before loading the page, so it was always evaluated to false= online payment disabled --- CHANGELOG.md | 1 + app/assets/javascripts/router.js.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb738a9e..b4a75c38d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog Fab-manager +- Fix a bug: unable to pay by card for events reservation - Fix a bug: unable to run task find_incoherent_invoices ## v4.5.5 2020 August 26 diff --git a/app/assets/javascripts/router.js.erb b/app/assets/javascripts/router.js.erb index 52bb3a9bc..fe3e7aa14 100644 --- a/app/assets/javascripts/router.js.erb +++ b/app/assets/javascripts/router.js.erb @@ -550,7 +550,7 @@ angular.module('application.router', ['ui.router']) resolve: { eventPromise: ['Event', '$stateParams', function (Event, $stateParams) { return Event.get({ id: $stateParams.id }).$promise; }], priceCategoriesPromise: ['PriceCategory', function (PriceCategory) { return PriceCategory.query().$promise; }], - settingsPromise: ['Setting', function (Setting) { return Setting.query({ names: "['booking_move_enable', 'booking_move_delay', 'booking_cancel_enable', 'booking_cancel_delay', 'event_explications_alert']" }).$promise; }] + settingsPromise: ['Setting', function (Setting) { return Setting.query({ names: "['booking_move_enable', 'booking_move_delay', 'booking_cancel_enable', 'booking_cancel_delay', 'event_explications_alert', 'online_payment_module']" }).$promise; }] } }) From 55824f19b6f1837c7bf5f61e1e4739b65b10997d Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 1 Sep 2020 09:10:57 +0200 Subject: [PATCH 4/4] Version 4.5.6 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4a75c38d..09904bca0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog Fab-manager +## v4.5.6 2020 September 1st + - Fix a bug: unable to pay by card for events reservation - Fix a bug: unable to run task find_incoherent_invoices diff --git a/package.json b/package.json index 594b3e76c..50c53cf37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fab-manager", - "version": "4.5.5", + "version": "4.5.6", "description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.", "keywords": [ "fablab",