andre 4 anni fa
parent
commit
2eb7e393e0
1 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 6 2
      js/scripts.js

+ 6 - 2
js/scripts.js

@@ -3822,6 +3822,7 @@ function updateProductTotalMessage(billingcycle) {
     switch(billingcycle) {
         case 'monthly':
             billingDate = new Date(now.getFullYear(), now.getMonth() + 1, 0);
+            periodString = 'Monats';
             break;
         case 'quarterly':
             if (now.getMonth() < 3) {
@@ -3833,6 +3834,7 @@ function updateProductTotalMessage(billingcycle) {
             } else {
                 billingDate = new Date(now.getFullYear(), 11, 31); // 31.12.
             }
+            periodString = 'Quartals';
             break;
         case 'semiannually':
             if (now.getMonth() < 6) {
@@ -3840,16 +3842,18 @@ function updateProductTotalMessage(billingcycle) {
             } else {
                 billingDate = new Date(now.getFullYear(), 11, 31); // 31.12.
             }
+            periodString = 'Halbjahres';
             break;
         case 'annually':
             billingDate = new Date(now.getFullYear(), 11, 31);
+            periodString = 'Jahres';
             break;
     }
     billingDay = daysIntoYear(billingDate);
     if ((billingDay - orderDay) < 12) {
-        jQuery('#producttotalmessage').html('Der Preis summiert sich aus den verbleibenden ' + (billingDay - orderDay) + ' Tagen der aktuellen Zahlungsperiode und der folgenden.<br>Nächste Fälligkeit ist am ' + billingDate.toLocaleDateString());
+        jQuery('#producttotalmessage').html('Der Preis summiert sich aus den verbleibenden ' + (billingDay - orderDay) + ' Tagen bis zum Ende dieses ' + periodString + ' und des nächsten ' + periodString + '.<br>Nächste Fälligkeit ist am ' + billingDate.toLocaleDateString());
     } else {
-        jQuery('#producttotalmessage').html('Der Preis berechnet die letzten ' + (billingDay - orderDay) + ' Tage der aktuellen Zahlungsperiode.<br>Nächste Fälligkeit ist am ' + billingDate.toLocaleDateString());
+        jQuery('#producttotalmessage').html('Der Preis berechnet die letzten ' + (billingDay - orderDay) + ' Tage dieses ' + periodString + '.<br>Nächste Fälligkeit ist am ' + billingDate.toLocaleDateString());
     }
     console.log((billingDay - orderDay)) + 'Zahltag: ' + billingDate;
 }