From fde2af40362cb49c8e173b9691c8a853db76e731 Mon Sep 17 00:00:00 2001 From: hardya Date: Thu, 3 Apr 2008 09:56:56 +0000 Subject: [PATCH] Addresses #451 git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@4712 248e525c-4dfb-0310-94bc-949c084e9493 --- Modules/mip_quotation.pck | 88 +++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/Modules/mip_quotation.pck b/Modules/mip_quotation.pck index c34f168..bb3297e 100644 --- a/Modules/mip_quotation.pck +++ b/Modules/mip_quotation.pck @@ -1560,7 +1560,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.'); AND p_enqu.required_svcp_code IN ('LP', 'MP') THEN p_manual_or_automatic_quote := gc_manual_quote; add_quote_reason(p_enqu.id - ,'Site Survey is required for alteration (relocation or reposition) of an existing meter.' + ,'Site Survey is required for alteration (relocation or reposition) of an existing ' || + p_enqu.required_svcp_code || ' meter.' ,gc_external_reason); END IF; -- ALTERATION @@ -1581,7 +1582,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.'); p_manual_or_automatic_quote := gc_manual_quote; add_quote_reason(p_enqu.id ,'Site Survey is required for exchange of an existing ' || - l_svcpt_code || ' meter.' + l_svcpt_code || ' ' || + l_rec_metr_details.mety_code || ' meter.' ,gc_external_reason); ELSE -- Exchange, MP @@ -2527,25 +2529,30 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.'); END IF; END IF; - /* Always get costs for LIFTING GEAR */ - l_additional_costs := get_aico(p_adit_code => 'LIFTING GEAR' - ,p_regi_code => l_regi_code); - l_rec_module.lifting_gear_selling_price := l_additional_costs.selling_price; - l_rec_module.lifting_gear_cost_price := l_additional_costs.cost_price; - l_rec_module.lifting_gear_delivery_cost := l_additional_costs.delivery_cost; - l_rec_module.lifting_gear_lead_time := l_additional_costs.lead_time; - IF l_rec_module.lifting_gear_selling_price IS NULL THEN - l_this_is_automatic_quote := FALSE; - add_quote_reason(p_enqu.id - ,p_reason => 'Unable to find selling price for LIFTING GEAR.' - ,p_internal_or_external => gc_internal_reason); - END IF; - IF l_rec_module.lifting_gear_lead_time IS NULL THEN - l_this_is_automatic_quote := FALSE; - add_quote_reason(p_enqu.id - ,p_reason => 'Unable to find lead time for LIFTING GEAR.' - ,p_internal_or_external => gc_internal_reason); + /* Lifting gear required UNLESS Install/Standard Install of an LP Diaphragm */ + IF NOT (p_enqu.enty_code IN ('INSTALL', 'STD INSTALL') AND + l_rec_module.mety_code = 'DIAPHRAGM' AND + l_rec_module.laco_svcpt_code = 'LP') THEN + + l_additional_costs := get_aico(p_adit_code => 'LIFTING GEAR' + ,p_regi_code => l_regi_code); + l_rec_module.lifting_gear_selling_price := l_additional_costs.selling_price; + l_rec_module.lifting_gear_cost_price := l_additional_costs.cost_price; + l_rec_module.lifting_gear_delivery_cost := l_additional_costs.delivery_cost; + l_rec_module.lifting_gear_lead_time := l_additional_costs.lead_time; + IF l_rec_module.lifting_gear_selling_price IS NULL THEN + l_this_is_automatic_quote := FALSE; + add_quote_reason(p_enqu.id + ,p_reason => 'Unable to find selling price for LIFTING GEAR.' + ,p_internal_or_external => gc_internal_reason); + END IF; + IF l_rec_module.lifting_gear_lead_time IS NULL THEN + l_this_is_automatic_quote := FALSE; + add_quote_reason(p_enqu.id + ,p_reason => 'Unable to find lead time for LIFTING GEAR.' + ,p_internal_or_external => gc_internal_reason); + END IF; END IF; IF l_this_is_automatic_quote THEN @@ -2711,26 +2718,27 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.'); ,'AQI'); END IF; - /* Always include LIFTING GEAR */ - - INSERT INTO quote_items - (id - ,qute_id - ,adit_code - ,cost_price - ,selling_price - ,delivery_price - ,lead_time - ,quit_type) - VALUES - (quit_seq.NEXTVAL - ,l_qute_id - ,'LIFTING GEAR' - ,l_rec_module.lifting_gear_cost_price - ,l_rec_module.lifting_gear_selling_price - ,l_rec_module.lifting_gear_delivery_cost - ,l_rec_module.lifting_gear_lead_time - ,'AQI'); + IF l_rec_module.lifting_gear_selling_price IS NOT NULL THEN + + INSERT INTO quote_items + (id + ,qute_id + ,adit_code + ,cost_price + ,selling_price + ,delivery_price + ,lead_time + ,quit_type) + VALUES + (quit_seq.NEXTVAL + ,l_qute_id + ,'LIFTING GEAR' + ,l_rec_module.lifting_gear_cost_price + ,l_rec_module.lifting_gear_selling_price + ,l_rec_module.lifting_gear_delivery_cost + ,l_rec_module.lifting_gear_lead_time + ,'AQI'); + END IF; -- Generate the quote PDF /*BEGIN*/