webERP Forum
PHP 8.0 The pain that must be endured. - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (http://www.weberp.org/forum/forumdisplay.php?fid=8)
+--- Thread: PHP 8.0 The pain that must be endured. (/showthread.php?tid=9295)



PHP 8.0 The pain that must be endured. - ALEXSHEN - 05-25-2023

Hi every,

Due to work requirements, I am now compelled to use WebERP in a PHP8 environment, which has caused many issues. I have managed to solve some problems on my own, but there are still many that I can't resolve. Therefore, I kindly request assistance here. I will gradually present my questions, hoping that you can help me find solutions.

Thank you!

Alex


1-When put customer receipt:
[attachment=1117]
It seems to be a time format issue. Tim made changes to this file before, and it used to work fine. However, later on, there were date format errors appearing on other functional pages.

[attachment=1118]

The error messages mentioned above don't seem to affect the functionality at the moment.


RE: PHP 8.0 The pain that must be endured. - ALEXSHEN - 05-28-2023

Finally, I found a solution:

1- In DateFunctions.inc, modify line 19
$DateEntry = trim($DateEntry ?? "");
to avoid having a NULL value.
2- Similarly, in MiscFunctions.php, modify line 284
return number_format(floatval($Number), $DecimalPlaces ?? 2, $DecimalPoint, $ThousandsSeparator);
to avoid having NULL as the value for $DecimalPlaces.

Of course, currently, I am just personally experimenting, and I don't know if it could cause any other harm, so please proceed with caution when trying these solutions.


RE: PHP 8.0 The pain that must be endured. - ALEXSHEN - 05-28-2023

In General Ledger -> Bank Account Payments Entry

Got error again

Deprecated: Creation of dynamic property Payment::$Paymenttype is deprecated in /www/wwwroot/erp-trade/webERP/Payments.php on line 185
[attachment=1119]


RE: PHP 8.0 The pain that must be endured. - ALEXSHEN - 05-28-2023

Modify DefinePaymentClass.php line 5, put below code:

public $Paymenttype;

It seems that this solution may resolve the issue. You can give it a try and see if it works.


RE: PHP 8.0 The pain that must be endured. - ALEXSHEN - 05-29-2023

New Problem:

When I selected Purchases->Purchase Order, the following error occurs again:

Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC, purchorders.realorderno, suppliers.suppname, purchorde' at line 25 in /erp/includes/ConnectDB_mysqli.inc:58 Stack trace: #0 /erp/includes/ConnectDB_mysqli.inc(58): mysqli_query() #1 /erp/PO_SelectOSPurchOrder.php(589): DB_query() #2 {main} thrown in /erp/includes/ConnectDB_mysqli.inc on line 58



RE: PHP 8.0 The pain that must be endured. - ALEXSHEN - 05-30-2023

(05-29-2023, 04:18 AM)ALEXSHEN Wrote: New Problem:

When I selected Purchases->Purchase Order, the following error occurs again:

Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC, purchorders.realorderno, suppliers.suppname, purchorde' at line 25 in /erp/includes/ConnectDB_mysqli.inc:58 Stack trace: #0 /erp/includes/ConnectDB_mysqli.inc(58): mysqli_query() #1 /erp/PO_SelectOSPurchOrder.php(589): DB_query() #2 {main} thrown in /erp/includes/ConnectDB_mysqli.inc on line 58
I made some modifications to PO_SelectOSPurchOrder.php, and it seems to be functioning fine now. I'm uploading it here, and if anyone is interested, they can cautiously give it a try.

[attachment=1120]


RE: PHP 8.0 The pain that must be endured. - dalescott - 07-27-2023

Congrats on your progress! How did you resolve cury braces in tcpdf, barcodepack and PHPExcel?


RE: PHP 8.0 The pain that must be endured. - ALEXSHEN - 08-04-2023

Because I don't use many features of this ERP system, my previous plan was to solve one problem at a time as I encountered them during operation. If I encountered two problems, I would solve them both. However, as I delved deeper, I realized that there were many areas that needed modification and adjustment. That's why I didn't release any new updates later on. My current plan is to cover all the functionalities I'm using and then upload the results.

Currently, I have only made some minor adjustments to the tcPDF and PHPExcel parts, and I haven't worked on BarcodePack because I have been adjusting it based on my own needs. So, I have been solving problems one by one, and it may not be very comprehensive. Once I have completed all the adjustments, I will list the modifications I made according to my own requirements. But I estimate that it will take a long time.


RE: PHP 8.0 The pain that must be endured. - ALEXSHEN - 09-29-2023

I am continuing to gradually modify some code that runs under PHP 8 to meet my own needs. However, I have encountered an issue now with the allocation of payments to suppliers after making a payment. When I click on 'allocate,' the system does not list the invoices that need to be allocated. There are no error messages either.

I tried to reallocate from a previously allocated payment, and I can cancel the original allocation association. However, when I try to allocate this payment to the corresponding invoice again, the above situation occurs. There are no error messages, but there is no list of invoices to be allocated, and there is no error or any other response.