Skip to content
Snippets Groups Projects
Commit 198bab43 authored by Satish's avatar Satish
Browse files

Fixes #683 - Vtiger 7 Webservice calculate totals

parent e21521e5
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,7 @@ class VtigerInventoryOperation extends VtigerModuleOperation {
$element['LineItems'] = $lineItems;
$recordCompoundTaxesElement = $this->getCompoundTaxesElement($element, $lineItems);
$element = array_merge($element, $recordCompoundTaxesElement);
$element['productid'] = $lineItems[0]['productid'];
$element['LineItems_FinalDetails'] = $this->getLineItemFinalDetails($idComponents[1]);
return $element;
}
......
......@@ -78,16 +78,15 @@ class VtigerLineItemOperation extends VtigerActorOperation {
*/
public function getAllLineItemForParent($parentId){
$result = null;
if(is_array($parentId)){
$query = "select vtiger_crmentity.label as productname,vtiger_crmentity.setype as entitytype,vtiger_crmentity.deleted as deleted, {$this->entityTableName}.*
if (!is_array($parentId)) {
$parentId = array($parentId);
}
$query = "SELECT vtiger_crmentity.label AS productname,vtiger_crmentity.setype AS entitytype,vtiger_crmentity.deleted AS deleted, {$this->entityTableName}.*
FROM {$this->entityTableName}
LEFT JOIN vtiger_crmentity ON vtiger_crmentity.crmid=vtiger_inventoryproductrel.productid
WHERE id IN (". generateQuestionMarks($parentId) .")";
}else {
$query = "select vtiger_crmentity.label as productname,vtiger_crmentity.setype as entitytype,vtiger_crmentity.deleted as deleted, {$this->entityTableName}.*
FROM {$this->entityTableName}
LEFT JOIN vtiger_crmentity ON vtiger_crmentity.crmid=vtiger_inventoryproductrel.productid where id=?";
}
$transactionSuccessful = vtws_runQueryAsTransaction($query,array($parentId),$result);
if(!$transactionSuccessful){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment