Commit bfde5e7f authored by pgole's avatar pgole

Updated metadata


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104227 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bcd927ae
......@@ -272,12 +272,12 @@
<dbname>discount</dbname>
</table_column>
<table_column>
<type size="47">char</type>
<type>number</type>
<updatewhereclause>yes</updatewhereclause>
<name>net_amt</name>
<dbname>net_amt</dbname>
<name>net_sales</name>
<dbname>net_sales</dbname>
</table_column>
<retrieve>PBSELECT( VERSION(400) TABLE(NAME=&quot;cust_stock&quot; ) TABLE(NAME=&quot;cust_stock_det&quot; ) TABLE(NAME=&quot;item&quot; ) COLUMN(NAME=&quot;cust_stock_det.tran_id&quot;) COLUMN(NAME=&quot;cust_stock_det.line_no&quot;) COLUMN(NAME=&quot;cust_stock_det.item_code&quot;) COLUMN(NAME=&quot;item.descr&quot;) COLUMN(NAME=&quot;cust_stock_det.unit&quot;) COLUMN(NAME=&quot;cust_stock_det.op_stock&quot;) COLUMN(NAME=&quot;cust_stock_det.sales&quot;) COLUMN(NAME=&quot;cust_stock_det.purc_rcp&quot;) COLUMN(NAME=&quot;cust_stock_det.transit_qty&quot;) COLUMN(NAME=&quot;cust_stock_det.adj_qty&quot;) COLUMN(NAME=&quot;cust_stock_det.cl_stock&quot;) COLUMN(NAME=&quot;cust_stock_det.purc_ret&quot;) COLUMN(NAME=&quot;cust_stock_det.chg_user&quot;) COLUMN(NAME=&quot;cust_stock_det.chg_term&quot;) COLUMN(NAME=&quot;cust_stock_det.chg_date&quot;) COLUMN(NAME=&quot;cust_stock_det.sale_order&quot;) COLUMN(NAME=&quot;cust_stock_det.item_ser&quot;) COLUMN(NAME=&quot;cust_stock_det.loc_type&quot;) COLUMN(NAME=&quot;cust_stock_det.op_value&quot;) COLUMN(NAME=&quot;cust_stock_det.pur_value&quot;) COLUMN(NAME=&quot;cust_stock_det.sales_value&quot;) COLUMN(NAME=&quot;cust_stock_det.cl_value&quot;) COLUMN(NAME=&quot;cust_stock_det.match_opstk&quot;) COLUMN(NAME=&quot;cust_stock_det.match_clstk&quot;) COLUMN(NAME=&quot;cust_stock_det.remarks&quot;) COLUMN(NAME=&quot;cust_stock_det.rate&quot;) COLUMN(NAME=&quot;cust_stock_det.demand_qty&quot;) COLUMN(NAME=&quot;cust_stock_det.adhoc_repl_qty&quot;) COLUMN(NAME=&quot;cust_stock_det.cust_item__ref&quot;) COLUMN(NAME=&quot;cust_stock_det.cust_purc_rcp&quot;) COMPUTE(NAME=&quot;FN_CUSTITEM_DSCR(cust_stock.cust_code,cust_stock_det.item_code,cust_stock_det.cust_item__ref) cust_item_ref_descr&quot;) COMPUTE(NAME=&quot;&apos; &apos; as discount&quot;) COMPUTE(NAME=&quot;&apos; &apos; as net_amt&quot;) JOIN (LEFT=&quot;cust_stock.tran_id&quot; OP =&quot;=&quot;RIGHT=&quot;cust_stock_det.tran_id&quot; ) JOIN (LEFT=&quot;item.item_code&quot; OP =&quot;=&quot;RIGHT=&quot;cust_stock_det.item_code&quot; )WHERE( EXP1 =&quot;~&quot;CUST_STOCK~&quot;.~&quot;TRAN_ID~&quot;&quot; OP =&quot;=&quot; EXP2 =&quot;:mtran_id&quot; ) ) ARG(NAME = &quot;mtran_id&quot; TYPE = string) </retrieve>
<retrieve>PBSELECT( VERSION(400) TABLE(NAME=&quot;cust_stock&quot; ) TABLE(NAME=&quot;cust_stock_det&quot; ) TABLE(NAME=&quot;item&quot; ) COLUMN(NAME=&quot;cust_stock_det.tran_id&quot;) COLUMN(NAME=&quot;cust_stock_det.line_no&quot;) COLUMN(NAME=&quot;cust_stock_det.item_code&quot;) COLUMN(NAME=&quot;item.descr&quot;) COLUMN(NAME=&quot;cust_stock_det.unit&quot;) COLUMN(NAME=&quot;cust_stock_det.op_stock&quot;) COLUMN(NAME=&quot;cust_stock_det.sales&quot;) COLUMN(NAME=&quot;cust_stock_det.purc_rcp&quot;) COLUMN(NAME=&quot;cust_stock_det.transit_qty&quot;) COLUMN(NAME=&quot;cust_stock_det.adj_qty&quot;) COLUMN(NAME=&quot;cust_stock_det.cl_stock&quot;) COLUMN(NAME=&quot;cust_stock_det.purc_ret&quot;) COLUMN(NAME=&quot;cust_stock_det.chg_user&quot;) COLUMN(NAME=&quot;cust_stock_det.chg_term&quot;) COLUMN(NAME=&quot;cust_stock_det.chg_date&quot;) COLUMN(NAME=&quot;cust_stock_det.sale_order&quot;) COLUMN(NAME=&quot;cust_stock_det.item_ser&quot;) COLUMN(NAME=&quot;cust_stock_det.loc_type&quot;) COLUMN(NAME=&quot;cust_stock_det.op_value&quot;) COLUMN(NAME=&quot;cust_stock_det.pur_value&quot;) COLUMN(NAME=&quot;cust_stock_det.sales_value&quot;) COLUMN(NAME=&quot;cust_stock_det.cl_value&quot;) COLUMN(NAME=&quot;cust_stock_det.match_opstk&quot;) COLUMN(NAME=&quot;cust_stock_det.match_clstk&quot;) COLUMN(NAME=&quot;cust_stock_det.remarks&quot;) COLUMN(NAME=&quot;cust_stock_det.rate&quot;) COLUMN(NAME=&quot;cust_stock_det.demand_qty&quot;) COLUMN(NAME=&quot;cust_stock_det.adhoc_repl_qty&quot;) COLUMN(NAME=&quot;cust_stock_det.cust_item__ref&quot;) COLUMN(NAME=&quot;cust_stock_det.cust_purc_rcp&quot;) COMPUTE(NAME=&quot;FN_CUSTITEM_DSCR(cust_stock.cust_code,cust_stock_det.item_code,cust_stock_det.cust_item__ref) cust_item_ref_descr&quot;) COMPUTE(NAME=&quot;&apos; &apos; as discount&quot;) COMPUTE(NAME=&quot;FN_GET_CUST_SORDER_QTY(cust_stock.cust_code,cust_stock_det.item_code,cust_stock_det.sales,cust_stock_det.cl_stock,cust_stock_det.transit_qty) as net_sales&quot;) JOIN (LEFT=&quot;cust_stock.tran_id&quot; OP =&quot;=&quot;RIGHT=&quot;cust_stock_det.tran_id&quot; ) JOIN (LEFT=&quot;item.item_code&quot; OP =&quot;=&quot;RIGHT=&quot;cust_stock_det.item_code&quot; )WHERE( EXP1 =&quot;~&quot;CUST_STOCK~&quot;.~&quot;TRAN_ID~&quot;&quot; OP =&quot;=&quot; EXP2 =&quot;:mtran_id&quot; ) ) ARG(NAME = &quot;mtran_id&quot; TYPE = string) </retrieve>
<update>CUST_STOCK_DET</update>
<updatewhere>0</updatewhere>
<updatekeyinplace>no</updatekeyinplace>
......@@ -1126,6 +1126,34 @@
<color>67108864</color>
</background>
</TextObject>
<TextObject>
<band>Header</band>
<alignment>0</alignment>
<text>Cust Item Ref Descr</text>
<border>2</border>
<color>33554432</color>
<x>2948</x>
<y>2</y>
<height>15</height>
<width>122</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>cust_item_ref_descr_t</name>
<visible>1</visible>
<font>
<face>Liberation Sans</face>
<height>-10</height>
<weight>400</weight>
<family>2</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</TextObject>
<ColumnObject>
<band>Detail</band>
<id>1</id>
......@@ -2321,13 +2349,14 @@
<band>Detail</band>
<id>32</id>
<alignment>0</alignment>
<tabsequence>0</tabsequence>
<tabsequence>32766</tabsequence>
<border>5</border>
<color>33554432</color>
<x>3073</x>
<y>1</y>
<x>3072</x>
<y>2</y>
<height>18</height>
<width>84</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
......@@ -2360,14 +2389,14 @@
<tabsequence>0</tabsequence>
<border>5</border>
<color>33554432</color>
<x>3160</x>
<y>1</y>
<height>18</height>
<width>66</width>
<x>3159</x>
<y>2</y>
<height>15</height>
<width>80</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>net_amt</name>
<name>net_sales</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
......@@ -2389,34 +2418,6 @@
<color>1073741824</color>
</background>
</ColumnObject>
<TextObject>
<band>Header</band>
<alignment>0</alignment>
<text>Cust Item Ref Descr</text>
<border>2</border>
<color>33554432</color>
<x>2948</x>
<y>2</y>
<height>15</height>
<width>122</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>cust_item_ref_descr_t</name>
<visible>1</visible>
<font>
<face>Liberation Sans</face>
<height>-10</height>
<weight>400</weight>
<family>2</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</TextObject>
<TextObject>
<band>Header</band>
<alignment>0</alignment>
......@@ -2424,9 +2425,9 @@
<border>2</border>
<color>33554432</color>
<x>3072</x>
<y>1</y>
<y>2</y>
<height>15</height>
<width>85</width>
<width>84</width>
<html>
<valueishtml>0</valueishtml>
</html>
......@@ -2448,17 +2449,17 @@
<TextObject>
<band>Header</band>
<alignment>0</alignment>
<text>Net Amt</text>
<text>Net Sales</text>
<border>2</border>
<color>33554432</color>
<x>3159</x>
<y>1</y>
<height>15</height>
<width>67</width>
<x>3158</x>
<y>2</y>
<height>17</height>
<width>81</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>net_amt_t</name>
<name>net_sales_t</name>
<visible>1</visible>
<font>
<face>Liberation Sans</face>
......
......@@ -82,7 +82,7 @@ end;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
......@@ -110,4 +110,55 @@ end if;
when OTHERS then
return 0;
end;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
create or replace
function FN_GET_CUST_SORDER_QTY
(as_custcode in char ,as_itemcode char ,lc_sales number, lc_clstock number , lc_transQty number )
return number is lc_netsale number(14,3);
lc_sbal number(14,3);
replfactor number(3);
replperiod number(3);
itemser char(5);
begin
select repl_factor into replfactor from customeritem where cust_code = as_custcode and item_code = as_itemcode ;
if replfactor is null then
Select item_ser into itemser from item where item_code = as_itemcode ;
select repl_factor into replfactor from customer_series where cust_code = as_custcode and item_ser = itemser ;
if replfactor is null then
select repl_factor into replfactor from customer where cust_code = as_custcode ;
if replfactor is null then
select var_value into replfactor from disparm where prd_code = '999999' and var_name = 'REPL_FACTOR';
end if;
end if;
end if;
select repl_period into replperiod from customeritem where cust_code = as_custcode and item_code = as_itemcode ;
if replperiod is null then
Select item_ser into itemser from item where item_code = as_itemcode ;
select repl_period into replperiod from customer_series where cust_code = as_custcode and item_ser = itemser ;
if replperiod is null then
select repl_period into replperiod from customer where cust_code = as_custcode ;
if replperiod is null then
select var_value into replperiod from disparm where prd_code = '999999' and var_name = 'REPL_PERIOD';
end if;
end if;
end if;
lc_netsale := lc_sales /replperiod * replfactor;
lc_netsale := lc_netsale - lc_clstock - lc_transQty ;
Return ROUND(lc_netsale);
end;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment