mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-04-03 08:41:58 -04:00
Compare commits
2 Commits
c4e1ece82c
...
2026.3.9
| Author | SHA1 | Date | |
|---|---|---|---|
| db3c6021c5 | |||
| b8327be5d6 |
@@ -15,6 +15,26 @@ class Qbo < ActiveRecord::Base
|
|||||||
|
|
||||||
validate :single_record_only, on: :create
|
validate :single_record_only, on: :create
|
||||||
|
|
||||||
|
# Returns the last sync time formatted for display. If no sync has occurred, returns a default message.
|
||||||
|
def self.last_sync
|
||||||
|
qbo = QboConnectionService.current!
|
||||||
|
format_time(qbo.last_sync)
|
||||||
|
rescue
|
||||||
|
return I18n.t(:label_qbo_never_synced)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.oauth2_access_token_expires_at
|
||||||
|
QboConnectionService.current!.oauth2_access_token_expires_at
|
||||||
|
rescue
|
||||||
|
return I18n.t(:label_qbo_never_synced)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.oauth2_refresh_token_expires_at
|
||||||
|
QboConnectionService.current!.oauth2_refresh_token_expires_at
|
||||||
|
rescue
|
||||||
|
return I18n.t(:label_qbo_never_synced)
|
||||||
|
end
|
||||||
|
|
||||||
# Updates last sync time stamp
|
# Updates last sync time stamp
|
||||||
def self.update_time_stamp
|
def self.update_time_stamp
|
||||||
date = DateTime.now
|
date = DateTime.now
|
||||||
@@ -24,14 +44,6 @@ class Qbo < ActiveRecord::Base
|
|||||||
qbo.save
|
qbo.save
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the last sync time formatted for display. If no sync has occurred, returns a default message.
|
|
||||||
def self.last_sync
|
|
||||||
qbo = QboConnectionService.current!
|
|
||||||
format_time(qbo.last_sync)
|
|
||||||
rescue
|
|
||||||
return I18n.t(:label_qbo_never_synced)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Logs a message with a QBO-specific prefix for easier identification in the logs.
|
# Logs a message with a QBO-specific prefix for easier identification in the logs.
|
||||||
|
|||||||
@@ -66,12 +66,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%=t(:label_oauth_expires)%></th>
|
<th><%=t(:label_oauth_expires)%></th>
|
||||||
<td><%= QboConnectionService.current!&.oauth2_access_token_expires_at %>
|
<td><%= Qbo.oauth2_access_token_expires_at %>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%=t(:label_oauth2_refresh_token_expires_at)%></th>
|
<th><%=t(:label_oauth2_refresh_token_expires_at)%></th>
|
||||||
<td><%= QboConnectionService.current!&.oauth2_refresh_token_expires_at %>
|
<td><%= Qbo.oauth2_refresh_token_expires_at %>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
2
init.rb
2
init.rb
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo do
|
|||||||
name 'Redmine QBO plugin'
|
name 'Redmine QBO plugin'
|
||||||
author 'Rick Barrette'
|
author 'Rick Barrette'
|
||||||
description 'A pluging for Redmine to connect with QuickBooks Online to create Time Activity Entries for billable hours logged when an Issue is closed'
|
description 'A pluging for Redmine to connect with QuickBooks Online to create Time Activity Entries for billable hours logged when an Issue is closed'
|
||||||
version '2026.3.8'
|
version '2026.3.9'
|
||||||
url 'https://github.com/rickbarrette/redmine_qbo'
|
url 'https://github.com/rickbarrette/redmine_qbo'
|
||||||
author_url 'https://barrettefabrication.com'
|
author_url 'https://barrettefabrication.com'
|
||||||
settings default: {empty: true}, partial: 'qbo/settings'
|
settings default: {empty: true}, partial: 'qbo/settings'
|
||||||
|
|||||||
Reference in New Issue
Block a user