183: Select nvl(sum(amount),0) labour_cost
184: From ap_invoice_distributions
185: where line_type_lookup_code = 'ITEM'
186: -- and awt_group_id is not null
187: and IGI_CIS2007_UTIL_PKG.get_payables_option_based_awt(NULL,NULL,awt_group_id,pay_awt_group_id) is not null /* Bug 7218825 */
188: and invoice_id = p_inv_id;
189: -- Fetch the total material cost for an invoice.
190: Cursor C_material_cost is
191: Select nvl(sum(amount),0) material_cost
191: Select nvl(sum(amount),0) material_cost
192: From ap_invoice_distributions
193: where line_type_lookup_code = 'ITEM'
194: -- and awt_group_id is null
195: and IGI_CIS2007_UTIL_PKG.get_payables_option_based_awt(NULL,NULL,awt_group_id,pay_awt_group_id) is null /* Bug 7218825 */
196: and invoice_id = p_inv_id;
197: -- Start 5609552
198: -- Fetch the total vat cost for an invoice.
199: Cursor C_vat_cost is
200: Select nvl(sum(amount),0) vat_cost
201: From ap_invoice_distributions
202: where line_type_lookup_code = 'TAX'
203: -- and awt_group_id is null
204: and IGI_CIS2007_UTIL_PKG.get_payables_option_based_awt(NULL,NULL,awt_group_id,pay_awt_group_id) is null /* Bug 7218825 */
205: and invoice_id = p_inv_id;
206: -- End 5609552
207:
208: -- Find out the number of Witholding lines for the invoice payment