{"id":927,"date":"2014-07-08T18:23:02","date_gmt":"2014-07-08T10:23:02","guid":{"rendered":"http:\/\/j178.mtgbb.com\/?p=927"},"modified":"2014-07-08T18:23:02","modified_gmt":"2014-07-08T10:23:02","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8om%e4%b8%addefault-rule%e6%a0%b9%e6%93%9asubinventory%e8%a8%ad%e5%ae%9atax-code","status":"publish","type":"post","link":"https:\/\/j178.mtgbb.com\/?p=927","title":{"rendered":"\u5982\u4f55\u4f7f\u7528OM\u4e2ddefault rule\u6839\u64dasubinventory\u8a2d\u5b9atax code"},"content":{"rendered":"<p>\u6587\u7ae0\u8f49\u8cbc\u81ea: <a href=\"http:\/\/www.itpub.net\/thread-911724-1-1.html\" target=\"_blank\">\u9019\u88e1<\/a><\/p>\n<p>SO line\u4e2dTax code\u6839\u64dasubinventory\u9032\u884c\u8a2d\u7f6e\u7684\u65b9\u6cd5\uff1a<br \/>\n1. \u9032responsibility: Order Management<\/p>\n<p>2. \u9032Setup>Rules>Defaulting<\/p>\n<p>Application:Order Management<br \/>\nEntity:Order Line<br \/>\nAttribute:Tax Code<br \/>\n\u7136\u5f8c\u9edeDefault Rules&#8230;\u6309\u9215<\/p>\n<p><!--more--><\/p>\n<p>3.\u589e\u52a0\u4e00\u500bdefaulting condition\uff1aalways<br \/>\n\u5728\u4e0b\u65b9default sourcing rules\u4e2d\u589e\u52a0\u4e00\u500bsource type\uff1aPL\/SQL API,Default Source\/value\u4e2d\u8f38\u5165\u5ba2\u5236\u7684Package\u540d\u7a31\u548cfunction\u540d\u7a31<\/p>\n<p>package\u8209\u4f8b\uff1a<\/p>\n<pre lang=\"oracle8\">\r\nCREATE OR REPLACE PACKAGE BODY DEF_TAX_PKG\r\nAS\r\n   FUNCTION DEF_TAX_FCN (\r\n      p_database_object_name   IN   VARCHAR2,\r\n      p_attribute_code         IN   VARCHAR2\r\n   )\r\n      RETURN VARCHAR2\r\n   AS\r\n      l_org_id                 NUMBER;\r\n      l_subinventory           VARCHAR2 (100);\r\n      l_tax_code               VARCHAR2 (100);\r\n      l_debug_level   CONSTANT NUMBER         := oe_debug_pub.g_debug_level;\r\n   BEGIN\r\n      IF     ont_line_def_hdlr.g_record.org_id IS NOT NULL\r\n         AND ont_line_def_hdlr.g_record.subinventory IS NOT NULL\r\n      THEN\r\n         l_org_id := ont_line_def_hdlr.g_record.org_id;\r\n         l_subinventory := ont_line_def_hdlr.g_record.subinventory;\r\n\r\n         IF     l_org_id = 288\r\n            AND (   l_subinventory = 'RTSGMINFG'\r\n                 OR (    l_subinventory LIKE 'JDSG%'\r\n                     AND (    l_subinventory NOT LIKE 'JDSG%SIN'\r\n                          AND l_subinventory NOT LIKE 'JDSGCPBSTG'\r\n                         )\r\n                    )\r\n                )\r\n         THEN\r\n            l_tax_code := '0';\r\n         ELSE\r\n            l_tax_code := NULL;\r\n         END IF;\r\n      END IF;\r\n\r\n      RETURN l_tax_code;\r\n   EXCEPTION\r\n      WHEN OTHERS\r\n      THEN\r\n         IF l_debug_level > 0\r\n         THEN\r\n            oe_debug_pub.ADD ('Error in DEF_TAX_FNC');\r\n            oe_debug_pub.ADD ('Error :' || SUBSTR (SQLERRM, 1, 200));\r\n         END IF;\r\n\r\n         RETURN NULL;\r\n   END DEF_TAX_FCN;\r\nEND;\r\n<\/pre>\n<p>4.\u9ede\u83dc\u55aetools\/create defaulting handler package<\/p>\n<p>5.\u5efa\u7acbdependency<br \/>\n\u66f4\u6539$ONT_TOP\/patch\/115\/sql\/OEXEDEPB.pls<br \/>\n\u589e\u52a0\u5167\u5bb9\uff1a<\/p>\n<pre lang=\"oracle8\">\r\n    IF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN\r\n           x_extn_dep_tbl(l_index).source_attribute := OE_LINE_UTIL.G_SUBINVENTORY;\r\n           x_extn_dep_tbl(l_index).dependent_attribute := OE_LINE_UTIL.G_TAX;\r\n           x_extn_dep_tbl(l_index).enabled_flag := 'Y';\r\n           l_index := l_index+1;\r\n    END IF;\r\n<\/pre>\n<p>\u7136\u5f8c\u57f7\u884cpackage<\/p>\n<p>6.\u8a2d\u7f6e\u5b8c\u6210\uff0c\u9032sales order\u67e5\u770b\u7d50\u679c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u8f49\u8cbc\u81ea: \u9019\u88e1 SO line\u4e2dTax code\u6839\u64dasubinventory\u9032\u884c\u8a2d\u7f6e\u7684\u65b9\u6cd5\uff1a 1. \u9032re &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-927","post","type-post","status-publish","format-standard","hentry","category-oracle-erp"],"_links":{"self":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=927"}],"version-history":[{"count":0,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/927\/revisions"}],"wp:attachment":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}