Compare commits

7 Commits

Author SHA1 Message Date
ricky ec1ef72267 Use a private note to make it clear where the estimate came from. 2026-03-14 22:13:45 -04:00
ricky 564158722d Updated t work with redmine_qbo 2026.3.9 2026-03-14 21:56:09 -04:00
ricky 60a7f769ce Added Screenshots 2026-03-14 08:03:04 -04:00
ricky 1367937614 Merge remote-tracking branch 'origin/master' 2026-03-13 08:39:23 -04:00
ricky 62adcb11cd fixed typo 2026-03-13 08:38:41 -04:00
ricky 896813983c Updated to use DSL and qbo_sync flag 2026-03-13 08:36:49 -04:00
ricky 89e3048c29 Update README.md 2026-03-12 12:17:22 -04:00
9 changed files with 18 additions and 36 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ This plugin allows **billable line items** to be attached to a Redmine issue. Wh
| Plugin Version | Redmine Version | Ruby Version |
| --- | --- | --- |
| 2026.3.5+ | 6.1.x | 3.2+ |
| 2026.3.6+ | 6.1.x | 3.2+ |
---
@@ -114,4 +114,4 @@ Before using this plugin:
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

+3 -1
View File
@@ -46,7 +46,9 @@ class BillLineItemsJob < ActiveJob::Base
estimate = Quickbooks::Model::Estimate.new(customer_id: issue.customer.id)
estimate_service = Quickbooks::Service::Estimate.new( company_id: qbo.realm_id, access_token: access_token)
estimate.line_items << Quickbooks::Model::InvoiceLineItem.new(description: "#{I18n.t(:notice_added_from)}#{issue.id} #{issue.subject}", detail_type: 'DescriptionOnly' )
memo = "Added from: #{issue.tracker} ##{issue.id}: #{issue.subject}"
estimate.private_note = memo
estimate.line_items << Quickbooks::Model::InvoiceLineItem.new(description: memo, detail_type: 'DescriptionOnly' )
unbilled_entries.each do |item|
log "Creating Line Item for #{item.description}"
+5 -8
View File
@@ -14,32 +14,29 @@ class Item < QboBaseModel
validates_presence_of :id, :description
validates :unit_price, numericality: { greater_than_or_equal_to: 0 }
self.primary_key = :id
qbo_sync push: true
# Updates Both local & remote DB description
def description=(s)
details
@details.description = s
details.description = s
super
end
# Updates Both local & remote DB name
def name=(s)
details
@details.name = s
details.name = s
super
end
# Updates Both local & remote DB sku
def sku=(s)
details
@details.sku = s
details.sku = s
super
end
# Updates Both local & remote DB price
def unit_price=(s)
details
@details.unit_price = s
details.unit_price = s
super
end
+1 -6
View File
@@ -28,12 +28,7 @@ class ItemService < ServiceBase
def default_income_account
log "Looking up sales income account"
qbo = QboConnectionService.current!
qbo.perform_authenticated_request do |token|
service = Quickbooks::Service::Account.new(
company_id: qbo.realm_id,
access_token: token
)
QboConnectionService.with_qbo_service(entity: Invoice) do |service|
service.query("SELECT * FROM Account WHERE AccountType='Income' AND Name LIKE '%Sales%'").first
end
end
+3 -15
View File
@@ -22,19 +22,7 @@ class ItemSyncService < SyncServiceBase
20
end
# Map relevant attributes from the QBO Employee to the local Employee model
def process_attributes(local, remote)
log "Processing Item ##{remote.id}"
local.id = remote.id
local.description = remote.description
local.unit_price = remote.unit_price
local.active = remote.active?
local.name = remote.name
local.sku = remote.sku
end
def log(msg)
Rails.logger.info "[ItemSyncService] #{msg}"
end
map_attribute :active, :active?
map_attributes :description, :id, :name, :sku, :unit_price
end
+2 -2
View File
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo_lineitems do
name 'Redmine QBO Line Items plugin'
author 'Rick Barrette'
description 'A plugin for Redmine to extend the capabilitys of the Redmine QuickBooks Online plugin to attach billable line items to an isuue'
version '2026.3.7'
version '2026.3.8'
url 'https://github.com/rickbarrette/redmine_qbo_lineitems'
author_url 'https://barrettefabrication.com'
requires_redmine version_or_higher: '6.1.0'
@@ -22,7 +22,7 @@ Redmine::Plugin.register :redmine_qbo_lineitems do
# Ensure redmine_qbo is installed
begin
requires_redmine_plugin :redmine_qbo, version_or_higher: '2026.3.6'
requires_redmine_plugin :redmine_qbo, version_or_higher: '2026.3.9'
rescue Redmine::PluginNotFound
raise 'Please install the redmine_qbo plugin (https://github.com/rickbarrette/redmine_qbo)'
end
@@ -21,8 +21,8 @@ module RedmineQboLineItems
# Called by the QboSyncDispatcher
def qbo_full_sync (context={})
log "Adding ItemSyncJob to QBO sync dispatcher"
return ItemSyncJob
log "Adding Item to QBO sync dispatcher"
return Item
end
private