Topic: cannot receive items in Receive Purchase Order Items

FA 2.4.6
PHP 7.2
Centos 7.x

after apply fix from https://sourceforge.net/p/frontaccounting/activity
receive items cannot proceed, in error.log show
<b>DATABASE ERROR :</b> The supplier purchasing details could not be added<br>error code : 1406<br>error message : Data too long

for column 'supplier_description' at row 1<br><br><br>

checking that var from order line item is come with
table stock_master:
description         | varchar(200)

table purch_data:
supplier_description | char(50)

problem solved if:
ALTER TABLE `38_purch_data` MODIFY COLUMN `supplier_description` VARCHAR(200) DEFAULT NULL;

please advice how to solve, checking with fresh installation 2.4.6 is able to posting "Process Receive Items"
thanks

Re: cannot receive items in Receive Purchase Order Items

How many characters does your supplier description have?

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: cannot receive items in Receive Purchase Order Items

checked with 70char, but in the FA 2.4.6 purch_data supplier_description will save 50 first char and it saved

Re: cannot receive items in Receive Purchase Order Items

In the sql/en_US-new.sql standard chart, the fields with the word description in them are defined thus:

# grep description en_US-new.sql | grep -v KEY

  `description` varchar(60) NOT NULL DEFAULT '',
  `description` varchar(60) NOT NULL DEFAULT '',
  `description` varchar(60) DEFAULT NULL,
  `reason_description` char(100) NOT NULL DEFAULT '',
  `description` tinytext NOT NULL COMMENT 'usage description',
  `description` tinytext,
  `description` tinytext,
  `description` varchar(60) NOT NULL DEFAULT '',
  `description` varchar(200) NOT NULL DEFAULT '',
  `description` varchar(60) NOT NULL,
  `supplier_description` char(50) NOT NULL DEFAULT '',
  `description` tinytext,
  `description` varchar(60) NOT NULL,
  `description` varchar(60) NOT NULL DEFAULT '',
  `description` varchar(60) NOT NULL DEFAULT '',
  `description` tinytext,
  `description` varchar(50) DEFAULT NULL,
  `description` varchar(60) NOT NULL DEFAULT '',
  `description` varchar(200) NOT NULL DEFAULT '',
  `long_description` tinytext NOT NULL,
  `description` varchar(200) NOT NULL DEFAULT '',
  `long_description` tinytext NOT NULL,
  `description` tinytext,
  `description` varchar(60) DEFAULT NULL,
  `description` char(50) NOT NULL DEFAULT '',

In FA v2.5 alpha, it may be useful to classify the description field differently and standardize their field length / type uniformly.

In the following files that refer to supplier_description, there is no truncation occurring in the code (except where function text_row() is used):

inventory/purchasing_data.php
inventory/includes/db/items_purchases_db.inc
purchasing/includes/purchasing_db.inc
purchasing/includes/db/po_db.inc
reporting/rep209.php

Hence, a mere increase in field size is sufficient ordinarily.

However, where a form field restricts input size / max width using the function text_row() defined in includes/ui/ui_input.inc, changes in 4th (size) and 5th (max width) arguments will also be needed. This is so only in the first file listed above.