Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Holger-Will/59cd25f96ba6949e2d45ed21b0fbf6fe to your computer and use it in GitHub Desktop.
Save Holger-Will/59cd25f96ba6949e2d45ed21b0fbf6fe to your computer and use it in GitHub Desktop.
gsheet stuff
/**
* Calculates the AMZ Warehouse fees
*
* @param {number} TotalAmount The total amount you plan to send to the warehouse
* @param {number} SellsPerDay The amout you sell per day.
* @param {number} PackageSize The size of the package in m³
* @param {number} AMZFee The AMZ warehouse fee (normal fee: 26€).
* @return the total cost for storing the supplied amount until it
* @customfunction
*/
function lagerKosten(TotalAmount, SellsPerDay, PackageSize, AMZFee) {
var x = TotalAmount/SellsPerDay
var tmp = -(SellsPerDay/2)*x*x + TotalAmount*x
return (tmp*PackageSize) * (AMZFee/30)
}
/**
* Calculates VK base on EK and costs
*
* @param {number} base The buying price + your margin (EK*factor)
* @param {number} fix the sum of all fixed prices.
* @param {number} prozent Variable cost in percent of the brutto price
* @return netto VK
* @customfunction
*/
function EKVK(base,fix,prozent){
var x = 1
for(var i = 2; i< arguments.length; i++){
x-=1.19*(arguments[i]/100)
}
return (base+fix) / x
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment