Topic: Fixed Asset - Process Depreciation

Hello,


I made de Process Depreciation but nothing happens, I configure it like said in wiki and everything ok.

Doesn´t show any message so I don't know what should be the error.


https://photos.app.goo.gl/7P2d8FCoP6gd4u4cA
https://photos.app.goo.gl/Xti9mKaCrr32C6GX7

Thanks

Regards from Nicaragua

Post's attachments

ProcessDepreciation_Error.zip 12.1 kb, 2 downloads since 2019-11-09 

You don't have the permssions to download the attachments of this post.

Re: Fixed Asset - Process Depreciation

You have credited and debited the same account!

3 (edited by serviciosac101 11/14/2019 05:51:50 pm)

Re: Fixed Asset - Process Depreciation

Thanks for your answer,

I have the same account because I was testing. But I've changed the account and I had the same result.

Details Fixed Assets
https://photos.app.goo.gl/cT3zkR8aeEsSqsLF7

Process Depreciation
https://photos.app.goo.gl/w8pRCkBErYsfuBT29

Result
https://photos.app.goo.gl/SjaLGxAUhSuWynPUA


For more Information I give you the database and config.php


https://drive.google.com/open?id=1XOICJGBCBBZYHyraC3nYs0_ItYDHGdr_
https://drive.google.com/open?id=1nWlnfzAYGJXAOzDyVELQPjLPsLCG4tWI
https://drive.google.com/open?id=1xeHJPWXw-3CN-NQnd-UVXiTM9nKCQOz_

Post's attachments

Fixed_Assets_Depreciation.zip 107.3 kb, 1 downloads since 2019-11-12 

You don't have the permssions to download the attachments of this post.

Re: Fixed Asset - Process Depreciation

I've enter to debugging mode and get the following message, maybe because it, I can´t run the process:

ERROR DE BASE DE DATOS : Cannot add audit info
error code : 1264
error message : Out of range value for column 'trans_no' at row 1
sql that failed was : INSERT INTO audit_trail (type, trans_no, user, gl_date, description, stamp) VALUES('0', '-1',1,'2019-11-26','', CURRENT_TIMESTAMP)

https://photos.app.goo.gl/NCtQBrP4dH2aRLmL7

Post's attachments

AuditTrail_Error.png 43.2 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Fixed Asset - Process Depreciation

Your Transaction number is negative. How did that happen?

Re: Fixed Asset - Process Depreciation

Hello, I don´t Know how it happened, but, I reviewed the file fixed_assets/includes/fixed_assets_db.inc and I saw the code $update_no = -1

Now, I made the Process

Thanks for your answer

  $sql = "UPDATE ".TB_PREF."stock_master SET 
    depreciation_date='".date2sql($cart->tran_date)."',
    material_cost=".db_escape($new_cost)."
    WHERE stock_id=".db_escape($stock_id);
  db_query($sql,"The depreciation start date could not be updated");

  $update_no = -1;
  add_audit_trail(ST_JOURNAL, $update_no, $date_);
  commit_transaction();

  return $trans_no;

Re: Fixed Asset - Process Depreciation

Did you change the code? The above code is identical with that in the repo.
What did you do differently now that it works?

Re: Fixed Asset - Process Depreciation

Only change $update_no = -1 to $update_no = 1

Re: Fixed Asset - Process Depreciation

@joe: is this warranted?