Skip to content

vtiger 8.0.0 Can't use Purchase Order module

On my newly updated v8 vtiger instance, I am unable to duplicate a Purchase Order that has one Service as a lineitem. I get a divide by zero fatal error: Fatal error: Uncaught DivisionByZeroError: Division by zero in /var/www/vtiger/test/templates_c/v7/2cf70f793eb143722e181c7b96e87cef1d9eb711_0.file.LineItemsContent.tpl.php:64

This is this bit of code: if ($_smarty_tpl->tpl_vars['data']->value[$_smarty_tpl->tpl_vars['purchaseCost']->value] && $_smarty_tpl->tpl_vars['RECORD_CURRENCY_RATE']->value) { echo (string)(((float)$_smarty_tpl->tpl_vars['data']->value[$_smarty_tpl->tpl_vars['purchaseCost']->value])/((float)$_smarty_tpl->tpl_vars['data']->value[$_smarty_tpl->tpl_vars['qty']->value]*(float)$_prefixVariable1)); } else { echo "0"; }

Which comes from here I believe: https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/layouts/v7/modules/Inventory/partials/LineItemsContent.tpl#L47

So I went to the vtiger demo system to see if I could re-create it there but I can't even create a Purchase Order - I can't select and add a service to it :-(

Screenshot_from_2023-10-23_13-27-12 Screenshot_from_2023-10-23_13-22-29Screenshot_from_2023-10-23_13-20-55