Topic: "Transfer between bank accounts" mesage

I'm on the last lap of FA testing before taking it out to Hong Kong (from London) and have a message being issued by the 'transfer between bank accounts' option.

For any transfer available, I get an error message. Each bank account I have set up maps to its own GL account in the C of A. The error message is issued in error.inc with $db_duplicate_error_code set (to 1062?) and is "The entered information is a duplicate ...". Effectively the only information you can enter is selecting from the two drop downs and it is generated from any pair of codes.

I have check the database integrity with phpMyAdmin and all the tables seem fine.

Any help or other experience on this gratefully received .. where should I be looking?

many TIA

Tim

Re: "Transfer between bank accounts" mesage

Nothing obvious. Please set $go_debug=1 temporarily in config.php file and try again. This way you will have displayed also sql command which cause the duplication problem.
Janusz

Re: "Transfer between bank accounts" mesage

Janusz

Thanks for the suggestion. I did this, and get the error

DATABASE ERROR : could not add reference entry
error code : 1062
error message : Duplicate entry '1-4' for key 'PRIMARY'
sql that failed was : INSERT INTO 0_refs (type, id, reference) VALUES ('4', '1', '2')

I haven't really sat down at looked at the E-R structure here yet to figure out the exact role of 0_refs, but preumably it is the next internal reference  number to be used and something is out of sync ??  The INSERT if I dump the database is

INSERT INTO `0_bank_accounts` VALUES ('1062', '1', '1062 HSBC Current Account USD', '002', 'HSBC USD', NULL, 'USD', '0', '15', '0000-00-00 00:00:00', '0', '0');
INSERT INTO `0_bank_accounts` VALUES ('1060', '1', '1060  HSBC Current account HKD', '001', 'HSBC HKD', NULL, 'HKD', '1', '3', '0000-00-00 00:00:00', '0', '0');
INSERT INTO `0_bank_accounts` VALUES ('1064', '1', '1064 HSBC Current  account GBP', '003', 'HSBC GBP', NULL, 'GBP', '0', '8', '0000-00-00 00:00:00', '0', '0');
INSERT INTO `0_bank_accounts` VALUES ('1090', '3', 'Petty cash HKD', '004', 'Petty cash HKD', NULL, 'HKD', '0', '9', '0000-00-00 00:00:00', '0', '0');
INSERT INTO `0_bank_accounts` VALUES ('1092', '3', 'Petty cash USD', '005', 'Petty cash USD', NULL, 'USD', '0', '10', '0000-00-00 00:00:00', '0', '0');
INSERT INTO `0_bank_accounts` VALUES ('1094', '3', 'Petty cash JPY', '007', 'Petty cash JPY', NULL, 'JPY', '0', '11', '0000-00-00 00:00:00', '0', '0');
INSERT INTO `0_bank_accounts` VALUES ('1096', '3', 'Petty cash SGD', '008', 'Petty cash SGD', NULL, 'SGD', '0', '12', '0000-00-00 00:00:00', '0', '0');
INSERT INTO `0_bank_accounts` VALUES ('1098', '3', 'Petty cash CNY', '009', 'Petty cash CNY', NULL, 'CNY', '0', '13', '0000-00-00 00:00:00', '0', '0');
INSERT INTO `0_bank_accounts` VALUES ('1093', '3', 'Petty cash GBP', '006', 'Petty cash GBP', NULL, 'GBP', '0', '16', '0000-00-00 00:00:00', '0', '0');

which looks sensible - all the keys are unique here.

Should I be looking at 0_refs to understand this? There is only one row in this table with values 1,4,1.

Thanks

Tim

PS I haven't touched a line of code for 30 years so sorry I can't dig into the php more :-(

Re: "Transfer between bank accounts" mesage

The problem is in 0_refs table, not bank_accounts. I don't know how it happened, but seems that  transaction number '1'  is already used in 0_refs. This can be fixed just by removal 0_refs record where  type=4 and id=1. Seems this record lasted after some earlier gl bank transfer transaction removal. Haven't you removed it manually?

Janusz

Re: "Transfer between bank accounts" mesage

I think I've got to the bottom of this.

I cleared the 0_refs table, and the bank account transfer appeared to go ok, but when looking at the entries, the first entry of several it said that it was voided. On excamination, it was clear that the id numbers were out of sync, and I then spotted

INSERT INTO `0_voided` VALUES ('4', '1', '2010-01-01', '');

in my backup file. I recall that right at the begining I voided a transaction when loading in the refernce data (Chart of Accounts and so on) and  it seems that this entry caused the 'voided' indication.

I went back to the backup file, removed the insert, and voila! the 'voided' note went away and all seems well. It may this particular sequence of events causes a small problem (and may have been the cause of the erroneous 0_refs entry in the first place - I may repeat the sequence), but it is now fixed.

Janusz, thank you for your help ! Marvellous support!

Tim

Re: "Transfer between bank accounts" mesage

Please confirm the sequence to let me understand the problem:
1. bank transfer was voided
2. database was restored from another sql file
3. error appeared on next bank transfer entry.
Is this right? What was the file with 'reference data' you have loaded in mean time? Was it some previous backup file, some COA found on our download page, en_US-demo.sql bundled with FA tarball  or any other customized sql file?

Janusz

Re: "Transfer between bank accounts" mesage

Janusz

I am about to set off to Homg Kong, but when I get back I will repeat the whole sequence of my load up events in a clean system and see if this caused the problem, and if so document this fully to send it to you (which I will do via e-mail).

Many thanks

Tim