mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-18 02:20:37 -05:00
Combine the labor settings into Labor products/services
The estimate item codes and "Replaced by imported time" become one list of products/services (RedmineQboBilling::LaborItems), used to create issues from an estimate's labor lines (and an appointment's minimum hours), to offer an invoice's labor lines to be replaced by imported time, and to total the hours on estimates and invoices for the business report. While none are chosen, products/services named Labor are used. The old settings and redmine_qbo_calendar's fallbacks are no longer read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
12 files changed
+120
-83
No files matched your search
@@ -26,7 +26,7 @@
|
||||
data: {
|
||||
document: form.document,
|
||||
import_url: (import_options_qbo_invoices_path if invoice),
|
||||
replaceable_item_ids: (RedmineQboBilling::InvoiceWriter.replaceable_item_ids if invoice),
|
||||
labor_item_ids: (RedmineQboBilling::LaborItems.item_ids if invoice),
|
||||
items_url: items_qbo_estimates_path,
|
||||
customer_info_url: customer_info_qbo_estimates_path,
|
||||
saved_subtotal: (form.persisted? ? form.subtotal.to_s('F') : ''),
|
||||
|
||||
@@ -414,9 +414,9 @@ $(function () {
|
||||
};
|
||||
|
||||
// The invoice's lines, for ticking the ones the time replaces (e.g. the estimate's labor lines).
|
||||
// When products/services are set as replaceable by time in the plugin settings, only lines with one of
|
||||
// them are offered; with none set, every line is.
|
||||
var replaceable = ($form.data('replaceableItemIds') || []).map(String);
|
||||
// Only lines with one of the labor products/services (plugin settings) are offered; if none are known,
|
||||
// every line is.
|
||||
var replaceable = ($form.data('laborItemIds') || []).map(String);
|
||||
var fillReplaceList = function () {
|
||||
var $list = $('#qbo-import-replace').empty();
|
||||
rows().each(function () {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<% if proposals.empty? %>
|
||||
<p class="nodata">
|
||||
<%= l(:error_no_labor_lines_found) %>
|
||||
(<%= l(:label_estimate_item_codes) %>: <%= RedmineQboBilling::EstimateIssueBuilder.item_codes.join(', ') %>)
|
||||
(<%= l(:label_labor_items) %>: <%= RedmineQboBilling::LaborItems.names.join(', ') %>)
|
||||
<% if User.current.admin? %>
|
||||
· <%= link_to l(:label_settings), plugin_settings_path(id: 'redmine_qbo') %>
|
||||
<% end %>
|
||||
|
||||
Reference in new issue
Block a user