[Vtigercrm-developers] Add new fields to line item

Patrick Allen Zulueta alexander.allenz at gmail.com
Mon May 3 15:29:10 GMT 2021


This works with vtiger 6 and Vtiger 7, sometimes gives error but in
reports, not in salesorder/quotes, etc.

In Vtiger 7 change path vlayout by v7

Here the successful VTIGER 6.5 code for adding custom field in the item
line.
The example is for adding the column dept in the quote details (in the db
the colum name is cf_quotes_dept)

Thanks to https://danssy.wordpress.com/2017/01/26/vtiger-6-5-add-
column-to-item-details-in-invoice-salesorder-quotes/ blog.

5 files have to be updated in VTIGER 6.5.

I will work soon on the VTIGER 7 code to set up the same field. I'll let
you know. To follow ....

Cathy


A. Add a column “cf_quotes_dept” to the vtiger_inventoryproductrel table.
With a VARCHAR type.

B. Edit the layouts/vlayout/modules/Inventory/LineItemsContent.tpl

a) Add:
b) Add: {assign var="dept" value="dept"|cat:$row_no}

C. Edit layouts/vlayout/modules/Inventory/LineItemsEdit.tpl
a) Add: *{vtranslate('LBL_DEPTLINE',$MODULE)}*


D. Edit layouts/vlayout/modules/Inventory/LineItemsDetail.tpl:
a) Add: *Dept*
b) Add: {$LINE_ITEM_DETAIL["dept$INDEX"]}

c)
E. Edit include/utils/EditViewUtils.php

a) Add: $product_Detail[$i]['dept'.$i]=$dept
b) Add: $dept=$adb->query_result($result,$i-1,'cf_quotes_dept');

c)
F. Edit include/utils/InventoryUtils.php
a) Add: $dept = vtlib_purify($_REQUEST['dept'.$i]);
b) Modifiy:
$query ="insert into vtiger_inventoryproductrel(id, productid, sequence_no,
quantity, listprice, comment, description,cf_quotes_dept)
values(?,?,?,?,?,?,?,?)";
$qparams = array($focus->id,$prod_id,$prod_seq,$qty,$listprice,$
comment,$description,$dept);

El lunes, 3 de mayo de 2021, Sukhdev Mohan <s.mohan at myti.it> escribió:

> Hi,
>
> How do you add new fields to line Item?
>
> Best Regards,
> *Sukhdev Mohan* | *Software Developer*
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20210503/1b6f2b2b/attachment.html>


More information about the vtigercrm-developers mailing list