File mfg/2013/base/src/QAD_CustProfitability.p changed (mode: 100644) (index 253fcb4..4567aa8) |
... |
... |
define temp-table ttCustProfit no-undo |
60 |
60 |
field RangeEnd as date |
field RangeEnd as date |
61 |
61 |
. |
. |
62 |
62 |
|
|
63 |
|
/*c1495* start added code */ |
|
|
63 |
|
/*c1485* start added code */ |
64 |
64 |
define temp-table ttReportOptions no-undo |
define temp-table ttReportOptions no-undo |
65 |
65 |
field rptDateBegin as char |
field rptDateBegin as char |
66 |
66 |
field rptEndDate as char |
field rptEndDate as char |
67 |
67 |
field rptCustFrom as char |
field rptCustFrom as char |
68 |
68 |
field rptCustTo as char |
field rptCustTo as char |
69 |
69 |
. |
. |
70 |
|
/*c1495* end added code */ |
|
|
70 |
|
/*c1485* end added code */ |
71 |
71 |
|
|
72 |
72 |
|
|
73 |
73 |
/*c1485* start deleted code >>> |
/*c1485* start deleted code >>> |
|
... |
... |
define temp-table ttReportOptions no-undo |
87 |
87 |
* * field rptReportCurr as char |
* * field rptReportCurr as char |
88 |
88 |
* */ |
* */ |
89 |
89 |
* . |
* . |
90 |
|
*c1495* end deleted code <<<<< */ |
|
|
90 |
|
*c1485* end deleted code <<<<< */ |
91 |
91 |
|
|
92 |
92 |
define dataset dsReportResults for ttCustProfit, ttReportOptions. |
define dataset dsReportResults for ttCustProfit, ttReportOptions. |
93 |
93 |
|
|
|
... |
... |
define variable begyearper as integer format "999999". |
97 |
97 |
define variable endyearper as integer format "999999". |
define variable endyearper as integer format "999999". |
98 |
98 |
define variable begdt as date. |
define variable begdt as date. |
99 |
99 |
define variable enddt as date. |
define variable enddt as date. |
100 |
|
/*c1495* start added code */ |
|
|
100 |
|
/*c1485* start added code */ |
101 |
101 |
define variable custfrom as char. |
define variable custfrom as char. |
102 |
102 |
define variable custto as char. |
define variable custto as char. |
103 |
|
/*c1495* end added code */ |
|
|
103 |
|
/*c1485* end added code */ |
104 |
104 |
define variable vdiscount as decimal. |
define variable vdiscount as decimal. |
105 |
105 |
define variable vterms as decimal. |
define variable vterms as decimal. |
106 |
106 |
define variable vfreight as decimal. |
define variable vfreight as decimal. |
|
... |
... |
run CreateField in reportHandle |
740 |
740 |
{&ParameterValueType_Constant}). |
{&ParameterValueType_Constant}). |
741 |
741 |
*<<*/ |
*<<*/ |
742 |
742 |
|
|
743 |
|
/*c1495* start added code */ |
|
|
743 |
|
/*c1485* start added code */ |
744 |
744 |
run CreateField in reportHandle |
run CreateField in reportHandle |
745 |
745 |
(buffername, |
(buffername, |
746 |
746 |
"rptCustFrom", |
"rptCustFrom", |
|
... |
... |
run CreateField in reportHandle |
780 |
780 |
{&ParameterValueType_Constant}, |
{&ParameterValueType_Constant}, |
781 |
781 |
"", |
"", |
782 |
782 |
{&ParameterValueType_Constant}). |
{&ParameterValueType_Constant}). |
783 |
|
/*c1495* end added code */ |
|
|
783 |
|
/*c1485* end added code */ |
784 |
784 |
|
|
785 |
785 |
run CreateField in reportHandle |
run CreateField in reportHandle |
786 |
786 |
(buffername, |
(buffername, |
|
... |
... |
define var stringVar as char. |
980 |
980 |
begdt = date(stringVar) no-error. |
begdt = date(stringVar) no-error. |
981 |
981 |
stringVar = getFilterValue("ttReportOptions", "rptEndDate", ""). |
stringVar = getFilterValue("ttReportOptions", "rptEndDate", ""). |
982 |
982 |
enddt = date(stringVar) no-error. |
enddt = date(stringVar) no-error. |
983 |
|
/*c1495* start added code */ |
|
|
983 |
|
/*c1485* start added code */ |
984 |
984 |
/* Cust Codes */ |
/* Cust Codes */ |
985 |
985 |
stringVar = getFilterValue("ttReportOptions", "rptCustFrom", ""). |
stringVar = getFilterValue("ttReportOptions", "rptCustFrom", ""). |
986 |
986 |
custfrom = trim(stringVar) no-error. |
custfrom = trim(stringVar) no-error. |
987 |
987 |
stringVar = getFilterValue("ttReportOptions", "rptCustTo", ""). |
stringVar = getFilterValue("ttReportOptions", "rptCustTo", ""). |
988 |
988 |
custto = trim(stringVar) no-error. |
custto = trim(stringVar) no-error. |
989 |
|
/*c1495* end added code */ |
|
|
989 |
|
/*c1485* end added code */ |
990 |
990 |
|
|
991 |
991 |
if begdt = ? |
if begdt = ? |
992 |
992 |
then do: |
then do: |
|
... |
... |
define var stringVar as char. |
1102 |
1102 |
where ih_hist.ih_domain = global_domain |
where ih_hist.ih_domain = global_domain |
1103 |
1103 |
and ih_inv_date >= begdt |
and ih_inv_date >= begdt |
1104 |
1104 |
and ih_inv_date <= enddt |
and ih_inv_date <= enddt |
1105 |
|
/*c1495* start added code */ |
|
|
1105 |
|
/*c1485* start added code */ |
1106 |
1106 |
and ih_cust >= custfrom |
and ih_cust >= custfrom |
1107 |
1107 |
and ih_cust <= custto |
and ih_cust <= custto |
1108 |
|
/*c1495* end added code */ |
|
|
1108 |
|
/*c1485* end added code */ |
1109 |
1109 |
no-lock |
no-lock |
1110 |
1110 |
break by ih_cust: |
break by ih_cust: |
1111 |
1111 |
for each idh_hist |
for each idh_hist |
|
... |
... |
define var stringVar as char. |
1237 |
1237 |
no-lock no-error. |
no-lock no-error. |
1238 |
1238 |
if available Company then do: |
if available Company then do: |
1239 |
1239 |
for each GL where |
for each GL where |
1240 |
|
lookup(GLCode, "41745,41765,41725,41735,41755") > 0 |
|
|
1240 |
|
/*c1485* lookup(GLCode, "41745,41765,41725,41735,41755") > 0 */ |
|
1241 |
|
/*c1485*/ lookup(GLCode, "41745,41765,41725,41735,41755,51500") > 0 |
1241 |
1242 |
no-lock: |
no-lock: |
1242 |
1243 |
for each PostingLine where |
for each PostingLine where |
1243 |
1244 |
PostingLine.GL_ID = GL.GL_ID |
PostingLine.GL_ID = GL.GL_ID |
|
... |
... |
define var stringVar as char. |
1271 |
1272 |
then |
then |
1272 |
1273 |
ttCustProfit.InvDisc = |
ttCustProfit.InvDisc = |
1273 |
1274 |
(PostingLineCreditTC + PostingLineDebitTC). |
(PostingLineCreditTC + PostingLineDebitTC). |
|
1275 |
|
/*c1485* start added code */ |
|
1276 |
|
else if Gl.GlCode = "51500" |
|
1277 |
|
then ttCustProfit.InvFreight = vfreight. |
|
1278 |
|
/*c1485* end added code */ |
1274 |
1279 |
else |
else |
1275 |
1280 |
ttCustProfit.InvTerms = |
ttCustProfit.InvTerms = |
1276 |
1281 |
(PostingLineCreditTC + PostingLineDebitTC). |
(PostingLineCreditTC + PostingLineDebitTC). |