Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP 8.0 The pain that must be endured.
05-25-2023, 11:51 PM,
#1
PHP 8.0 The pain that must be endured.
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:
   
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.

   

The error messages mentioned above don't seem to affect the functionality at the moment.
Reply
05-28-2023, 07:52 AM, (This post was last modified: 05-28-2023, 07:53 AM by ALEXSHEN.)
#2
RE: PHP 8.0 The pain that must be endured.
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.
Reply
05-28-2023, 08:02 AM,
#3
RE: PHP 8.0 The pain that must be endured.
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
   
Reply
05-28-2023, 08:57 AM,
#4
RE: PHP 8.0 The pain that must be endured.
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.
Reply
05-29-2023, 04:18 AM,
#5
RE: PHP 8.0 The pain that must be endured.
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
Reply
05-30-2023, 11:17 PM,
#6
RE: PHP 8.0 The pain that must be endured.
(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.


.php   PO_SelectOSPurchOrder.php (Size: 28.13 KB / Downloads: 0)
Reply
07-27-2023, 06:31 PM,
#7
RE: PHP 8.0 The pain that must be endured.
Congrats on your progress! How did you resolve cury braces in tcpdf, barcodepack and PHPExcel?
http://www.dalescott.net
Reply
08-04-2023, 06:46 AM,
#8
RE: PHP 8.0 The pain that must be endured.
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.
Reply
09-29-2023, 08:04 AM,
#9
RE: PHP 8.0 The pain that must be endured.
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)