|
@ -273,7 +273,7 @@ func (t *Contracttab) Update(me *ContractInfo, lengthdate float64) error { |
|
|
addmonths := strings.Split(addlenght, ".") |
|
|
addmonths := strings.Split(addlenght, ".") |
|
|
adds := utils.ValueToFloat(addmonths[1], 0.0) * 0.3 |
|
|
adds := utils.ValueToFloat(addmonths[1], 0.0) * 0.3 |
|
|
adddays := utils.ValueToInt(adds, 0) - 1 |
|
|
adddays := utils.ValueToInt(adds, 0) - 1 |
|
|
endTime := time.Now().AddDate(0, utils.ValueToInt(addmonths[0], 0), adddays) |
|
|
|
|
|
|
|
|
endTime := begtime.AddDate(0, utils.ValueToInt(addmonths[0], 0), adddays) |
|
|
t.Enddate = utils.TimeFormat(endTime, "yyyy-MM-dd") |
|
|
t.Enddate = utils.TimeFormat(endTime, "yyyy-MM-dd") |
|
|
} else { |
|
|
} else { |
|
|
begtime, _ := utils.TimeParseyyyyMMdd(t.Begdate) |
|
|
begtime, _ := utils.TimeParseyyyyMMdd(t.Begdate) |
|
@ -288,7 +288,7 @@ func (t *Contracttab) Update(me *ContractInfo, lengthdate float64) error { |
|
|
addmonths := strings.Split(addlenght, ".") |
|
|
addmonths := strings.Split(addlenght, ".") |
|
|
adds := utils.ValueToFloat(addmonths[1], 0.0) * 0.3 |
|
|
adds := utils.ValueToFloat(addmonths[1], 0.0) * 0.3 |
|
|
adddays := utils.ValueToInt(adds, 0) - 1 |
|
|
adddays := utils.ValueToInt(adds, 0) - 1 |
|
|
endTime := time.Now().AddDate(0, utils.ValueToInt(addmonths[0], 0), adddays) |
|
|
|
|
|
|
|
|
endTime := begtime.AddDate(0, utils.ValueToInt(addmonths[0], 0), adddays) |
|
|
t.Enddate = utils.TimeFormat(endTime, "yyyy-MM-dd") |
|
|
t.Enddate = utils.TimeFormat(endTime, "yyyy-MM-dd") |
|
|
} |
|
|
} |
|
|
_, err = session.Table("contracttab").Cols("linkman", "mobile", "begdate", "enddate", "createtime", "createby", "lengthdate", "chargableexpense", "chargedexpense", "remake", "chargetime", "chargeway", "serialnumber").Where("cid = ? and contractid = ?", t.Cid, t.Contractid).Update(t) |
|
|
_, err = session.Table("contracttab").Cols("linkman", "mobile", "begdate", "enddate", "createtime", "createby", "lengthdate", "chargableexpense", "chargedexpense", "remake", "chargetime", "chargeway", "serialnumber").Where("cid = ? and contractid = ?", t.Cid, t.Contractid).Update(t) |
|
|