Skip to content

Instantly share code, notes, and snippets.

View Azsaturndx's full-sized avatar

Azael Pérez Azsaturndx

  • Big Wave Data
  • Nuevo León, México.
View GitHub Profile
/**
* Cumulative Interest
* (SQL Server)
* AzsaturnDx (2022) - No copyright at all
*
* Returns the cumulative interest paid on a loan between @start and @end periods.
*
* @Rate FLOAT - Required. The interest rate.
* @Periods INT - Required. The total number of payment periods.
* @Value INT - Required. The present value.
@Azsaturndx
Azsaturndx / refreshPeriodically.js
Created October 12, 2020 18:29
Refresh a Grid periodically - Code onTime
/**
* Reloads a dataView every periodically
* (Code onTime)
* AzsaturnDx (2020) - No copyright at all
*
* Reload data from the contextDataview
*
* Implementation:
* 1.- Copy this to a file.
* 2.- Copy this file to (...)/app/js/
@Azsaturndx
Azsaturndx / System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
Created June 5, 2020 23:30
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
@Azsaturndx
Azsaturndx / hideRoles.js
Created April 9, 2020 20:54
Hide role GUI controls - Code onTime
/**
* Hide Roles controls
* (Code onTime)
* AzsaturnDx (2020) - No copyright at all
*
* Hides all role-based controls from user.
*
*/
// Expressed in milliseconds
@Azsaturndx
Azsaturndx / preventClosingSes.js
Last active February 25, 2020 06:49
Auto refresh user token - Code onTime
/**
* Prevent user session closing
* (Code onTime)
* AzsaturnDx (2020) - No copyright at all
*
* Prevents the user from logging out by constantly refreshing userToken (re-logging-in according to: daf.js)
*
* REQUIRES: Your COT project must have the Account Manager enabled.
*/
@Azsaturndx
Azsaturndx / PPMT.sql
Created February 18, 2020 23:49
PPMT Function (Principal Payment) - SQL Server
/**
* Principal Payment
* (SQL Server)
* AzsaturnDx (2020) - No copyright at all
*
* Returns the payment on the principal for a given period for an investment based on periodic, constant payments and a constant interest rate.
*
* @Rate FLOAT - Required. The interest rate per period.
* @Period INT - Required. Specifies the period and must be in the range 1 to nper.
* @Periods INT - Required. The total number of payment periods in an annuity.
@Azsaturndx
Azsaturndx / EFFECT.sql
Created February 18, 2020 23:37
EFFECT Function (Effective Annual Interest Rate) - SQL Server
/**
* Effective Annual Interest Rate
* (SQL Server)
* AzsaturnDx (2020) - No copyright at all
*
* Returns the effective annual interest rate, given the nominal annual interest rate and the number of compounding periods per year.
*
* @Rate FLOAT - Required. The nominal interest rate.
* @Periods INT - Required. The number of compounding periods per year.
* @return FLOAT Effective Annual Interest Rate.
@Azsaturndx
Azsaturndx / financial-functions.md
Last active April 19, 2024 16:31
Financial functions (SQL SERVER)
@Azsaturndx
Azsaturndx / IPMT.sql
Last active June 1, 2022 13:46
IPMT Function (Interest payment) - SQL Server
/**
* Interest Payment
* (SQL Server)
* AzsaturnDx (2020) - No copyright at all
*
* Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
*
* @Rate FLOAT - Required. The interest rate per period.
* @Period INT - Required. Specifies the period and must be in the range 1 to nper.
* @Periods INT - Required. The total number of payment periods in an annuity.
@Azsaturndx
Azsaturndx / FV.sql
Last active June 1, 2022 13:46
FV Function (Future value) - SQL Server
/**
* Future Value (FV)
* (SQL Server)
* AzsaturnDx (2020) - No copyright at all
*
* Calculates the future value of an investment based on a constant interest rate. You can use FV with either periodic, constant payments, or a single lump sum payment.
*
* @Rate FLOAT - Required. The interest rate for the loan.
* @Periods INT - Required. The total number of payments for the loan.
* @Payment FLOAT - Required. The payment made each period; it cannot change over the life of the annuity.