Fixed a bug where ad specials wasn't being processed properly. Updated the main form to add up all data in the Invoice Net Amount at Cost column instead of the Extended Retail column. Minor behavior fixes.
This commit is contained in:
@@ -73,6 +73,24 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
return holiday;
|
||||
}
|
||||
|
||||
//Source: http://stackoverflow.com/questions/2510383/how-can-i-calculate-what-date-good-friday-falls-on-given-a-year
|
||||
public static DateTime EasterSunday(int year)
|
||||
{
|
||||
var g = year % 19;
|
||||
var c = year / 100;
|
||||
var h = (c - c / 4 - (8 * c + 13) / 25 + 19 * g + 15) % 30;
|
||||
var i = h - h / 28 * (1 - h / 28 * (29 / (h + 1)) * ((21 - g) / 11));
|
||||
|
||||
var day = i - ((year + year / 4 + i + 2 - c + c / 4) % 7) + 28;
|
||||
var month = 3;
|
||||
|
||||
if (day <= 31) return new DateTime(year, month, day);
|
||||
month++;
|
||||
day -= 31;
|
||||
|
||||
return new DateTime(year, month, day);
|
||||
}
|
||||
}
|
||||
public enum Holidays
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user