How can I get the TAX value of a product in Purchase Order Module
Dear All,
I am trying to clone a record in the Purchase Order Module using deluge.
I can get (and map) all the fields (+ product fields) without problem except one.
I am facing issue of how can I get the TAX of the each product.
The below code works fine (it is only how I get the product part) except of the TAX
- respMap = zoho.crm.getRecordById("Purchase_Orders",orderId.toLong());
- productDet=ifnull(respMap.get("Product_Details"),"");
- pdlist=List();
- for each eachProd in productDet
- {
- productvalue = eachProd.get("product");
- proid = productvalue.get("id");
- proname = productvalue.get("name");
- mp=Map();
- mp.put("product",{"name":proname,"id":proid});
- mp.put("quantity",ifnull(eachProd.get("quantity"),"0").toLong());
- mp.put("list_price",ifnull(eachProd.get("list_price"),"0.0").toDecimal());
- mp.put(("Discount"),ifnull(eachProd.get("Discount"),"0.0").toDecimal());
- mp.put("total",ifnull(eachProd.get("total"),"0.0").toDecimal());
- mp.put("net_total",ifnull(eachProd.get("net_total"),"0.0").toDecimal());
- mp.put("Tax",ifnull(eachProd.get("Tax"),"0.0").toDecimal());
- mp.put("product_description",ifnull(eachProd.get("product_description"),""));
- pdlist.add(mp);
- }
The above line with the 'Tax' does not do anything. I have also tried to add the 'line_tax'.
To all my products I have selected the '0%' Tax.
But when I clone the record it always gets all the Taxes.
So for example if in the main record I have a total of 100€ with ONLY 0% TAX selected when I clone it
the price is 144€ which is wrong. By fault it gets all the below 3 TAXes