mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 00:44:18 -04:00
26 lines
491 B
JavaScript
26 lines
491 B
JavaScript
/**
|
|
* Import own modules
|
|
*/
|
|
const variables = require('../modules/variables');
|
|
|
|
/**
|
|
* Util function to calculate paper size based on voucher data
|
|
*/
|
|
module.exports = (voucher) => {
|
|
let base = variables.unifiSsid !== '' ? variables.unifiSsidPassword !== '' ? 415 : 375 : 260;
|
|
|
|
if(voucher.dataUsageLimitMBytes) {
|
|
base += 10;
|
|
}
|
|
|
|
if(voucher.rxRateLimitKbps) {
|
|
base += 10;
|
|
}
|
|
|
|
if(voucher.txRateLimitKbps) {
|
|
base += 10;
|
|
}
|
|
|
|
return base;
|
|
}
|