[Home] [Help]
PACKAGE BODY: APPS.ASO_QUOTE_MISC_PVT
Source
1 PACKAGE BODY ASO_Quote_Misc_PVT AS
2 /* $Header: asovqmib.pls 120.2 2005/07/20 03:16:20 appldev ship $ */
3
4
5 PROCEDURE Debug_Tax_Info_Notification (
6 p_qte_header_rec IN ASO_QUOTE_PUB.QTE_HEADER_REC_TYPE
7 ,p_Hd_Shipment_Rec IN ASO_QUOTE_PUB.SHIPMENT_REC_TYPE
8 ,p_reason IN VARCHAR2
9 ) IS
10 l_output VARCHAR2(32767);
11 l_org_id NUMBER;
12 l_client_info VARCHAR2(256);
13 l_return_status VARCHAR2(30);
14 l_msg_count NUMBER;
15 l_msg_data VARCHAR2(32767);
16 l_email VARCHAR2(256) := FND_PROFILE.value('ASO_DIAG_EMAIL_ADDRESS');
17 l_enable_email VARCHAR2(1) := FND_PROFILE.value('ASO_ENABLE_DEBUG_EMAIL');
18
19 PROCEDURE Writeln(pText IN VARCHAR2) IS
20 BEGIN
21 l_output := l_output || pText || FND_GLOBAL.NewLine();
22 END Writeln;
23
24 BEGIN
25 IF ASO_DEBUG_PUB.G_Debug_Flag = 'Y' THEN
26 aso_debug_pub.add('ASO_Quote_Misc_PVT: Profile(ASO_DIAG_EMAIL_ADDRESS): l_email: '||l_email, 1, 'N');
27 aso_debug_pub.add('ASO_Quote_Misc_PVT: Profile(ASO_ENABLE_DEBUG_EMAIL): l_enable_email: '||l_enable_email, 1, 'N');
28 END IF;
29
30 IF (NVL(FND_PROFILE.Value('ASO_ENABLE_DEBUG_EMAIL'), 'N') = 'Y') THEN
31 IF l_email IS NOT NULL THEN
32 Writeln('[ Begin Debug Tax Info ]');
33
34 /* Commented out for performance issue and replaced with new code
35 BEGIN
36
37 SELECT NVL(TO_NUMBER(DECODE(SUBSTRB(USERENV('CLIENT_INFO'),1,1), ' ', NULL,
38 SUBSTRB(USERENV('CLIENT_INFO'),1,10))),-99),
39 USERENV('CLIENT_INFO')
40 INTO l_org_id, l_client_info
41 FROM dual;
42 EXCEPTION
43 WHEN OTHERS THEN NULL;
44 END;
45 */
46
47 --Commented Code start Yogeshwar (MOAC)
48 /*
49 IF SUBSTRB(USERENV('CLIENT_INFO'),1 ,1) = ' ' THEN
50 l_org_id := NULL;
51 ELSE
52 l_org_id := TO_NUMBER(SUBSTRB(USERENV('CLIENT_INFO'), 1,10));
53 END IF;
54
55 l_client_info := USERENV('CLIENT_INFO');
56 */
57 --End of Commented code (MOAC)
58 L_org_id := p_qte_header_rec.org_id ; --New Code Yogeshwar (MOAC)
59
60 /* --Commented Code Start Yogeshwar (MOAC)
61 Writeln('');
62 Writeln(' General Info');
63 Writeln(' ============');
64 WriteLn(' ORG_ID=' || l_org_id);
65 WriteLn(' RESP_ID=' || FND_GLOBAL.resp_id());
66 WriteLn(' RESP_APPL_ID=' || FND_GLOBAL.resp_appl_id());
67 Writeln(' USER_ID=' || FND_GLOBAL.resp_appl_id());
68 Writeln(' USERENV("CLIENT_INFO") 01-32=[' || SUBSTR(l_client_info, 1, 32) || ']');
69 Writeln(' USERENV("CLIENT_INFO") 33-64=[' || SUBSTR(l_client_info, 33) || ']');
70 Writeln('');
71 Writeln(' Quote Info');
72 Writeln(' ==========');
73 Writeln(' QUOTE_HEADER_ID=' || p_qte_header_rec.quote_header_id);
74 Writeln(' ORG_ID=' || TO_CHAR(p_qte_header_rec.org_id,'9999'));
75 Writeln(' INVOICE_TO_PARTY_ID=' || TO_CHAR(p_qte_header_rec.invoice_to_party_id, '999999999'));
76 Writeln(' INVOICE_TO_PARTY_SITE_ID=' || TO_CHAR(p_qte_header_rec.invoice_to_party_site_id, '999999999'));
77 Writeln(' SHIP_TO_PARTY_ID=' || TO_CHAR(p_hd_shipment_rec.ship_to_party_id, '999999999'));
78 Writeln(' SHIP_TO_PARTY_SITE_ID=' || TO_CHAR(p_hd_shipment_rec.ship_to_party_site_id, '999999999'));
79 Writeln('');
80 Writeln(' AR_SYSTEM_PARAMETERS (ARP_STANDARD.sysparm)');
81 Writeln(' ===========================================');
82 Writeln(' org_id=' || ARP_STANDARD.sysparm.org_id);
83 Writeln(' set_of_books_id=' || ARP_STANDARD.sysparm.set_of_books_id);
84 Writeln(' default_grouping_rule_id=' || ARP_STANDARD.sysparm.default_grouping_rule_id);
85 Writeln(' salesrep_required_flag=' || ARP_STANDARD.sysparm.salesrep_required_flag);
86 Writeln(' location_tax_account=' || ARP_STANDARD.sysparm.location_tax_account);
87 Writeln(' tax_registration_number=' || ARP_STANDARD.sysparm.tax_registration_number);
88 Writeln(' create_reciprocal_flag=' || ARP_STANDARD.sysparm.create_reciprocal_flag);
89 Writeln(' default_country=' || ARP_STANDARD.sysparm.default_country);
90 Writeln(' default_territory=' || ARP_STANDARD.sysparm.default_territory);
91 Writeln(' generate_customer_number=' || ARP_STANDARD.sysparm.generate_customer_number);
92 Writeln(' invoice_deletion_flag=' || ARP_STANDARD.sysparm.invoice_deletion_flag);
93 Writeln(' location_structure_id=' || ARP_STANDARD.sysparm.location_structure_id);
94 Writeln(' site_required_flag=' || ARP_STANDARD.sysparm.site_required_flag);
95 Writeln(' tax_allow_compound_flag=' || ARP_STANDARD.sysparm.tax_allow_compound_flag);
96 Writeln(' tax_invoice_print=' || ARP_STANDARD.sysparm.tax_invoice_print);
97 Writeln(' tax_method=' || ARP_STANDARD.sysparm.tax_method);
98 Writeln(' accounting_method=' || ARP_STANDARD.sysparm.accounting_method);
99 Writeln(' accrue_interest=' || ARP_STANDARD.sysparm.accrue_interest);
100 Writeln(' auto_site_numbering=' || ARP_STANDARD.sysparm.auto_site_numbering);
101 Writeln(' cash_basis_set_of_books_id=' || ARP_STANDARD.sysparm.cash_basis_set_of_books_id);
102 Writeln(' address_validation=' || ARP_STANDARD.sysparm.address_validation);
103 Writeln(' tax_code=' || ARP_STANDARD.sysparm.tax_code);
104 Writeln(' tax_currency_code=' || ARP_STANDARD.sysparm.tax_currency_code);
105 Writeln(' tax_header_level_flag=' || ARP_STANDARD.sysparm.tax_header_level_flag);
106 Writeln(' rule_set_id=' || ARP_STANDARD.sysparm.rule_set_id);
107 Writeln(' inclusive_tax_used=' || ARP_STANDARD.sysparm.inclusive_tax_used);
108 Writeln(' sales_tax_geocode=' || ARP_STANDARD.sysparm.sales_tax_geocode);
109 Writeln('');
110 Writeln(' TAX_INFO_REC (ARP_TAX)');
111 Writeln(' ======================');
112 Writeln(' bill_to_cust_id=' || ARP_TAX.tax_info_rec.bill_to_cust_id);
113 Writeln(' ship_to_cust_id=' || ARP_TAX.tax_info_rec.ship_to_cust_id);
114 Writeln(' bill_to_customer_name=' || ARP_TAX.tax_info_rec.bill_to_customer_name);
115 Writeln(' ship_to_customer_name=' || ARP_TAX.tax_info_rec.ship_to_customer_name);
116 Writeln(' bill_to_site_use_id=' || ARP_TAX.tax_info_rec.bill_to_site_use_id);
117 Writeln(' ship_to_site_use_id=' || ARP_TAX.tax_info_rec.ship_to_site_use_id);
118 Writeln(' bill_to_location_id=' || ARP_TAX.tax_info_rec.bill_to_location_id);
119 Writeln(' ship_to_location_id=' || ARP_TAX.tax_info_rec.ship_to_location_id);
120 Writeln(' tax_code=' || ARP_TAX.tax_info_rec.tax_code);
121 Writeln(' vat_tax_id=' || ARP_TAX.tax_info_rec.vat_tax_id);
122 Writeln(' tax_exemption_id=' || ARP_TAX.tax_info_rec.tax_exemption_id);
123 Writeln(' tax_rate=' || ARP_TAX.tax_info_rec.tax_rate);
124 Writeln(' calculate_tax=' || ARP_TAX.tax_info_rec.calculate_tax);
125 Writeln(' customer_trx_line_id=' || ARP_TAX.tax_info_rec.customer_trx_line_id);
126 Writeln(' customer_trx_id=' || ARP_TAX.tax_info_rec.customer_trx_id);
127 Writeln(' trx_date=' || ARP_TAX.tax_info_rec.trx_date);
128 Writeln(' ship_to_postal_code=' || ARP_TAX.tax_info_rec.ship_to_postal_code);
129 Writeln(' bill_to_postal_code=' || ARP_TAX.tax_info_rec.bill_to_postal_code);
130 Writeln(' inventory_item_id=' || ARP_TAX.tax_info_rec.inventory_item_id);
131 Writeln(' Exemp Flag or tax_control=' || ARP_TAX.tax_info_rec.tax_control);
132 Writeln(' xmpt_cert_no =' || ARP_TAX.tax_info_rec.xmpt_cert_no);
133 Writeln(' xmpt_reason =' || ARP_TAX.tax_info_rec.xmpt_reason);
134 Writeln(' invoicing_rule_id =' || ARP_TAX.tax_info_rec.invoicing_rule_id);
135 Writeln(' extended_amount =' || ARP_TAX.tax_info_rec.extended_amount);
136 Writeln(' trx_exchange_rate =' || ARP_TAX.tax_info_rec.trx_exchange_rate);
137 Writeln(' trx_currency_code =' || ARP_TAX.tax_info_rec.trx_currency_code);
138 Writeln(' minimum_accountable_unit =' || ARP_TAX.tax_info_rec.minimum_accountable_unit);
139 Writeln(' precision =' || ARP_TAX.tax_info_rec.precision);
140 Writeln(' fob_point =' || ARP_TAX.tax_info_rec.fob_point);
141 Writeln(' taxed_quantity =' || ARP_TAX.tax_info_rec.taxed_quantity);
142 Writeln(' qualifier =' || ARP_TAX.tax_info_rec.qualifier);
143 Writeln(' calculate_tax =' || ARP_TAX.tax_info_rec.calculate_tax);
144 Writeln(' ship_to_customer_number =' || ARP_TAX.tax_info_rec.ship_to_customer_number);
145 Writeln(' bill_to_customer_number =' || ARP_TAX.tax_info_rec.bill_to_customer_number);
146 Writeln(' audit_flag =' || ARP_TAX.tax_info_rec.audit_flag);
147 Writeln(' tax_header_level_flag =' || ARP_TAX.tax_info_rec.tax_header_level_flag);
148 Writeln(' tax_rounding_rule =' || ARP_TAX.tax_info_rec.tax_rounding_rule);
149 Writeln(' trx_type_id =' || ARP_TAX.tax_info_rec.trx_type_id );
150 Writeln(' ship_from_warehouse_id =' || ARP_TAX.tax_info_rec.ship_from_warehouse_id );
151 Writeln(' poo_id =' || ARP_TAX.tax_info_rec.poo_id );
152 Writeln(' poa_id =' || ARP_TAX.tax_info_rec.poa_id );
153 Writeln(' payment_term_id =' || ARP_TAX.tax_info_rec.payment_term_id );
154 Writeln('');
155 WriteLn('[ End Debug Tax Info ]');
156
157 Writeln(' REASON FOR NOT CALCULATING TAX' );
158 Writeln(' ======================');
159 Writeln(' Reason=' || p_reason);
160 */ --Commented Code End Yogeshwar (MOAC)
161
162 ASO_WFNOTIFICATION_PVT.Send_Email(
163 p_api_version => 1
164 ,p_commit => FND_API.G_FALSE
165 ,p_init_msg_list => FND_API.G_FALSE
166 ,p_email_list => l_email
167 ,p_subject => 'ASO [Debug_Tax_Info Email Notification] @ ' ||
168 TO_CHAR(SYSDATE,'YYY/MM/DD HH:MI:SS')
169 ,p_body => l_output
170 ,x_return_status => l_return_status
171 ,x_msg_count => l_msg_count
172 ,x_msg_data => l_msg_data
173 );
174 END IF; -- IF l_email IS NOT NULL
175 END IF; -- IF l_enable_email IS YES
176
177 END Debug_Tax_Info_Notification;
178
179 END ASO_Quote_Misc_PVT;