Created
July 8, 2019 07:54
-
-
Save Holger-Will/59cd25f96ba6949e2d45ed21b0fbf6fe to your computer and use it in GitHub Desktop.
gsheet stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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