kreditoren statistik
This commit is contained in:
parent
520c0e996c
commit
2742379b37
2 changed files with 19 additions and 9 deletions
|
|
@ -409,7 +409,7 @@ public class DebitorStatistikController implements Serializable {
|
|||
|
||||
// Datasets 1
|
||||
result = result + "{label: 'Zahlungsziel',borderWidth: 1,";
|
||||
result = result + " \"backgroundColor\" : [\"#EBA05F\"],";
|
||||
result = result + " \"backgroundColor\" : [\"#3B6B82\"],";
|
||||
|
||||
result = result + "data: [";
|
||||
for (Map.Entry<String, DebitorStatistikData> entry : stats.entrySet()) {
|
||||
|
|
@ -422,7 +422,7 @@ public class DebitorStatistikController implements Serializable {
|
|||
|
||||
// Datasets 2
|
||||
result = result + "{label: 'Zahldauer',borderWidth: 1,";
|
||||
result = result + " \"backgroundColor\" : [\"#70B088\" ],";
|
||||
result = result + " \"backgroundColor\" : [\"#CFE9F5\" ],";
|
||||
|
||||
result = result
|
||||
+ " trendlineLinear: { colorMin: \"red\", colorMax: \"green\", lineStyle: \"dotted\", width: 2 , projection: true },";
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@ public class DebitorStatistikData {
|
|||
int month;
|
||||
int year;
|
||||
|
||||
int count = 0;
|
||||
int averageDueDays; // Zahlungsziel
|
||||
int averagePaymentDays; // Tatsächliche Zahlung
|
||||
long count = 0;
|
||||
long averageDueDays; // Zahlungsziel
|
||||
long averagePaymentDays; // Tatsächliche Zahlung
|
||||
long totalDueDays;
|
||||
long totalPaymentDays;
|
||||
|
||||
public DebitorStatistikData(Date date) {
|
||||
// Create a Calendar instance and set the date
|
||||
|
|
@ -57,7 +59,10 @@ public class DebitorStatistikData {
|
|||
long diffMilliseconds = milliseconds2 - milliseconds1;
|
||||
long dueTime = diffMilliseconds / (24 * 60 * 60 * 1000);
|
||||
logger.info("...Fälligkeit in tagen= " + dueTime);
|
||||
averageDueDays = (int) (averageDueDays + dueTime / count);
|
||||
|
||||
totalDueDays = totalDueDays + dueTime;
|
||||
// averageDueDays = (long) (totalDueDays / count);
|
||||
averageDueDays = Math.round((double) totalDueDays / count);
|
||||
|
||||
// Bezahlt nach Tagen
|
||||
milliseconds1 = invoiceDate.getTime();
|
||||
|
|
@ -65,16 +70,21 @@ public class DebitorStatistikData {
|
|||
// Berechnen Sie die Differenz in Millisekunden
|
||||
diffMilliseconds = milliseconds2 - milliseconds1;
|
||||
long paymentTime = diffMilliseconds / (24 * 60 * 60 * 1000);
|
||||
|
||||
// Fix differenz
|
||||
// paymentTime = paymentTime - dueTime;
|
||||
logger.info("...Zahlung erfolgte nach tagen= " + paymentTime);
|
||||
averagePaymentDays = (int) (averagePaymentDays + paymentTime / count);
|
||||
totalPaymentDays = totalPaymentDays + paymentTime;
|
||||
// averagePaymentDays = (long) (totalPaymentDays / count);
|
||||
averagePaymentDays = Math.round((double) totalPaymentDays / count);
|
||||
|
||||
}
|
||||
|
||||
public int getAverageDueDays() {
|
||||
public long getAverageDueDays() {
|
||||
return averageDueDays;
|
||||
}
|
||||
|
||||
public int getAveragePaymentDays() {
|
||||
public long getAveragePaymentDays() {
|
||||
return averagePaymentDays;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue