|
|
|
|
@@ -103,11 +103,11 @@
|
|
|
|
|
<span v-else>0 h</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">
|
|
|
|
|
<span v-if="week">{{ formatMinutes(week.base25Minutes) }}</span>
|
|
|
|
|
<span v-if="week">{{ formatMinutes(week.totalMinutes >= 0 ? week.base25Minutes : 0) }}</span>
|
|
|
|
|
<span v-else>0 h</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">
|
|
|
|
|
<span v-if="week">{{ formatMinutes(week.bonus25Minutes) }}</span>
|
|
|
|
|
<span v-if="week">{{ formatMinutes(week.totalMinutes >= 0 ? week.bonus25Minutes : 0) }}</span>
|
|
|
|
|
<span v-else>0 h</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500 border-r-2">
|
|
|
|
|
@@ -115,11 +115,11 @@
|
|
|
|
|
<span v-else>0 h</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">
|
|
|
|
|
<span v-if="week">{{ formatMinutes(week.base50Minutes) }}</span>
|
|
|
|
|
<span v-if="week">{{ formatMinutes(week.totalMinutes >= 0 ? week.base50Minutes : 0) }}</span>
|
|
|
|
|
<span v-else>0 h</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">
|
|
|
|
|
<span v-if="week">{{ formatMinutes(week.bonus50Minutes) }}</span>
|
|
|
|
|
<span v-if="week">{{ formatMinutes(week.totalMinutes >= 0 ? week.bonus50Minutes : 0) }}</span>
|
|
|
|
|
<span v-else>0 h</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500 border-r-2">
|
|
|
|
|
@@ -162,13 +162,13 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="px-5 py-[10px] font-bold text-primary-500 border border-primary-500">Reste</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center text-neutral-500 border border-primary-500 border-r-2">-</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(monthReport.base25 + totals.base25 - (currentPayment?.paidBase25Minutes ?? 0)) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(monthReport.bonus25 + totals.bonus25 - (currentPayment?.paidBonus25Minutes ?? 0)) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500 border-r-2">{{ formatMinutes(monthReport.total25 + totals.total25 - (currentPayment?.paidBase25Minutes ?? 0) - (currentPayment?.paidBonus25Minutes ?? 0)) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(monthReport.base50 + totals.base50 - (currentPayment?.paidBase50Minutes ?? 0)) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(monthReport.bonus50 + totals.bonus50 - (currentPayment?.paidBonus50Minutes ?? 0)) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500 border-r-2">{{ formatMinutes(monthReport.total50 + totals.total50 - (currentPayment?.paidBase50Minutes ?? 0) - (currentPayment?.paidBonus50Minutes ?? 0)) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(resteTotal) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(reste.base25) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(reste.bonus25) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500 border-r-2">{{ formatMinutes(reste.total25) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(reste.base50) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(reste.bonus50) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500 border-r-2">{{ formatMinutes(reste.total50) }}</td>
|
|
|
|
|
<td class="px-4 py-[10px] text-center font-bold text-primary-500 border border-primary-500">{{ formatMinutes(reste.total) }}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
@@ -419,13 +419,14 @@ const showMonthReportRow = computed(() => {
|
|
|
|
|
|
|
|
|
|
const totals = computed(() => {
|
|
|
|
|
const weeks = weeksForCurrentMonth.value
|
|
|
|
|
const positive = weeks.filter((w) => w.totalMinutes >= 0)
|
|
|
|
|
return {
|
|
|
|
|
overtime: weeks.reduce((s, w) => s + w.overtimeMinutes, 0),
|
|
|
|
|
base25: weeks.reduce((s, w) => s + w.base25Minutes, 0),
|
|
|
|
|
bonus25: weeks.reduce((s, w) => s + w.bonus25Minutes, 0),
|
|
|
|
|
base25: positive.reduce((s, w) => s + w.base25Minutes, 0),
|
|
|
|
|
bonus25: positive.reduce((s, w) => s + w.bonus25Minutes, 0),
|
|
|
|
|
total25: weeks.reduce((s, w) => s + w.base25Minutes + w.bonus25Minutes, 0),
|
|
|
|
|
base50: weeks.reduce((s, w) => s + w.base50Minutes, 0),
|
|
|
|
|
bonus50: weeks.reduce((s, w) => s + w.bonus50Minutes, 0),
|
|
|
|
|
base50: positive.reduce((s, w) => s + w.base50Minutes, 0),
|
|
|
|
|
bonus50: positive.reduce((s, w) => s + w.bonus50Minutes, 0),
|
|
|
|
|
total50: weeks.reduce((s, w) => s + w.base50Minutes + w.bonus50Minutes, 0),
|
|
|
|
|
total: weeks.reduce((s, w) => s + w.totalMinutes, 0),
|
|
|
|
|
}
|
|
|
|
|
@@ -442,8 +443,19 @@ const paidTotal = computed(() => {
|
|
|
|
|
return -(p.paidBase25Minutes + p.paidBonus25Minutes + p.paidBase50Minutes + p.paidBonus50Minutes)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const resteTotal = computed(() => {
|
|
|
|
|
return monthReport.value.total + totals.value.total + paidTotal.value
|
|
|
|
|
const reste = computed(() => {
|
|
|
|
|
const total25 = monthReport.value.total25 + totals.value.total25
|
|
|
|
|
- (currentPayment.value?.paidBase25Minutes ?? 0) - (currentPayment.value?.paidBonus25Minutes ?? 0)
|
|
|
|
|
const total50 = monthReport.value.total50 + totals.value.total50
|
|
|
|
|
- (currentPayment.value?.paidBase50Minutes ?? 0) - (currentPayment.value?.paidBonus50Minutes ?? 0)
|
|
|
|
|
|
|
|
|
|
const base25 = Math.round(total25 / 1.25)
|
|
|
|
|
const bonus25 = total25 - base25
|
|
|
|
|
const base50 = Math.round(total50 / 1.5)
|
|
|
|
|
const bonus50 = total50 - base50
|
|
|
|
|
const total = monthReport.value.total + totals.value.total + paidTotal.value
|
|
|
|
|
|
|
|
|
|
return { base25, bonus25, total25, base50, bonus50, total50, total }
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// --- Format ---
|
|
|
|
|
|