Contracts

Be sure your league is setup properly before installing any scripts.Setup Video
The Contracts script is a custom module you can place on your site. The directory contains an uncompressed version of the file if you want to edit or host yourself. There are numerous options to set , so read through everything in the script once you install on your site.
This is a very detailed script with a ton of options to setup your Dyntasy Contracts. Without going into a lot of detail , please review this forum thread and post if you have any questions. http://forums.myfantasyleague.com/forums/index.php?showtopic=35664
All scripts require cache.js and font awesome file to be placed in a header message as the 1st line. Please review the section "Custom Scripts" Here
Custom template users do not need to load cache.js or font awesome.

Contracts JSPlace in any HPM

<div id="contractReportButtonContainer" class="form_buttons"></div>
<div id="contractReportWrapper" style="display:none">
	<div id="contractReportContainer" style="width: 100%;">
		<div id="contractReportDropdown"></div>
		<div id="contractReportTable" class="mobile-wrap"></div>
		<!-- YOU CAN EDIT LEGEND BELOW AS NEEDED; REMOVE style="display:none" TO DISPLAY LEGEND -->
		<div id="contractReportLegend" style="display:none">
			<ul style="text-align:left">LEGEND
				<li class="optionYear">Option Year</li>
				<li class="optionYearExercised">Option Exercised</li>
				<li class="optionYearNotExercised">Option Not Exercised</li>
				<li class="tagYear">Tagged</li>
			</ul>
		</div>
	</div>
</div>

<script>
//////////////////////////////////////////////

//   CUSTOM SETTINGS FOR CONTRACT REPORT    //

//////////////////////////////////////////////

/////////////////////////////////////////

//          GENERAL SETTINGS           //

/////////////////////////////////////////

	var contractReport_useTriggerButton = true;
	var contractReport_hideMinimizeButton = false;
	var showContractStatus = false;
	var showContractStatusTitle = false;
	var contractYearsToShow = 6;
	var maxContractLength = 5;
	var salaryWithCommas = true;
	var summaryHeader = "LEAGUE SUMMARY";
	var includeOmitCurrentYearOption = false;
	var includeCutTradeOption = false;
	var includeAssignContractOption = false;
	var includeRolloverOption = false; 	

//////////////////////////////////////////

//        SALARY DISPLAY SETTING        //

//////////////////////////////////////////

	//0: 1,100,000=>1.10m; 100,000=>0.10m; 1,100=>1.10k; 100=>0.10k   10=>10.00
	//1: 1,100,000=>1.1m;   100,000=>0.1m;  1,100=>1.1k;  100=>0.1k    10=>10.0
	//2: 1,100,000=>1000k;  100,000=>100k;  1,000=>1k;    100=>100     10=>10
	//3: 1,100,000=>1m;     100,000=>0m;    1,100=>1k;    100=>0k      10=>10     ROUND OFF
	//4: 1,000=>1,000.00;   100=>100.00;    10=>10.00;    1=>1.00
	//5: 1,000=>1,000.0;    100=>100.0;     10=>10.0;     1=>1.0
	//6: 1,000=>1,000;      100=>100;       10=>10;       1=>1
	//7: 1,175,000=>1.175m; 100,000=>100k;  1,000=>1k;    100=>100     10=>10
	//8: 1,175,000=>1.18m;  100,000=>100k;  1,000=>1k;    100=>100     10=>10
	//9: 1,175,000=>1.2m;   100,000=>100k;  1,000=>1k;    100=>100     10=>10
	var salaryDisplaySetting = 1;
	var salaryAdjustmentsDisplaySetting = 7;
	var salaryTotalsDisplaySetting = 0;
	var summaryTableDisplaySettings = 0;	

///////////////////////////////////////////////////

//       CONTRACT VALUE FROM ONE YEAR TO NEXT    //	

///////////////////////////////////////////////////

	// 0 = Salary is same from one year to next
	// 1 = Salary increases by specific percentage from one year to next
	// 2 = Salary increases by variable percentage from one year to next (also use yearlyContractPercentIncrease Array)
	// 3 = Salary increases by specific dollar amount from one year to next 
	// 4 = Salary increases by variable dollar amount from one year to next (also use yearlyContractDollarIncrease Array)
	// 5 = GM Dynasty Rule salary in contract info field; contract seasons separate by slash guaranteed salary bracketed; 

	var yearlyContractSalaryRule = 0;

	//For Salary Rule 1
	var yearlyContractSalaryPercent = 0.1; // Format use 0.1 for 10%; 0.2 for 20% etc.

	//For Salary Rule 2
	var yearlyContractPercentIncrease = new Array(0.0,0.1,0.15,0.15);
	var percentIncreaseIsCumulative = true;

	//For Salary Rule 3
	var yearlyContractSalaryDollar = 1; 

	//For Salary Rule 4
	var yearlyContractDollarIncrease = new Array(0,100000,200000,300000);
	var dollarIncreaseIsCumulative = true;

	//For Salary Rule 5
	var contractSalaryMultiplier = 1.00;

	// ROUNDING RULES IF SALARY IS INCREASED FROM ONE SEASON TO NEXT ON A PERCENT BASIS
	// 0 = no round
	// 1 = round off
	// 2 = round up
	// 3 = round down
	var salaryRoundingRule = 1;
	var salaryRoundingDecimal = 0;
	//FOR VARIABLE INCREASE IN SALARY FROM ONE YEAR TO NEXT
	// Use "[x,x,x]" in ContractInfo field to define variable contracts
	// If format found then it will override above rules	

//////////////////////////////////////////

//            SIGNING BONUS             //

//////////////////////////////////////////

	//SIGNING BONUS USING CONTRACT STATUS FIELD
	var contractSigningBonus = 0; // 0=>n/a, 1=>bonus to year 1 only, 2=>bonus divided evenly amongst all seasons
	var includeRemainingSigningBonusColumn = false;
	var remainingSigningBonusHeader = "Signing<br>Bonus";
	var remainingSigningBonusTitle = "Remaining Signing Bonus";	

//////////////////////////////////////////

//   TRADE / SALARY ADJUSTMENT RULES    //

//////////////////////////////////////////

	// 0 = NO RETAINED SALARY
	// 1 = RETAIN ALL REMAINING SIGNING BONUS IN CURRENT SEASON
	// 2 = RETAIN ALL REMAINING SIGNING BONUS IN APPLICABLE SEASON
	// 3 = RETAIN ALL REMAINING SIGNING BONUS USING TRADE ROLLOVER 
	var tradeRule = 0;
	var tradePercent = 1.00;

	//TRADE ROLLOVER; IF SET TO TRUE THEN TRADING A PLAYER PRIOR TO ROLLOVER DATE WILL APPLY ALL CAP PENALTIES TO CURRENT SEASON AND AFTER TRADE DATE THEN CURRENT SEASON APPLIED TO CURRENT SEASON AND REMAINING APPLIED TO NEXT SEASON

	var useTradeRolloverDate = false;
	var tradeRolloverDate = new Date("June 1, 2017").getTime()/1000;	

//////////////////////////////////////////

//   BUYOUT / SALARY ADJUSTMENT RULES   //

//////////////////////////////////////////

	//SHOW BUYOUT TOTAL AS A SEPARATE LINE ITEM
	var showBuyoutTotal = false;

	//BUYOUT RULES
	// 0 = APPLY BUYOUT TO CURRENT SEASON ONLY (AND/OR NEXT SEASON USING buyoutCutoffDate OR buyoutRolloverDate)
	// 1 = APPLY BUYOUT TO ALL SEASONS REMAINING ON CONTRACT
	// 2 = APPLY BUYOUT USING buyoutBaseMultiplier & buyoutSumSalaryRemainingYears ARRAYS
	// 3 = APPLY BUYOUT USING buyoutBaseMultiplier & buyoutYearsRemainingMultiplier WHERE "years" IS USED AS TRIGGER

	// NOTE: RULES 1 TO 3 USE yearsBuyoutIdentifier WHICH IS "TEXT" FOUND IN THE SALARY ADJUSTMENTS API THAT PRECEDES CONTRACT LENGTH
	var buyoutRule = 0;
	var buyoutPercent = 1.00;	

	//IF buyoutRule = 0 THEN BELOW SETTINGS ARE IGNORED

		var yearsBuyoutIdentifier = "Years: ";
		var buyoutBaseMultiplier = new Array(0.5,"years",0,0,0,0);
		var buyoutSumSalaryRemainingYears = new Array(false,true);
		var buyoutYearsRemainingMultiplier = new Array(0,0.15,0.25,0.35,0.45);

	//BUYOUT CUTOFF; IF SET TO TRUE THEN ALL BUYOUTS OCCURRING AFTER DATE WILL BE APPLIED TO NEXT SEASON

	var useBuyoutCutoffDate = false;
	var buyoutCutoffDate = new Date("June 1, 2020").getTime()/1000;

	//BUYOUT ROLLOVER; IF SET TO TRUE THEN BUYING OUT A PLAYER PRIOR TO ROLLOVER DATE WILL APPLY ALL CAP PENALTIES TO CURRENT SEASON AND AFTER BUYOUT DATE THEN CURRENT SEASON APPLIED TO CURRENT SEASON AND REMAINING APPLIED TO NEXT SEASON

	var useBuyoutRolloverDate = false;
	var buyoutRolloverDate = new Date("June 1, 2017").getTime()/1000;

	//BUYOUT OTHER SETTINGS

	var buyoutIgnore = new Array("Carryover");
	var buyoutCustomRule = new Array();
	buyoutCustomRule[0] = ({"keyword":"Carryover","arrayStart":"[","arrayEnd":"]"});
	var showCompleteBuyoutDescription = true;

///////////////////////////////////////////////////////

//          RFA / UFA / CONTRACT EXTENSION RULES     //

///////////////////////////////////////////////////////

	//RFA / UFA RULES APPLICALBLE WHEN CONTRACT EXPIRES
	// 0 = NO UFAS; EVERYONE CAN BE EXTENDED TO MAX CONTRACT LENGTH
	// 1 = NO RFAS; NO ONE CAN BE EXTENDED WHEN CONTRACT EXPIRES
	// 2 = LENGTH IS ONE YEAR LESS THAN ORIGINAL CONTRACT (BY DEFAULT 1 YR CONTRACTS BECOME UFA).  CAN USE VARIOUS CONTRACT EXCEPTION ARRAYS TO FORCE UFA STATUS.
	// 3 = ONLY PLAYERS WITH CERTAIN CONTRACT STATUS CAN BE EXTENDED (ALSO USES contractStatusExtension array())
	// 4 = ONLY PLAYERS WITH CERTAIN CONTRACT INFO CAN BE EXTENDED (ALSO USES contractInfoExtension array())
	// 5 = ONLY PLAYERS WITH CASE SENSITIVE STRING FOUND IN CONTRACT STATUS CAN BE EXTENDED (ALSO USES contractStatusExtension array())
	// 6 = ONLY PLAYERS WITH CASE SENSITIVE STRING FOUND IN CONTRACT INFO CAN BE EXTENDED (ALSO USES contractInfoExtension array())

	var contractExtensionRule = 0;
	var contractStatusExtension = new Array();
	var contractInfoExtension = new Array();
	var contractYearException = new Array();
	var contractInfoException = new Array();
	var contractStatusException = new Array();
	var contractDraftedException = new Array();
	var contractHideRfaUfaStatus = false;	

	//SPECIAL RULES

	var auditionLength = 0; //# weeks to audition BBID player before offering contract. 
	var contractStatusOptionYear = new Array(); //case sensitive string found in contract status add class "optionYear"
	var contractInfoOptionYear = new Array(); //case sensitive string found in contract info add class "optionYear"
	var contractStatusTagYear = new Array(); //case sensitive string found in contract status add class "tagYear"
	var contractInfoTagYear = new Array(); //case sensitive string found in contract info add class "tagYear"
	var contractStatusOptionYearExercised = new Array(); //case sensitive string found in contract status add class "optionYearExercised"
	var contractInfoOptionYearExercised = new Array(); //case sensitive string found in contract info add class "optionYearExercised"
	var contractInfoOptionYearNotExercised = new Array(); //case sensitive string found in contract info add class "optionYearNotExercised"	

	//SETTING BELOW TO TRUE WILL SHOW POTENTIAL SALARY EXTENSIONS

	//  AND SETTING TO FALSE WILL SHOW "RFA"
	var showPotentialRFASalaries = false;

		//IF ABOVE IS SET TO TRUE ENTER MULTIPLIER TO ASSIGN NEW CONTRACT SALARY MULTIPLIER BY SEASON
		var contractExtensionMultiplier = new Array(1.25,1.45,1.60,1.70,1.75);
	

////////////////////////////////////////	

//     INJURED RESERVE SETTINGS       //

////////////////////////////////////////

	var separateInjuredReservePlayers = false;
	var includeIRSalaryForFutureSeasons = true;	

////////////////////////////////////////	

//          TAXI SQUAD SETTINGS       //

////////////////////////////////////////

	var separateTaxiSquadPlayers = true;
	var includeTaxiSquadSalaryForFutureSeasons = true;
	var useRostersDraftedColumnHistory = false;

	//IF ABOVE IS SET TO FALSE THEN BELOW SETTINGS WILL BE IGNORED
	var showTaxiDraftRound = false;
	var showTaxiSalary = false;
	var taxiYearsToShow = 5;

	//if salary is determined by draft round fill in the following array
	var taxiSquadRoundSalary = new Array(800000,700000,600000,500000,400000,300000,200000,100000);
	var taxiSquadContractMultiplier = new Array(1,2,3,4,5,0,0,0,0);

	//to override above for some taxi salaries (based on round AND pick) use below array
	var taxiSquadRoundPickSalary = new Array();

	//EXAMPLE: var taxiSquadRoundPickSalary = ({ "1.1":1000000 , "1.2":1000000 , "1.3":1000000 , "1.4":1000000 , "1.5":900000 , "1.6":900000 , "1.7":900000 , "1.8":900000 });
	//TAXI SALARY RULE
	// 0 = Use salary
	// 1 = Use round and multiplier to calculate salary
	var taxiSalaryRule = 0;
	var applyRFARulesToTaxiSquad = true;	

//////////////////////////////////////////

//        OTHER SETTINGS                //

//////////////////////////////////////////

	//ENTER SALARY CAP ADJUSTMENTS BY SEASON
	var contractMinimumSalary = 0;
	var salaryCapAdjustments = new Array(0,0,0,0,0,0);
	var isSalaryCapAdjustmentMultiplier = false;	

	var useDecimalFormatContractYears = false; // example 1.4 is year 1 of a 4 year contract
	var useSlashFormatContractYears = false; // example 1/4 is year 1 of a 4 year contract

	var useContractStatusAsContractLength = false;
	var useContractInfoAsContractLength = false;	

	var useContractStatusAsOriginalContractLength = false;
	var useContractInfoAsOriginalContractLength = false;

	var useContractInfoAsCapHit = false;	

	var contractReportSeparateTeamPositionColumn = false;

	var contractReportIncludeByeWeekColumn = false;

	var contractReportIncludeContractStatusColumn = false;

	var contractReportContractStatusTitle = "";

	var contractReportIncludeContractYearColumn = false;

	var contractReportContractYearTitle = "";	

	var includeRemainingSalaryColumn = false;

	var includeRemainingBaseSalaryColumn = false;

	var includeRemainingGuaranteedSalaryColumn = false;

	var remainingSalaryHeader = "Remaining<br>Salary";

	var remainingSalaryTitle = "Remaining Salary";

	var remainingBaseSalaryHeader = "Base<br>Salary";

	var remainingBaseSalaryTitle = "Remaining Base Salary";

	var remainingGuaranteedSalaryHeader = "Guaranteed<br>Salary";

	var remainingGuaranteedSalaryTitle = "Remaining Guaranteed Salary";	

	var contractSalaryForOpenRosterSpot = ({"salary":0,"applyToFutureYears":false,"includeIRCurrentYear":false,"includeIRFutureYear":false,"includeCurrentYearInContractTotal":false});

</script>

<script src="https://www.mflscripts.com/mfl-apps/contract/script.js"></script>