|
@@ -3821,36 +3821,37 @@ function updateProductTotalMessage(billingcycle) {
|
|
|
var orderDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth(), now.getDate()));
|
|
var orderDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth(), now.getDate()));
|
|
|
switch(billingcycle) {
|
|
switch(billingcycle) {
|
|
|
case 'monthly':
|
|
case 'monthly':
|
|
|
- billingDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth() + 1, 0));
|
|
|
|
|
|
|
+ billingDate = new Date(now.getFullYear(), now.getMonth() + 1, 0);
|
|
|
break;
|
|
break;
|
|
|
case 'quarterly':
|
|
case 'quarterly':
|
|
|
if (now.getMonth() < 3) {
|
|
if (now.getMonth() < 3) {
|
|
|
- billingDay = daysIntoYear(new Date(now.getFullYear(), 2, 31)); // 31.3.
|
|
|
|
|
|
|
+ billingDate = new Date(now.getFullYear(), 2, 31); // 31.3.
|
|
|
} else if (now.getMonth() < 6) {
|
|
} else if (now.getMonth() < 6) {
|
|
|
- billingDay = daysIntoYear(new Date(now.getFullYear(), 5, 30)); // 30.6.
|
|
|
|
|
|
|
+ billingDate = new Date(now.getFullYear(), 5, 30); // 30.6.
|
|
|
} else if (now.getMonth() < 9) {
|
|
} else if (now.getMonth() < 9) {
|
|
|
- billingDay = daysIntoYear(new Date(now.getFullYear(), 8, 30)); // 30.9.
|
|
|
|
|
|
|
+ billingDate = new Date(now.getFullYear(), 8, 30); // 30.9.
|
|
|
} else {
|
|
} else {
|
|
|
- billingDay = daysIntoYear(new Date(now.getFullYear(), 11, 31)); // 31.12.
|
|
|
|
|
|
|
+ billingDate = new Date(now.getFullYear(), 11, 31); // 31.12.
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case 'semiannually':
|
|
case 'semiannually':
|
|
|
if (now.getMonth() < 6) {
|
|
if (now.getMonth() < 6) {
|
|
|
- billingDay = daysIntoYear(new Date(now.getFullYear(), 5, 30)); // 30.6.
|
|
|
|
|
|
|
+ billingDate = new Date(now.getFullYear(), 5, 30); // 30.6.
|
|
|
} else {
|
|
} else {
|
|
|
- billingDay = daysIntoYear(new Date(now.getFullYear(), 11, 31)); // 31.12.
|
|
|
|
|
|
|
+ billingDate = new Date(now.getFullYear(), 11, 31); // 31.12.
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case 'annually':
|
|
case 'annually':
|
|
|
- billingDay = daysIntoYear(new Date(now.getFullYear(), 11, 31));
|
|
|
|
|
|
|
+ billingDate = (new Date(now.getFullYear(), 11, 31);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ billingDay = daysIntoYear(billingDate);
|
|
|
if ((billingDay - orderDay) < 12) {
|
|
if ((billingDay - orderDay) < 12) {
|
|
|
- jQuery('#producttotalmessage').html('Der Preis summiert sich aus den letzten ' + (billingDay - orderDay) + ' Tagen der aktuellen Zahlungsperiode und der folgenden.<br><br>');
|
|
|
|
|
|
|
+ jQuery('#producttotalmessage').html('Der Preis summiert sich aus den verbleibenden ' + (billingDay - orderDay) + ' Tagen der aktuellen Zahlungsperiode und der folgenden.<br><br>`);
|
|
|
} else {
|
|
} else {
|
|
|
jQuery('#producttotalmessage').html('Der Preis berechnet die letzten ' + (billingDay - orderDay) + ' Tage der aktuellen Zahlungsperiode.<br><br>');
|
|
jQuery('#producttotalmessage').html('Der Preis berechnet die letzten ' + (billingDay - orderDay) + ' Tage der aktuellen Zahlungsperiode.<br><br>');
|
|
|
}
|
|
}
|
|
|
- console.log(billingDay - orderDay);
|
|
|
|
|
|
|
+ console.log((billingDay - orderDay)) + 'Zahltag: ' + billingDate;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function daysIntoYear(date){
|
|
function daysIntoYear(date){
|