Nama ERP DocsNama ERP Docs
Home
Namasoft.com
Data Model
GitHub
Home
Namasoft.com
Data Model
GitHub
  • Home

    • Search
    • Guides

      • Entity Flows
      • الفواتير والضرائب والخصومات
      • Supply Chain
      • e-commerce integration (Magento)
      • .
    • Examples
    • Reprocessing Transactions

      • Reprocessing Quantity, Cost, and Stock Ages
      • Accounting Utilities - Ledger and Debt Ages Reprocessing
      • Queries to Check for (and Fix) Cost And Qty Problems
      • Inventory Related Utility Queries
      • Manufacturing Utilities
      • Fixed Assets Module Utilities
      • Real Estate Utilities
      • Database Related Operations
      • Suggest Indexes for Large Detail Tables
      • General Purpose Utility Queries
      • Replication Utilities
      • .
    • Frequently Asked Questions
    • AI Generated Entity Flows Documentation

      • Core
      • Accounting Module
      • AI Module
      • Contracting Module
      • CRM Module
      • EGTax Reader Module
      • Freight Management System Module
      • Hospital Management System Module
      • HR Module
      • e-commerce Integration Module
      • Manufacturing Module
      • POS Module
      • Real Estate Module
      • Service Center Module
      • Supply Chain Module
      • .
    • Release Notes

      • 2016
      • 2017
      • 2018
      • 2019
      • 2020
      • 2021
      • 2022
      • 2025
      • .
    • Video Tutorials

      • Supply Chain Videos
      • Report Wizard Videos
      • Human Resources Videos
      • .

Fixed Assets Module Utilities

Fix Last Depreciation date of fixed assets whose depreciation was deleted

Details
update f set lastdepreciationdate = null from FixedAsset f left join FADepreciationLine l on l.fixedAsset_id = f.id
where l.id is null
update FixedAsset set lastdepreciationdate = (select MAX(FADepreciation.valueDate) from FADepreciationLine left join FADepreciation on FADepreciation.id = FADepreciationLine.fADepreciation_id
 where FADepreciation.commitedBefore = 1 and FADepreciationLine.fixedAsset_id = FixedAsset.id) 
update fa set lastDepreciationDate = dateadd(DAY,-1,od.valueDate) from FAOpeningDocument od left join FAOpeningDocLine ol on ol.FAOpeningDocument_id = od.id 
left join FixedAsset fa on fa.id= ol.fixedAsset_id
where od.commitedBefore = 1 and fa.lastDepreciationDate is null

Fix FAAdditionDeduction problem - entries always have zero addition/deduction

Details
update d set moneyLocalAmount = moneyRate*moneyValueAmount, addedOrDeductedValue = moneyRate*moneyValueAmount from FAAdditionDeduction d
update p set addition = d.moneyValueAmount from FAAdditionDeduction d inner join FAPropertiesEntry p  on d.propertiesEntry_id = p.id where d.addition = 1
update p set deduction = d.moneyValueAmount from FAAdditionDeduction d inner join FAPropertiesEntry p  on d.propertiesEntry_id = p.id where d.addition = 0

Edit On github
Last Updated:: 5/26/25, 3:09 PM
Prev
Manufacturing Utilities
Next
Real Estate Utilities