Projectoperationreturn Documentation
Project Material Returns Controller Documentation
File: /controllers/projectoperationControllerreturn.php
Purpose: Manage material returns from projects with inventory restoration and reverse accounting
Last Updated: 2024-12-20
---
๐ Overview
Primary Functions
- โ Material return processing
- โ Inventory quantity restoration
- โ Reverse accounting entries
- โ Return transaction management
- โ Audit trail maintenance
Related Controllers
- โข projectoperationController.php - Material issuance
- โข projectController.php - Project master data
---
๐๏ธ Database Tables
Primary Tables
| Table Name | Purpose | Key Columns | |
|---|---|---|---|
| projectexchmaterialreturn | Return transaction header | id, serilno, projectid, storeid, totalbuyprice | |
| projectexchmaterialdetailreturn | Return transaction lines | projectexchid, productid, pronumber, probuyprice |
Same as projectoperationController.php with return-specific variants
---
๐ง Key Functions
1. add($id)
Purpose: Process material returns with inventory and accounting restoration
Business Logic:
// Reverse accounting entry
$dailyEntry->entryComment = 'ุชู
ุงุฑุฌุงุน ุตุฑู ู
ูุงุฏ ููู
ุดุฑูุน';
// Increase inventory quantities (opposite of issue)
$productquantityFromAfter = increaseProductQuantity($storedetailFromId, $productquantityFromBefore, $productnumber);
// Create return audit trail
insertStorereport($productid, $storeid, $productnumber, $productquantityFromBefore, $productquantityFromAfter, 0, $projmaterialid, "ู
ุฑุชุฌุน ุตุฑู ู
ูุงุฏ ููู
ุดุฑูุน " . $projectName,"projectoperationControllerreturn.php");
2. Accounting Integration
Return Entry Logic:
DR: Goods Under Settlement $amount
CR: Project Account $amount
Comment: "ุชู
ุงุฑุฌุงุน ุตุฑู ู
ูุงุฏ ููู
ุดุฑูุน"
---
โ ๏ธ Known Issues & Fixes
Issue 1: Same Tree Creation Bug (Line 417)
Problem: Uses undefined $txtName instead of $projectName
Cause: Copy-paste from material issue controller
Fix: Replace with correct variable
File: Line 417
---
๐ Related Documentation
- โข Material Issuance
- โข Project Master