mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-17 18:20:36 -05:00
Tidy the plugin settings page
- Three sections: QuickBooks connection, Synchronization and Billing. - Synchronization is one table of every synced type (customers, employees, estimates, invoices, payments, items, accounts) with its count, last sync and a Sync link, plus Sync changes and Full sync. The separate billing stats and management boxes are folded into it. - New payments sync (admin only). - Sync links return to the page they were clicked on instead of the home page. - Remove locale strings nothing uses any more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
13 files changed
+90
-111
No files matched your search
@@ -32,6 +32,6 @@ class AccountsController < ApplicationController
|
||||
|
||||
def sync
|
||||
Account.sync
|
||||
redirect_to :home, flash: { notice: I18n.t(:label_syncing) }
|
||||
redirect_back fallback_location: home_path, flash: { notice: I18n.t(:label_syncing) }
|
||||
end
|
||||
end
|
||||
@@ -213,7 +213,7 @@ class CustomersController < ApplicationController
|
||||
|
||||
def sync
|
||||
Customer.sync
|
||||
redirect_to :home, flash: { notice: I18n.t(:label_syncing) }
|
||||
redirect_back fallback_location: home_path, flash: { notice: I18n.t(:label_syncing) }
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
@@ -15,7 +15,7 @@ class EmployeesController < ApplicationController
|
||||
|
||||
def sync
|
||||
Employee.sync
|
||||
redirect_to :home, flash: { notice: I18n.t(:label_syncing) }
|
||||
redirect_back fallback_location: home_path, flash: { notice: I18n.t(:label_syncing) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -31,7 +31,7 @@ class EstimatesController < ApplicationController
|
||||
|
||||
def sync
|
||||
Estimate.sync
|
||||
redirect_to :home, flash: { notice: I18n.t(:label_syncing) }
|
||||
redirect_back fallback_location: home_path, flash: { notice: I18n.t(:label_syncing) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -34,7 +34,7 @@ class InvoicesController < ApplicationController
|
||||
|
||||
def sync
|
||||
Invoice.sync
|
||||
redirect_to :home, flash: { notice: I18n.t(:label_syncing) }
|
||||
redirect_back fallback_location: home_path, flash: { notice: I18n.t(:label_syncing) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -76,7 +76,7 @@ class ItemsController < ApplicationController
|
||||
|
||||
def sync
|
||||
Item.sync
|
||||
redirect_to :home, flash: { notice: I18n.t(:label_syncing) }
|
||||
redirect_back fallback_location: home_path, flash: { notice: I18n.t(:label_syncing) }
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
@@ -70,7 +70,7 @@ class QboController < ApplicationController
|
||||
full_sync = ActiveModel::Type::Boolean.new.cast(params[:full_sync])
|
||||
QboSyncDispatcher.sync!(full_sync: full_sync)
|
||||
|
||||
redirect_to :home, flash: { notice: I18n.t(:label_syncing) }
|
||||
redirect_back fallback_location: home_path, flash: { notice: I18n.t(:label_syncing) }
|
||||
end
|
||||
|
||||
# Endpoint to receive QuickBooks webhook notifications. Validates the request and processes the payload to sync relevant data to Redmine. Responds with appropriate HTTP status codes based on success or failure of processing.
|
||||
|
||||
@@ -13,10 +13,17 @@
|
||||
# listed on their payments page.
|
||||
class QboPaymentsController < ApplicationController
|
||||
|
||||
before_action :authorize_global
|
||||
before_action :authorize_global, except: :sync
|
||||
before_action :require_admin, only: :sync
|
||||
|
||||
QBO_ERRORS = QboEstimatesController::QBO_ERRORS
|
||||
|
||||
# Re-reads every payment from QuickBooks into the local cache (admin, from the plugin settings)
|
||||
def sync
|
||||
Payment.sync
|
||||
redirect_back fallback_location: home_path, flash: { notice: I18n.t(:label_syncing) }
|
||||
end
|
||||
|
||||
# The customer's payments, newest first, read from QuickBooks
|
||||
def index
|
||||
@customer = Customer.find_by(id: params[:customer_id])
|
||||
|
||||
Reference in new issue
Block a user