Re: Import Transactions

When I run into corruption issues (almost always my own doing), I usually try to use the usual FA web interface to remove the transactions, because it usually is tolerant of the corruption and often cleans it up correctly.  And if it leaves any residue, the residue is usually easy to remove with mysql or phpadmin.

This is often easier than trying to repair the damage.  Afterwards, you would then recreate the transactions correctly.

Re: Import Transactions

A backup and restore may suffice better when no other users are trying to enter data.

153

Re: Import Transactions

hi trying to import transaction but get the following error

[12-Jan-2022 03:01:40 Europe/Berlin] <b>DATABASE ERROR :</b> <br>At file /var/www/nts/modules/import_transactions/includes/import_sales_cart_class.inc:321:<br>order Cannot be Added<br>error code : 1366<br>error message : Incorrect double value: '' for column `TECH360Live`.`0_sales_orders`.`prep_amount` at row 1<br>sql that failed was :

INSERT INTO 0_sales_orders (order_no, type, debtor_no, trans_type, branch_code, customer_ref, reference, comments, ord_date,
        order_type, ship_via, deliver_to, delivery_address, contact_phone,
        freight_cost, from_stk_loc, delivery_date, payment_terms, total, prep_amount)
        VALUES ('3','0','1', '30','1', '113/2021','auto','','2021-10-05', '1', '1','Tropical Garments','', '', '0', '1', '2021-10-05','4','61.5','')

<br><br><br>


any help would be of great assistance.

Re: Import Transactions

Probably at one time mysql allowed implicit conversion of null into zero and now it doesn't, breaking the sales order import code.

I am not familiar with this code, but it appears that the extension's read function fails to call update_payments function, unlike the base code.  So prep_amount is never set.  This is a problem with the code.

If you don't care about the prep_amount feature, you could initialize it to zero in the constructor (__construct function in /var/www/nts/modules/import_transactions/includes/import_sales_cart_class.inc):

$this->prep_amount = 0;

Re: Import Transactions

The said field sales_orders.prep_amount is defined as:

`prep_amount` double NOT NULL DEFAULT '0',

The default for double type field may not be accepted as 0 in your MySQL version or needs to be 0.0. and / or the initialisation to be:

$this->prep_amount = 0.0;