<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Sans Unicode";
        panose-1:2 11 6 2 3 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">It is quite easy to do (after you’ve done it once !) you can add the fields using vtlib functionality (and copying the table details etc from existing fields) – then you just have to update the relevant
 template (as currently the templates only populate specific fields, so have to add your new fields to the right templates)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">There was a tiny bit of JavaScript that got changed, which if I  remember correctly was all around data validation.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I do have some notes  somewhere on how to do it, but they are not easy to read !<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> vtigercrm-developers-bounces@lists.vtigercrm.com <vtigercrm-developers-bounces@lists.vtigercrm.com>
<b>On Behalf Of </b>Sukhdev Mohan<br>
<b>Sent:</b> 04 May 2021 14:14<br>
<b>To:</b> vtigercrm-developers@lists.vtigercrm.com<br>
<b>Subject:</b> Re: [Vtigercrm-developers] Add new fields to line item<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ciao Angelo,<o:p></o:p></p>
<div>
<p class="MsoNormal">This is interesting. I know for sure that the payment version of Vtiger let’s you do that. Now the question is how do we replicate this, your solution seems reasonable and could be fast to implement. We could cooperate sure, also we are
 both from Italy and speak Italian, communications could be easier.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="color:black">Best Regards,<br>
<b>Sukhdev Mohan</b> | <b>Software Developer</b><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Il giorno 4 mag 2021, alle ore 09:28, info sito <<a href="mailto:info@angelopaglialonga.com">info@angelopaglialonga.com</a>> ha scritto:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Sukhdev!<o:p></o:p></p>
<div>
<p class="MsoNormal">I would create line item fields possibly via vtlib , use js to load on document ready your new columns (reading them via ajax from table) and use an aftersave event to save new columns values via mysql query.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">It you’re interested we could develop it together , what do you think?<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">_______________<br>
<br>
Angelo Paglialonga<br>
Consulente per soluzioni CRM ad alto ROI.<br>
<br>
Telefono: 3386077866<br>
Skype: angelo.paglialonga<br>
Web: <a href="https://www.angelopaglialonga.com/">https://www.angelopaglialonga.com</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Il giorno 3 mag 2021, alle ore 17:36, Sukhdev Mohan <<a href="mailto:s.mohan@myti.it">s.mohan@myti.it</a>> ha scritto:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Wow thanks<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Will this work with quotes?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Il lun 3 mag 2021, 17:34 Patrick Allen Zulueta <<a href="mailto:alexander.allenz@gmail.com">alexander.allenz@gmail.com</a>> ha scritto:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">This works with vtiger 6 and Vtiger 7, sometimes gives error but in reports, not in salesorder/quotes, etc.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In Vtiger 7 change path vlayout by v7<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Lucida Sans Unicode",sans-serif">Here the successful VTIGER 6.5 code for adding custom field in the item line.<br>
The example is for adding the column dept in the quote details (in the db the colum name is cf_quotes_dept)<br>
<br>
Thanks to <a href="https://danssy.wordpress.com/2017/01/26/vtiger-6-5-add-column-to-item-details-in-invoice-salesorder-quotes/" target="_blank">https://danssy.wordpress.com/2017/01/26/vtiger-6-5-add-column-to-item-details-in-invoice-salesorder-quotes/</a> blog.<br>
<br>
5 files have to be updated in VTIGER 6.5.<br>
<br>
I will work soon on the VTIGER 7 code to set up the same field. I'll let you know. To follow .... <br>
<br>
Cathy<br>
<br>
<br>
A. Add a column “cf_quotes_dept” to the vtiger_inventoryproductrel table. With a VARCHAR type.<br>
<br>
B. Edit the layouts/vlayout/modules/Inventory/LineItemsContent.tpl<br>
<br>
a) Add: <br>
b) Add: {assign var="dept" value="dept"|cat:$row_no}<br>
<br>
C. Edit layouts/vlayout/modules/Inventory/LineItemsEdit.tpl<br>
a) Add: <b>{vtranslate('LBL_DEPTLINE',$MODULE)}</b><br>
<br>
<br>
D. Edit layouts/vlayout/modules/Inventory/LineItemsDetail.tpl:<br>
a) Add: <b>Dept</b> <br>
b) Add: {$LINE_ITEM_DETAIL["dept$INDEX"]} <br>
<br>
c) <br>
E. Edit include/utils/EditViewUtils.php<br>
<br>
a) Add: $product_Detail[$i]['dept'.$i]=$dept<br>
b) Add: $dept=$adb->query_result($result,$i-1,'cf_quotes_dept');<br>
<br>
c) <br>
F. Edit include/utils/InventoryUtils.php<br>
a) Add: $dept = vtlib_purify($_REQUEST['dept'.$i]);<br>
b) Modifiy:<br>
$query ="insert into vtiger_inventoryproductrel(id, productid, sequence_no, quantity, listprice, comment, description,cf_quotes_dept) values(?,?,?,?,?,?,?,?)";<br>
$qparams = array($focus->id,$prod_id,$prod_seq,$qty,$listprice,$comment,$description,$dept);</span><span style="font-size:10.5pt;color:#222222"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#222222"><br>
</span>El lunes, 3 de mayo de 2021, Sukhdev Mohan <<a href="mailto:s.mohan@myti.it" target="_blank">s.mohan@myti.it</a>> escribió:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">How do you add new fields to line Item?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Best Regards,<br>
<b>Sukhdev Mohan</b> | <b>Software Developer</b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal">_______________________________________________<br>
<a href="http://www.vtiger.com/">http://www.vtiger.com/</a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
<a href="http://www.vtiger.com/">http://www.vtiger.com/</a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>