mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-11-17 21:50:37 -05:00
Estimate hours rule, linked issues, issue creation via redmine_qbo_billing
- An appointment's hours can't be less than its estimate's labor hours (checked when the estimate or hours change, so the quick status buttons still work on older appointments). Picking an estimate on the form, or arriving from an estimate page, raises the hours to match. - The appointment page lists the issues linked to its estimate. - Creating issues from an estimate moved to redmine_qbo_billing (now required): Create Issues from Estimate opens its page with this appointment's dates, technician, vehicle and project (via qbo_billing_issue_defaults). The builder, preview page, settings and rake task are removed here; the old settings stay registered so billing can read them until its own are saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
16 files changed
+135
-764
No files matched your search
@@ -11,13 +11,10 @@
|
||||
class CustomerAppointmentsController < ApplicationController
|
||||
before_action :require_login
|
||||
before_action :find_project, except: [:index]
|
||||
before_action :find_appointment, only: [ :show, :edit, :update, :destroy, :issues_preview, :create_issues ]
|
||||
before_action :find_appointment, only: [ :show, :edit, :update, :destroy ]
|
||||
# This tells Redmine to check global permissions for the current controller/action
|
||||
before_action :authorize_global
|
||||
|
||||
helper :projects
|
||||
helper :custom_fields
|
||||
|
||||
def customer_options
|
||||
customer = Customer.find_by(id: params[:customer_id])
|
||||
|
||||
@@ -27,31 +24,11 @@ class CustomerAppointmentsController < ApplicationController
|
||||
}
|
||||
end
|
||||
|
||||
# Preview of the issues that can be created from the appointment's QBO estimate.
|
||||
# Each line gets a tracker and (optionally) a template before anything is created.
|
||||
def issues_preview
|
||||
load_issue_preview
|
||||
end
|
||||
|
||||
# Creates the issues selected on the preview page, all or nothing.
|
||||
def create_issues
|
||||
load_issue_preview
|
||||
return if performed?
|
||||
|
||||
@rows = params[:lines].respond_to?(:to_unsafe_h) ? params[:lines].to_unsafe_h : {}
|
||||
@custom_field_values = submitted_custom_field_values
|
||||
created_issues = @builder.create_issues(project: @target_project, rows: @rows,
|
||||
custom_field_values: @custom_field_values)
|
||||
|
||||
if created_issues.any?
|
||||
flash[:notice] = l(:notice_appointment_issues_created, count: created_issues.size)
|
||||
redirect_to customer_appointment_path(@appointment)
|
||||
else
|
||||
# Rebuild the fields so the form keeps what was entered
|
||||
@field_set = RedmineQboCalendar::IssueFieldSet.new(project: @target_project, trackers: @trackers,
|
||||
values: @custom_field_values)
|
||||
render :issues_preview, status: :unprocessable_entity
|
||||
end
|
||||
# The estimate's labor hours (redmine_qbo_billing's item codes), so the form can make sure the
|
||||
# appointment's hours aren't less
|
||||
def estimate_hours
|
||||
estimate = Estimate.find_by(id: params[:estimate_id])
|
||||
render json: { hours: CustomerAppointment.estimate_labor_hours(estimate) }
|
||||
end
|
||||
|
||||
def index
|
||||
@@ -88,6 +65,8 @@ class CustomerAppointmentsController < ApplicationController
|
||||
|
||||
def show
|
||||
@appointment = CustomerAppointment.find(params[:id])
|
||||
# Issues linked to the appointment's estimate (made from it, or linked by hand)
|
||||
@estimate_issues = @appointment.estimate_id ? Issue.visible.where(estimate_id: @appointment.estimate_id).order(:id).to_a : []
|
||||
end
|
||||
|
||||
def new
|
||||
@@ -138,6 +117,9 @@ class CustomerAppointmentsController < ApplicationController
|
||||
|
||||
if params[:estimate_id].present? && customer.estimates.exists?(id: params[:estimate_id])
|
||||
@appointment.estimate_id = params[:estimate_id]
|
||||
# At least the estimate's labor hours
|
||||
labor = CustomerAppointment.estimate_labor_hours(@appointment.estimate)
|
||||
@appointment.estimated_hours = labor if labor > @appointment.estimated_hours.to_i
|
||||
end
|
||||
if params[:vehicle_id].present? && customer.respond_to?(:vehicles) && customer.vehicles.exists?(id: params[:vehicle_id])
|
||||
@appointment.vehicle_id = params[:vehicle_id]
|
||||
@@ -170,37 +152,6 @@ class CustomerAppointmentsController < ApplicationController
|
||||
nil
|
||||
end
|
||||
|
||||
# Sets up everything the preview page needs: the target project, its trackers and templates.
|
||||
def load_issue_preview
|
||||
@builder = RedmineQboCalendar::EstimateIssueBuilder.new(@appointment)
|
||||
@available_projects = Project.allowed_to(User.current, :add_issues).sorted.to_a
|
||||
|
||||
# A project chosen on the page wins, then the appointment's project, then the default project
|
||||
# from the plugin settings, then the first project the user can add issues to
|
||||
default_project = @available_projects.detect { |p| p.id == RedmineQboCalendar::EstimateIssueBuilder.default_project_id }
|
||||
@target_project =
|
||||
if @project
|
||||
@project if @available_projects.include?(@project)
|
||||
elsif @available_projects.include?(@appointment.project)
|
||||
@appointment.project
|
||||
else
|
||||
default_project || @available_projects.first
|
||||
end
|
||||
return deny_access unless @target_project
|
||||
|
||||
@trackers = Issue.allowed_target_trackers(@target_project, User.current).to_a
|
||||
@default_tracker = @trackers.detect { |t| t.id == RedmineQboCalendar::EstimateIssueBuilder.default_tracker_id } || @trackers.first
|
||||
@templates = RedmineQboCalendar::IssueTemplateSupport.templates_for(@target_project)
|
||||
@field_set = RedmineQboCalendar::IssueFieldSet.new(project: @target_project, trackers: @trackers)
|
||||
@rows ||= {}
|
||||
end
|
||||
|
||||
# The shared custom field values from the preview form: { custom_field_id => value }
|
||||
def submitted_custom_field_values
|
||||
values = params.dig(:issue, :custom_field_values)
|
||||
values.respond_to?(:to_unsafe_h) ? values.to_unsafe_h : {}
|
||||
end
|
||||
|
||||
def find_project
|
||||
@project = Project.find(params[:project_id]) if params[:project_id].present?
|
||||
end
|
||||
|
||||
@@ -26,6 +26,9 @@ class CustomerAppointment < ActiveRecord::Base
|
||||
# Prevent scheduling on non-working days or holidays
|
||||
validate :validate_working_day
|
||||
|
||||
# The hours can't be less than the attached estimate's labor hours
|
||||
validate :validate_hours_cover_estimate
|
||||
|
||||
# Capitalize the first letter only; titleize mangled vehicle names and acronyms (JL -> Jl, LED -> Led)
|
||||
normalizes :subject, with: ->(subject) { subject.strip.sub(/\A[a-z]/, &:upcase) }
|
||||
|
||||
@@ -77,12 +80,35 @@ class CustomerAppointment < ActiveRecord::Base
|
||||
subject
|
||||
end
|
||||
|
||||
# The estimate's labor hours rounded up to whole hours (appointment hours are whole numbers): the
|
||||
# quantities of its lines whose item matches redmine_qbo_billing's item codes (e.g. Labor). 0 if the
|
||||
# estimate can't be read from QuickBooks.
|
||||
def self.estimate_labor_hours(estimate)
|
||||
return 0 if estimate.nil?
|
||||
RedmineQboBilling::EstimateIssueBuilder.labor_hours(estimate).ceil
|
||||
rescue StandardError => e
|
||||
Rails.logger.warn "[CustomerAppointment] Could not read labor hours for estimate #{estimate&.id}: #{e.message}"
|
||||
0
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def log(msg)
|
||||
Rails.logger.info "[CustomerAppointment] #{msg}"
|
||||
end
|
||||
|
||||
# Checked when the estimate or the hours change, so changing just the status (the quick status buttons)
|
||||
# never fails on an older appointment
|
||||
def validate_hours_cover_estimate
|
||||
return if estimate.nil?
|
||||
return unless new_record? || will_save_change_to_estimate_id? || will_save_change_to_estimated_hours?
|
||||
|
||||
labor = self.class.estimate_labor_hours(estimate)
|
||||
return if labor.zero? || estimated_hours.to_i >= labor
|
||||
|
||||
errors.add(:base, I18n.t(:error_hours_less_than_estimate, hours: labor, estimate: estimate.doc_number))
|
||||
end
|
||||
|
||||
# Validates that the appointment date does not land on a weekend or holiday
|
||||
def validate_working_day
|
||||
return if date.blank?
|
||||
|
||||
@@ -48,6 +48,22 @@
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
|
||||
<%# When an estimate is picked, the hours are raised to at least its labor hours %>
|
||||
<%= javascript_tag do %>
|
||||
$(function () {
|
||||
var $estimate = $('#appointment_estimate_id');
|
||||
var $hours = $('#customer_appointment_estimated_hours');
|
||||
if (!$estimate.length || !$hours.length) return;
|
||||
$estimate.on('change', function () {
|
||||
if (!this.value) return;
|
||||
$.getJSON('<%= j estimate_hours_customer_appointments_path %>', { estimate_id: this.value }).done(function (data) {
|
||||
var hours = parseInt(data.hours, 10) || 0;
|
||||
if (hours > (parseInt($hours.val(), 10) || 0)) $hours.val(hours);
|
||||
});
|
||||
});
|
||||
});
|
||||
<% end %>
|
||||
|
||||
<!-- Modal Container for Inline Customer Creation -->
|
||||
<div id="new-customer-dialog" style="display:none;" title="<%= t(:label_new_customer, default: 'New Customer') %>">
|
||||
<!-- The form will be dynamically loaded via JS or rendered here -->
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
<div class="contextual">
|
||||
<%= link_to customer_appointment_path(@appointment) do %>
|
||||
<i class="fa-solid fa-arrow-left"></i> <%= l(:label_appointment) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<h2>
|
||||
<%= l(:button_create_issues_from_estimate) %>
|
||||
<% if @appointment.estimate %>
|
||||
<span class="estimate-preview-subtitle">
|
||||
· <%= l(:label_estimate) %> #<%= @appointment.estimate.doc_number %>
|
||||
· <%= @appointment.subject %>
|
||||
</span>
|
||||
<% end %>
|
||||
</h2>
|
||||
|
||||
<%# Target project: changing it reloads the page with that project's trackers and templates %>
|
||||
<% if @available_projects.size > 1 %>
|
||||
<%= form_tag issues_preview_customer_appointment_path(@appointment), method: :get, id: 'estimate-issues-project-form' do %>
|
||||
<p>
|
||||
<label for="project_id"><strong><%= l(:field_project) %>:</strong></label>
|
||||
<%= select_tag :project_id,
|
||||
options_from_collection_for_select(@available_projects, :id, :name, @target_project.id),
|
||||
onchange: 'this.form.submit();' %>
|
||||
<noscript><%= submit_tag l(:button_apply), name: nil %></noscript>
|
||||
</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><strong><%= l(:field_project) %>:</strong> <%= link_to_project @target_project %></p>
|
||||
<% end %>
|
||||
|
||||
<% if @builder.errors.any? %>
|
||||
<div id="errorExplanation">
|
||||
<ul>
|
||||
<% @builder.errors.each do |message| %>
|
||||
<li><%= message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% proposals = @builder.proposals %>
|
||||
|
||||
<% if @appointment.estimate.blank? %>
|
||||
<p class="nodata"><%= l(:label_appointment_has_no_estimate) %></p>
|
||||
<% elsif proposals.empty? %>
|
||||
<p class="nodata">
|
||||
<%= l(:error_no_labor_lines_found) %>
|
||||
(<%= l(:label_estimate_item_codes) %>: <%= RedmineQboCalendar::EstimateIssueBuilder.item_codes.join(', ') %>)
|
||||
<% if User.current.admin? %>
|
||||
· <%= link_to l(:label_settings), plugin_settings_path(id: 'redmine_qbo_calendar') %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% else %>
|
||||
<%
|
||||
templates_enabled = RedmineQboCalendar::IssueTemplateSupport.enabled_for?(@target_project)
|
||||
template_data = @templates.map { |t| { key: t.key, title: t.title, tracker_id: t.tracker_id, is_default: t.is_default, group: t.group } }
|
||||
default_template_for = ->(tracker_id) { @templates.detect { |t| t.tracker_id == tracker_id.to_i && t.is_default }&.key }
|
||||
selectable_count = proposals.count { |p| !p.created? }
|
||||
%>
|
||||
|
||||
<%= form_tag create_issues_customer_appointment_path(@appointment),
|
||||
method: :post,
|
||||
id: 'estimate-issues-form',
|
||||
data: { templates: template_data.to_json } do %>
|
||||
<%= hidden_field_tag :project_id, @target_project.id %>
|
||||
|
||||
<table class="list estimate-issues-preview">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="checkbox">
|
||||
<% if selectable_count > 0 %>
|
||||
<input type="checkbox" id="estimate-issues-toggle-all" checked title="<%= l(:button_check_all) %>">
|
||||
<% end %>
|
||||
</th>
|
||||
<th><%= l(:label_estimate_item) %></th>
|
||||
<th><%= l(:field_subject) %></th>
|
||||
<th><%= l(:field_tracker) %></th>
|
||||
<% if templates_enabled %>
|
||||
<th><%= l(:label_issue_template) %></th>
|
||||
<% end %>
|
||||
<th><%= l(:field_estimated_hours) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% proposals.each do |proposal| %>
|
||||
<% field = "lines[#{proposal.line_id}]" %>
|
||||
<% if proposal.created? %>
|
||||
<tr class="estimate-line created">
|
||||
<td class="checkbox"><input type="checkbox" disabled></td>
|
||||
<td><%= proposal.item_name %></td>
|
||||
<td class="subject"><%= proposal.description %></td>
|
||||
<td colspan="<%= templates_enabled ? 3 : 2 %>">
|
||||
<%= l(:label_estimate_line_already_created) %>:
|
||||
<%= link_to_issue(proposal.existing_issue, truncate: 60) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<%
|
||||
row = (@rows[proposal.line_id] || {}).to_h
|
||||
selected = row.empty? || row['selected'] == '1'
|
||||
tracker_id = (row['tracker_id'].presence || @default_tracker&.id).to_i
|
||||
template_key = row.key?('template') ? row['template'] : default_template_for.call(tracker_id)
|
||||
hours = row.key?('estimated_hours') ? row['estimated_hours'] : proposal.hours
|
||||
%>
|
||||
<tr class="estimate-line">
|
||||
<td class="checkbox">
|
||||
<%= hidden_field_tag "#{field}[selected]", '0', id: nil %>
|
||||
<%= check_box_tag "#{field}[selected]", '1', selected, class: 'estimate-line-select', id: nil %>
|
||||
</td>
|
||||
<td><%= proposal.item_name %></td>
|
||||
<td class="subject">
|
||||
<%= text_field_tag "#{field}[subject]", row['subject'] || proposal.description,
|
||||
maxlength: 255, class: 'estimate-line-subject', id: nil %>
|
||||
</td>
|
||||
<td>
|
||||
<%= select_tag "#{field}[tracker_id]",
|
||||
options_from_collection_for_select(@trackers, :id, :name, tracker_id),
|
||||
class: 'estimate-line-tracker', id: nil %>
|
||||
</td>
|
||||
<% if templates_enabled %>
|
||||
<td>
|
||||
<%# Options are filled by the script below to match the chosen tracker %>
|
||||
<%= select_tag "#{field}[template]",
|
||||
options_for_select([[l(:label_no_issue_template), '']] +
|
||||
@templates.select { |t| t.tracker_id == tracker_id }.map { |t| [t.title, t.key] }, template_key),
|
||||
class: 'estimate-line-template', id: nil %>
|
||||
</td>
|
||||
<% end %>
|
||||
<td>
|
||||
<%= number_field_tag "#{field}[estimated_hours]", hours, step: 0.25, min: 0, size: 6, id: nil %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%# Custom fields for the chosen trackers, entered once and applied to every issue that uses them %>
|
||||
<% if @field_set&.any? %>
|
||||
<fieldset class="box tabular estimate-issue-fields" id="estimate-issue-fields">
|
||||
<legend><%= l(:label_estimate_issue_fields) %></legend>
|
||||
<p class="estimate-issue-fields-info"><em class="info"><%= l(:text_estimate_issue_fields_info) %></em></p>
|
||||
<% @field_set.fields.each do |field| %>
|
||||
<p class="estimate-issue-field"
|
||||
data-tracker-ids="<%= field.tracker_ids.join(',') %>"
|
||||
data-required-tracker-ids="<%= field.required_tracker_ids.join(',') %>">
|
||||
<label for="<%= custom_field_tag_id('issue', field.custom_field) %>">
|
||||
<%= custom_field_name_tag(field.custom_field) %>
|
||||
<span class="required estimate-field-required"<%= ' style="display:none"'.html_safe unless field.required_for_any? %>> *</span>
|
||||
</label>
|
||||
<%= custom_field_tag('issue', field.custom_value) %>
|
||||
</p>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<p class="estimate-issues-hint">
|
||||
<% if templates_enabled %>
|
||||
<%= l(:text_estimate_issues_template_hint) %>
|
||||
<% else %>
|
||||
<%= l(:text_estimate_issues_hint) %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<% if selectable_count > 0 %>
|
||||
<%= submit_tag l(:button_create_issues), data: { disable_with: l(:label_loading) } %>
|
||||
<% end %>
|
||||
<%= link_to l(:button_cancel), customer_appointment_path(@appointment) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
(function () {
|
||||
var form = document.getElementById('estimate-issues-form');
|
||||
if (!form) return;
|
||||
|
||||
// Select / deselect all lines
|
||||
var toggleAll = document.getElementById('estimate-issues-toggle-all');
|
||||
if (toggleAll) {
|
||||
toggleAll.addEventListener('change', function () {
|
||||
form.querySelectorAll('.estimate-line-select').forEach(function (box) { box.checked = toggleAll.checked; });
|
||||
});
|
||||
}
|
||||
|
||||
// Keep each template dropdown limited to templates for the chosen tracker
|
||||
var templates = [];
|
||||
try { templates = JSON.parse(form.dataset.templates || '[]'); } catch (e) { templates = []; }
|
||||
var noneLabel = <%= raw l(:label_no_issue_template).to_json %>;
|
||||
|
||||
function fillTemplates(templateSelect, trackerId, useDefault) {
|
||||
var current = templateSelect.value;
|
||||
var matches = templates.filter(function (t) { return String(t.tracker_id) === String(trackerId); });
|
||||
templateSelect.innerHTML = '';
|
||||
templateSelect.appendChild(new Option(noneLabel, ''));
|
||||
matches.forEach(function (t) {
|
||||
templateSelect.appendChild(new Option(t.title + (t.group === 'global' ? ' (global)' : ''), t.key));
|
||||
});
|
||||
var defaultTemplate = matches.find(function (t) { return t.is_default; });
|
||||
if (useDefault) {
|
||||
templateSelect.value = defaultTemplate ? defaultTemplate.key : '';
|
||||
} else if (matches.some(function (t) { return t.key === current; })) {
|
||||
templateSelect.value = current;
|
||||
}
|
||||
}
|
||||
|
||||
form.querySelectorAll('tr.estimate-line').forEach(function (row) {
|
||||
var tracker = row.querySelector('.estimate-line-tracker');
|
||||
var template = row.querySelector('.estimate-line-template');
|
||||
if (!tracker || !template) return;
|
||||
fillTemplates(template, tracker.value, false);
|
||||
tracker.addEventListener('change', function () { fillTemplates(template, tracker.value, true); });
|
||||
});
|
||||
|
||||
// Show only the custom fields used by the trackers of the selected lines, and star the required ones
|
||||
var fieldBox = document.getElementById('estimate-issue-fields');
|
||||
|
||||
function idList(value) {
|
||||
return (value || '').split(',').filter(function (v) { return v !== ''; });
|
||||
}
|
||||
|
||||
function updateFields() {
|
||||
if (!fieldBox) return;
|
||||
var trackerIds = [];
|
||||
form.querySelectorAll('tr.estimate-line').forEach(function (row) {
|
||||
var box = row.querySelector('.estimate-line-select');
|
||||
var tracker = row.querySelector('.estimate-line-tracker');
|
||||
if (box && tracker && box.checked && trackerIds.indexOf(tracker.value) < 0) trackerIds.push(tracker.value);
|
||||
});
|
||||
|
||||
var visibleCount = 0;
|
||||
fieldBox.querySelectorAll('.estimate-issue-field').forEach(function (field) {
|
||||
var used = idList(field.dataset.trackerIds).some(function (id) { return trackerIds.indexOf(id) >= 0; });
|
||||
var required = idList(field.dataset.requiredTrackerIds).some(function (id) { return trackerIds.indexOf(id) >= 0; });
|
||||
field.style.display = used ? '' : 'none';
|
||||
var star = field.querySelector('.estimate-field-required');
|
||||
if (star) star.style.display = required ? '' : 'none';
|
||||
if (used) visibleCount++;
|
||||
});
|
||||
fieldBox.style.display = visibleCount > 0 ? '' : 'none';
|
||||
}
|
||||
|
||||
form.querySelectorAll('.estimate-line-select, .estimate-line-tracker').forEach(function (el) {
|
||||
el.addEventListener('change', updateFields);
|
||||
});
|
||||
if (toggleAll) toggleAll.addEventListener('change', updateFields);
|
||||
updateFields();
|
||||
})();
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -14,8 +14,9 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if @appointment.estimate && User.current.allowed_to?(:create_customer_appointment_issues, nil, global: true) %>
|
||||
<%= link_to issues_preview_customer_appointment_path(@appointment) do %>
|
||||
<%# Issues from the estimate are made by redmine_qbo_billing, with this appointment's dates, technician and vehicle %>
|
||||
<% if @appointment.estimate && User.current.allowed_to?(:create_estimate_issues, nil, global: true) %>
|
||||
<%= link_to issues_preview_qbo_estimate_path(@appointment.estimate_id, appointment_id: @appointment.id) do %>
|
||||
<i class="fa-solid fa-list-check"></i> <%= l(:button_create_issues_from_estimate) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -135,4 +136,9 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @appointment.estimate %>
|
||||
<h3><%= l(:label_estimate_issues, estimate: @appointment.estimate.doc_number) %></h3>
|
||||
<%= render partial: 'issues/list_simple', locals: { issues: @estimate_issues } %>
|
||||
<% end %>
|
||||
|
||||
<%= call_hook :show_customer_appointment, { appointment: @appointment } %>
|
||||
@@ -1,26 +1,5 @@
|
||||
<fieldset class="box tabular">
|
||||
<legend><%= l(:label_estimate_issue_settings) %></legend>
|
||||
|
||||
<p>
|
||||
<label for="settings_item_codes"><%= l(:label_estimate_item_codes) %></label>
|
||||
<%= text_area_tag 'settings[item_codes]', settings['item_codes'], rows: 5, cols: 30, id: 'settings_item_codes' %>
|
||||
<em class="info"><%= l(:text_estimate_item_codes_info) %></em>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="settings_default_project_id"><%= l(:label_default_project) %></label>
|
||||
<%= select_tag 'settings[default_project_id]',
|
||||
project_tree_options_for_select(Project.active.sorted,
|
||||
selected: Project.find_by(id: settings['default_project_id'].to_i)),
|
||||
include_blank: true, id: 'settings_default_project_id' %>
|
||||
<em class="info"><%= l(:text_default_project_info) %></em>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="settings_default_tracker_id"><%= l(:label_default_tracker) %></label>
|
||||
<%= select_tag 'settings[default_tracker_id]',
|
||||
options_from_collection_for_select(Tracker.sorted, :id, :name, settings['default_tracker_id'].to_i),
|
||||
include_blank: true, id: 'settings_default_tracker_id' %>
|
||||
<em class="info"><%= l(:text_default_tracker_info) %></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
<%# The issues-from-estimate settings moved to redmine_qbo_billing %>
|
||||
<p>
|
||||
<%= l(:text_estimate_issue_settings_moved) %>
|
||||
<%= link_to l(:label_redmine_qbo_billing_settings), plugin_settings_path(id: 'redmine_qbo_billing') %>
|
||||
</p>
|
||||
Reference in new issue
Block a user