diff --git a/config/settings.py b/config/settings.py index 26684a0..318a684 100644 --- a/config/settings.py +++ b/config/settings.py @@ -175,6 +175,10 @@ CONTACT_EMAIL_TO = [ if item.strip() ] +# Spark Receipt Email — payslip and receipt PDFs are sent here for accounting +# Set SPARK_RECEIPT_EMAIL in your .env file (e.g. receipts@spark.co.za) +SPARK_RECEIPT_EMAIL = os.getenv("SPARK_RECEIPT_EMAIL", "") + # When both TLS and SSL flags are enabled, prefer SSL explicitly if EMAIL_USE_SSL: EMAIL_USE_TLS = False diff --git a/core/templates/core/email/payslip_email.html b/core/templates/core/email/payslip_email.html new file mode 100644 index 0000000..ad7a262 --- /dev/null +++ b/core/templates/core/email/payslip_email.html @@ -0,0 +1,88 @@ + + +
+ + + +| Description | +Amount | +
|---|---|
| Advance Payment: {{ advance_description }} | +R {{ advance_amount|floatformat:2 }} | +
| Base Pay ({{ logs_count }} days worked) | +R {{ logs_amount|floatformat:2 }} | +
| {{ adj.get_type_display }}: {{ adj.description }} | ++ {% if adj.type in deductive_types %}- {% endif %}R {{ adj.amount|floatformat:2 }} + | +
Net Pay: R {{ record.amount_paid|floatformat:2 }}
+Payslip No. #{{ record.id|stringformat:"06d" }}
+ID Number: {{ record.worker.id_number }}
+Phone: {{ record.worker.phone_number|default:"—" }}
++ PAID +
+| Date | +Project | +Notes | +Amount | +
|---|---|---|---|
| {{ log.date|date:"M d, Y" }} | +{{ log.project.name }} | +{{ log.notes|default:"—"|truncatechars:50 }} | +R {{ record.worker.daily_rate|floatformat:2 }} | +
| + No work logs in this period. + | +|||
| Base Pay Subtotal | +R {{ base_pay|floatformat:2 }} | +||
| Date | +Type | +Description | +Amount | +
|---|---|---|---|
| {{ adj.date|date:"M d, Y" }} | ++ {{ adj.get_type_display }} + | +{{ adj.description }} | ++ {% if adj.type in deductive_types %} + - R {{ adj.amount|floatformat:2 }} + {% else %} + + R {{ adj.amount|floatformat:2 }} + {% endif %} + | +
| Base Pay: | +R {{ base_pay|floatformat:2 }} | +
| Adjustments Net: | ++ {% if adjustments_net >= 0 %} + + R {{ adjustments_net|floatformat:2 }} + {% else %} + - R {{ adjustments_net_abs|floatformat:2 }} + {% endif %} + | +
| Net Payable: | +R {{ record.amount_paid|floatformat:2 }} | +
This is a computer-generated document and does not require a signature.
+Payer: Fox Fitt © 2026
+| Description | +Amount | +
|---|---|
| Advance Payment: {{ advance_description }} | +R {{ advance_amount|floatformat:2 }} | +
| Base Pay ({{ logs_count }} days worked) | +R {{ logs_amount|floatformat:2 }} | +
| {{ adj.get_type_display }}: {{ adj.description }} | ++ {% if adj.type in deductive_types %}- {% endif %}R {{ adj.amount|floatformat:2 }} + | +
Net Pay: R {{ record.amount_paid|floatformat:2 }}
+