Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
d96d2c590e | |||
da9be74050 | |||
7d3f13657f
|
|||
0be774531c
|
|||
8393855514 | |||
756b51309a
|
|||
cef66f2bd4
|
|||
2aa80e094a
|
@ -17,7 +17,7 @@ from dotenv import load_dotenv
|
|||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
APP_VERSION = "0.1.2"
|
APP_VERSION = "0.1.4"
|
||||||
|
|
||||||
load_dotenv(BASE_DIR / ".env")
|
load_dotenv(BASE_DIR / ".env")
|
||||||
|
|
||||||
|
19
dispatcher/migrations/0011_alter_project_parent.py
Normal file
19
dispatcher/migrations/0011_alter_project_parent.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 5.1.5 on 2025-04-23 20:09
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('dispatcher', '0010_realsagexhours_unique_monthly_sagex'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='project',
|
||||||
|
name='parent',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='dispatcher.parent'),
|
||||||
|
),
|
||||||
|
]
|
@ -15,7 +15,8 @@ class Project(models.Model):
|
|||||||
parent = models.ForeignKey(
|
parent = models.ForeignKey(
|
||||||
Parent,
|
Parent,
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
null=True
|
null=True,
|
||||||
|
blank=True
|
||||||
)
|
)
|
||||||
name = models.CharField(max_length=256)
|
name = models.CharField(max_length=256)
|
||||||
|
|
||||||
|
@ -229,7 +229,9 @@ class Table {
|
|||||||
durations[i] = hours
|
durations[i] = hours
|
||||||
total += hours
|
total += hours
|
||||||
parentDurations[i] += hours
|
parentDurations[i] += hours
|
||||||
|
if (parent.is_productive) {
|
||||||
this.dailyTotals[i] += hours
|
this.dailyTotals[i] += hours
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
id: project.id,
|
id: project.id,
|
||||||
@ -239,6 +241,7 @@ class Table {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (parentDurations.reduce((a, b) => a + b, 0) !== 0) {
|
||||||
this.addProject(
|
this.addProject(
|
||||||
parent.id,
|
parent.id,
|
||||||
parent.name,
|
parent.name,
|
||||||
@ -251,6 +254,7 @@ class Table {
|
|||||||
projects.filter(p => p.total !== 0).forEach(project => {
|
projects.filter(p => p.total !== 0).forEach(project => {
|
||||||
this.addProject(project.id, project.name, "", project.durations)
|
this.addProject(project.id, project.name, "", project.durations)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.updateTotals()
|
this.updateTotals()
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="day-dates"></tr>
|
<tr class="day-dates"></tr>
|
||||||
<tr class="day-totals">
|
<tr class="day-totals">
|
||||||
<th colspan="2">TOTAL</th>
|
<th colspan="2">Total Productive</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
Reference in New Issue
Block a user