---
title: "Maintenance Job Card"
space: "Wiki"
url: "https://support.aakvatech.com/wiki/maintenance-job-card"
updated: "2026-07-22"
---

## 🧾 1. Overview

This module handles the automatic generation of **Sales Invoices** and **Stock Entries** for materials used during maintenance jobs in the **Property Management** module. It differentiates between POS billing, normal billing, and internal consumption (self-consumption).

---

## 🔑 2. Key Features

* Grouped and non-grouped billing logic
* Automatic creation of Sales Invoices (POS & Non-POS)
* Stock Entry creation for self-consumed items
* Tax template validation
* POS auto-payment handling
* Linkage between maintenance materials and generated documents

---

## 🧰 3. Pre-Requisites

Ensure the following configurations are in place before using the system:

* ✅ Default Company
* ✅ Property Cost Center
* ✅ POS Profile (for POS billing)
* ✅ Tax Templates for Maintenance
* ✅ Default Warehouse in Stock Settings
* ✅ Maintenance Item Groups in Property Settings

---

## 🧭 4. Step-by-Step Usage

1. **Create a Maintenance Job Card** with `materials_required` and `materials_billed` tables filled in.
2. **Ensure correct statuses** are marked: `Bill` or `Self Consumption`.
3. **Save** the Job Card. On save:

   * System creates Sales Invoice(s) for `Bill` items.
   * System creates Stock Entry for `Self Consumption` items (if Job Card is closed).
4. **Review messages** for links to created documents.
5. **Verify linkage** in the material rows (Invoice/Stock Entry fields).

---

## 🛠️ 5. Script Customizations

* `make_transaction(doc, for_self_consumption=False)` — main entry method
* `make_sales_invoice()` — handles invoice creation logic
* `make_stock_entry()` — handles material issue logic
* `validate_materials_required()` — prevents closure if unbilled
* `validate()` — ERPNext lifecycle hook to auto-trigger transactions

---

## 🧯 6. Troubleshooting (Common Errors and Resolutions)

| Error                                           | Reason                               | Resolution                                         |
| ----------------------------------------------- | ------------------------------------ | -------------------------------------------------- |
| "Please Setup Default Maintenance Tax Template" | Tax template missing in Company      | Set default\_maintenance\_tax\_template in Company |
| "Job cannot be closed"                          | Unbilled materials exist             | Ensure all `Bill` items are invoiced               |
| "POS Stock Entry cannot be created"             | POS is not allowed for stock entries | Uncheck POS flag for Self Consumption items        |

---

## 👥 7. User Roles and Permissions

| Role             | Permission Required                                  |
| ---------------- | ---------------------------------------------------- |
| Property Manager | Read & Write on Job Card, Sales Invoice, Stock Entry |
| Accounts User    | Read on Sales Invoice, access to tax templates       |
| Stores Clerk     | Read & Submit Stock Entry                            |

---

## 📌 8. Key Notes

* POS and self-consumption items are treated differently.
* Grouping logic is controlled via Property Management Settings.
* Auto-submission of invoices is configurable.
* All transactions are triggered automatically upon `Save` or `Close` of Job Card.

---

## 🚫 9. What Business Process Pain Point Does It Help Remove

* Eliminates **manual billing** for job materials
* Ensures **inventory accuracy** through automatic stock deduction
* Reduces **human error** in invoice creation
* Enforces **compliance** by validating tax and billing logic
* Speeds up **job-to-invoice** cycle for maintenance operations
