I think I found the problem on the db backend.
I'll report back when I have an update
Tom
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Posts by tom
I think I found the problem on the db backend.
I'll report back when I have an update
Tom
Looking at the code I see debug to create dbimport.txt which starts with
Array
(
[0] => Array
(
[0] => SET NAMES latin1
[1] => 11
)
)
So it saw the SET NAMES latin1;
but yet it sends utf8
Why is the default utf8, was that used prior to FA 2.3?
Found it!
Would there be any harm changing the default latin1?
2023-02-24 09:40:59 +0100 Joe
PHP 8.1 onwards db_set_charset needs second parameter not null. Fixed with default utf8.
M admin/db/maintenance_db.inc
Tom
I enabled general logging and it seems to stop working
after
2024-12-29T17:07:18.634304Z 10 Query SET foreign_key_checks=1
2024-12-29T17:07:18.634803Z 10 Query SET NAMES utf8
See below - another mysql setting I am missing?
2024-12-29T17:07:18.204770Z 9 Execute INSERT INTO backlog (seq, query, timestamp) VALUES (1066,'INSERT INTO `0_tax_group_items` VALUES\n(\'1\', \'1\', \'1\')',1735492038161)
2024-12-29T17:07:18.208097Z 10 Query INSERT INTO `0_tax_group_items` VALUES
('1', '1', '1')
2024-12-29T17:07:18.294283Z 9 Execute INSERT INTO backlog (seq, query, timestamp) VALUES (1067,'INSERT INTO `0_tax_groups` VALUES\n(\'1\', \'Tax\', \'0\'),\n(\'2\', \'Tax Exempt\', \'0\')',1735492038253)
2024-12-29T17:07:18.296397Z 10 Query INSERT INTO `0_tax_groups` VALUES
('1', 'Tax', '0'),
('2', 'Tax Exempt', '0')
2024-12-29T17:07:18.379515Z 9 Execute INSERT INTO backlog (seq, query, timestamp) VALUES (1068,'INSERT INTO `0_tax_types` VALUES\n(\'1\', \'5\', \'2150\', \'2150\', \'Tax\', \'0\')',1735492038338)
2024-12-29T17:07:18.382010Z 10 Query INSERT INTO `0_tax_types` VALUES
('1', '5', '2150', '2150', 'Tax', '0')
2024-12-29T17:07:18.465588Z 9 Execute INSERT INTO backlog (seq, query, timestamp) VALUES (1069,'INSERT INTO `0_users` VALUES\n(\'1\', \'admin\', \'5f4dcc3b5aa765d61d8327deb882cf99\', \'Administrator\', \'2\', \'\', \'adm@example.com\', \'C\', \'0\', \'0\', \'0\', \'0\', \'default\', \'Letter\', \'2\', \'2\', \'4\', \'1\', \'1\', \'0\', \'0\', \'2021-05-07 13:58:33\', \'10\', \'1\', \'1\', \'1\', \'1\', \'0\', \'orders\', \'30\', \'0\', \'1\', \'0\', \'0\', \'0\')',1735492038424)
2024-12-29T17:07:18.468261Z 10 Query INSERT INTO `0_users` VALUES
('1', 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@example.com', 'C', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2021-05-07 13:58:33', '10', '1', '1', '1', '1', '0', 'orders', '30', '0', '1', '0', '0', '0')
2024-12-29T17:07:18.551540Z 9 Execute INSERT INTO backlog (seq, query, timestamp) VALUES (1070,'INSERT INTO `0_workcentres` VALUES\n(\'1\', \'Work Centre\', \'\', \'0\')',1735492038511)
2024-12-29T17:07:18.554467Z 10 Query INSERT INTO `0_workcentres` VALUES
('1', 'Work Centre', '', '0')
2024-12-29T17:07:18.631815Z 9 Execute INSERT INTO backlog (seq, query, timestamp) VALUES (1071,'SET foreign_key_checks=1',1735492038595)
2024-12-29T17:07:18.634304Z 10 Query SET foreign_key_checks=1
2024-12-29T17:07:18.634803Z 10 Query SET NAMES utf8
2024-12-29T17:07:18.714956Z 9 Execute INSERT INTO backlog (seq, query, timestamp) VALUES (1072,'UPDATE 0_sys_prefs SET value = \'Flux Testing\' WHERE name=\'coy_name\'',1735492038674)
I have a FA plugin that will read WP database to import/sync orders/customers as well as prices.
How can I submit for review/inclusion in the FA plugins?
There are 2 tables - stock_category and stock_master - that have the field mb_flag in FA default installation. The former has it as dflt_mb_flag.
There are a total of 53 files with the field mb_flag in them in the core FA.
mb_flag values:
F => Fixed Asset
B =>Purchased - Default in the tables, used only in reports rep3*.php as item.mb_flag='B' OR item.mb_flag='M'
M => Manufactured
D =>Service (S old flag)Which file has mb_flag='A' ?
Do any of these flags control/modify how the cost of an item is calculated?
Is average the only method that is currently supported?
Would the (majority) of the changes needed to support FIFO be localized into a few functions?
FIFO means the COGS is directly related to the exact cost of buying the oldest item being sold
So if the cost shot up the COGS would not change until all the existing inventory was sold.
Thanks
Tom
Which file has mb_flag='A' ?
Ha Ha... changelog
2014-09-12 08:15:34 +0200 Joe
Removed redundant mb_flag 'A'.
M includes/db/manufacturing_db.inc
I saw it but did not realize it was a comment! (commit comment no less)
Is there a list of the mb_flag values and their meanings?
I searched the code and found A B D F and M, but no comments listing the values and meanings
tom
I'd like to help, we might be able to translate COBOL into PHP without too much trouble
I am just not sure how to add an option within FA for handling that on a case by case basis (GL Code, Globally?)
But is it something that is needed
I see a number of messages questioning how the item cost is handled be it a fixed cost or an average cost.
I am honestly not sure which is right.
Nor how to correct it if it gets miss adjusted...
I am also interested in implementing a FIFO method where the cost is the cost of the item when it was purchased.
So if I bought 100 widgets at $4 each and later got 200 and paid $6 each as I sold them the price would follow the purchases
I could sell 90 and the cost would be $4 each and then if I sold 20 then 10 would be at cost $4 and 10 at cost $6
I guess if a transaction were voided and freed up some $4 units then a later sale would get some at $4
I am a php programmer so can do some of the work, but I could use some guidance as to WHERE to make the changes...
This might be usable for normal inventory, but it is also needed for handling of Crypto as a material asset
tom
If I use a CSV Import file for inventory adjustments and I have the correct price for each record then WILL FA compute the correct gain or loss?
Or maybe the question is are there some other matching transactions I need to generate and import as well?
The FIFO aspect is one I am not sure FA handles properly, I want to get this right now so I don't discover an issue 5 years from now and have to clean up a big mess...
I am not overly concerned with live import, I was considering monthly import maybe via CSV profit/loss and tax reporting
I saw your other post, not sure which thread is most appropriate...
The basic thought process is to keep track of crypto may be something like
Treat the crypto like an inventory item (physical asset) and then import transactions much like 'Inventory Adjustments'
The GL transactions would track the value if each individual inventory item
It is much like knowing how much each item is as you sell it, as opposed to averaging the cost across all the inventory on hand
(Can FA do this now? It is could be used on normal inventory items)
Some transactions would appear as Income and others would be converting between crypto/FIAT (ie USD, etc)
I am not sure how these actions are handled with the GL accounts
I need some education on this.
Would the Import Transactions be a good place or should I take break off and make a new module?
Tom
It dawned upon me that what I referred to as "current asset value" was actually Cost Basis.
I also think that both the Cost Basis, Unrealized Gains and Profit are all Tax/Reporting issues.
So I think I need to better understand how item cost is calculated and used in inventory.
More later
Tom
One aspect of my business is to perform cryptocurrency mining (Proof Of Work) generating income as an asset.
How could we manage this type of ledger?
Generally Crypto is considered an Asset and POW coins more so since they can not be minted (created) out of thin air.
My first thought is they are very much like an Inventory Item (Physical Asset) that has an account (GL?) tracking the realized value.
For example if I earn 20 coins while the value (price) is $0.50 the value/income if $10.00
If I sell 5 coins at $1.50 that would obviously be an additional $5 of income and I think typically the income would be calculated on the oldest unsold coins, First In, First Out
So at this point we have $15 of income and a current asset value of (20-5)*1.50 = $22.50 with Unrealized gains of $15.00
Are my thoughts on this reasonably accurate?
I think these point are common to all localities, but the calculation of Long/Short Term Gains would be left to tax calculations
I am not looking to pay someone to do this, but could use some help.
I do not believe such a fundamental feature qualifies as an add-on that is sold.
So I am asking for anyone who has the skills to do it contribute their time which is the whole point of open source.
Supporting Crypto will help keep FA relevant and I do not think these changes will be overly dramatic to implement.
Anyone interested in working with me?
--
Tom
PS
I have been using FA for over 15 years and have submitted every modification I needed for my shop as either a patch or extension.
For example:
Bank Fees on customer payments
osCommerce customer/order import extension
I am currently working on a WooCommerce order import extension which I will make freely available in the core FA repo
My son and I are also deploying FA as a turnkey application on Flux Web services (runonflux.io) which is a distributed compute network on a blockchain
Ok, I was able to manually import the US demo data and I get an error:
ERROR 1067 (42000) at line 35: Invalid default value for 'tran_date'
The table is:
CREATE TABLE `0_attachments` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`description` varchar(60) NOT NULL DEFAULT '',
`type_no` int(11) NOT NULL DEFAULT '0',
`trans_no` int(11) NOT NULL DEFAULT '0',
`unique_name` varchar(60) NOT NULL DEFAULT '',
`tran_date` date NOT NULL DEFAULT '0000-00-00',
`filename` varchar(60) NOT NULL DEFAULT '',
`filesize` int(11) NOT NULL DEFAULT '0',
`filetype` varchar(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `type_no` (`type_no`,`trans_no`)
) ENGINE=InnoDB;
I am using mysql:8.3.0 (docker image)
Maybe I need to use an older version. The docs did not recommend any specific mySQL version...
Thanks!
ps. I don't think I can use an older mysql due to some clustering that is being done.
I did see that the valid date range is : The supported range is '1000-01-01' to '9999-12-31'.
Will the default value of 1000-01-01 cause any SQL issues?
I am doing a fresh install on a new hosting platform
In the setup wizard I get the db connection setup ok, but when I import the COA with or without demo data I get
504 Gateway Timeout
any suggestions where to look?
Is the import data local or being pulled from an FA site?
Tom
Is the zip file better than git master branch?
The README.md file has a GitHub Mirror Link:
https://github.com/FrontAccountingERP/FA
Both the github mirror and sf.net git do not have release tags for 2.4.18 so is master the latest release?
I am building a docker image and it's usually best to refer to the version tag so a rebuild doesn't get an unexpected update.
(Yes I know it is really mature... just good practice...)
Maybe a 2.4.18 tag could be added? (github or sf, either is fine)
Tom
The README.md file has a GitHub Mirror Link:
https://github.com/FrontAccountingERP/FA
Both the github mirror and sf.net git do not have release tags for 2.4.18 so is master the latest release?
I am building a docker image and it's usually best to refer to the version tag so a rebuild doesn't get an unexpected update.
(Yes I know it is really mature... just good practice...)
Maybe a 2.4.18 tag could be added? (github or sf, either is fine)
Tom
I feel I am being dense, but I will ask anyway.
So if I want to submit updates or bug fixes I should github or git.code.sf.net?
Tom
I would have but all the webpages point to CVS and sf and the labels are not current
Is there a repo I can access / clone / help again?
I found the problem
elseif( $Mode == 'Delete')
{
//the link to delete a selected record was clicked instead of the submit button
$cancel_delete = 0;
// PREVENT DELETES IF DEPENDENT RECORDS IN 'bank_trans'
if (key_in_foreign_table($bank_id, 'bank_trans', 'bank_act') || key_in_foreign_table(get_post('account_code'), 'gl_trans', 'account'))
{
$cancel_delete = 1;
display_error(_("Cannot delete this bank account because transactions have been created using this account."));
}
get_post('account_code') returns 1060 and the bank_id I am trying to delete has account 1063
Maybe it should get t he account from the bank account info...
What's the best way to fix this?
This worked:
$myrow = get_bank_account($bank_id);
if (key_in_foreign_table($bank_id, 'bank_trans', 'bank_act') || key_in_foreign_table($myrow['account_code'], 'gl_trans', 'account'))
Tom
I am having problems deleting old bank accounts, even some I have not used for many years.
I have deleted all but the current Fiscal Year.
In bank inquiry I found opening balances for this year in gl_trans and bank_trans and even with those removed I can't delete the bank account
This account uses GL 1063 (and it's the only bank account using that one)
I have 4 that all use 1060 which may need more care
Suggestions?
How do you increase that time?
FrontAccounting forum → Posts by tom
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.