TRS-ZS-574 交易确认书对接OA自动提交审批
This commit is contained in:
@@ -262,12 +262,14 @@ namespace YLErp.Modules.UnderlyingModule
|
||||
int totalMonths = (sourceDate.Value.Year - calcDate.Value.Year) * 12
|
||||
+ (sourceDate.Value.Month - calcDate.Value.Month);
|
||||
|
||||
if (sourceDate.Value.Day < calcDate.Value.Day)
|
||||
double fractionalMonth = 0;
|
||||
if (sourceDate.Value.Day != calcDate.Value.Day)
|
||||
{
|
||||
totalMonths--;
|
||||
int daysInMonth = DateTime.DaysInMonth(sourceDate.Value.Year, sourceDate.Value.Month);
|
||||
fractionalMonth = (sourceDate.Value.Day - calcDate.Value.Day) / (double)daysInMonth;
|
||||
}
|
||||
|
||||
double yearTerm = totalMonths / 12.0;
|
||||
double yearTerm = (totalMonths + fractionalMonth) / 12.0;
|
||||
return yearTerm;
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user