[#4184] Default some required values.
This commit is contained in:
1 parent
e2aabeec8c
commit
d08d3ccc52
1 file changed
+6
@@ -92,6 +92,8 @@ module RedmineContracts
|
|||||||
:end_date => old_deliverable['due']) do |c|
|
:end_date => old_deliverable['due']) do |c|
|
||||||
c.project = project
|
c.project = project
|
||||||
c.account_executive = project.users.first
|
c.account_executive = project.users.first
|
||||||
|
c.start_date ||= Date.today
|
||||||
|
c.end_date ||= Date.today
|
||||||
end
|
end
|
||||||
|
|
||||||
contract.save!
|
contract.save!
|
||||||
@@ -99,6 +101,8 @@ module RedmineContracts
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.convert_overhead(deliverable, old_deliverable, total)
|
def self.convert_overhead(deliverable, old_deliverable, total)
|
||||||
|
total ||= 0
|
||||||
|
|
||||||
if old_deliverable['overhead'].present?
|
if old_deliverable['overhead'].present?
|
||||||
deliverable.overhead_budgets << OverheadBudget.new(:deliverable => deliverable,
|
deliverable.overhead_budgets << OverheadBudget.new(:deliverable => deliverable,
|
||||||
:budget => old_deliverable['overhead'],
|
:budget => old_deliverable['overhead'],
|
||||||
@@ -113,6 +117,8 @@ module RedmineContracts
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.convert_materials(deliverable, old_deliverable, total)
|
def self.convert_materials(deliverable, old_deliverable, total)
|
||||||
|
total ||= 0
|
||||||
|
|
||||||
if old_deliverable['materials'].present? && old_deliverable['materials'] > 0.0
|
if old_deliverable['materials'].present? && old_deliverable['materials'] > 0.0
|
||||||
deliverable.overhead_budgets << OverheadBudget.new(:deliverable => deliverable,
|
deliverable.overhead_budgets << OverheadBudget.new(:deliverable => deliverable,
|
||||||
:budget => old_deliverable['materials'],
|
:budget => old_deliverable['materials'],
|
||||||
|
|||||||
Reference in new issue
Block a user