List of commits:
Subject Hash Author Date (UTC)
c1580 5efbfe70f325ed37582eba8fb8fd609e6e3e42a4 ec2-user 2016-05-31 03:38:23
d3465 5e92f8eb00d4c5e131183741c0b48440a59c41e6 ec2-user 2016-04-27 23:41:43
d3465 7999587f92b8a864f4cbc40a90179ff8e6241281 ec2-user 2016-04-27 04:51:23
d3224 99525a3628e13b692e354b3b6539ee1cc3b83d69 ec2-user 2015-08-25 02:27:35
d3224 f9c625d1ec21fbc36e1299ce6e8fcf59d280a9b3 ec2-user 2015-08-21 01:49:30
d3224 8adf5a92615a52d09e92e82dcb8fb680fba09b1c ec2-user 2015-08-19 02:25:31
c1485 54031cfe6e8c2ba4cdb833be90ffc01ebdf14b07 nac 2015-01-23 01:53:56
c1485b a1a2692751a6743d6f68f6eac84f2b026ebb9307 nac 2014-12-09 05:28:32
c1485 4b886da89f1d50501a37d678c8676a485d47f0c1 nac 2014-12-09 05:27:38
c1485 9b651808f47eccc51a50aebd85c9f59c3c9d1697 gbg 2014-09-17 04:43:53
c1485 7edc5474ef79faad54c8f0ea7ea401d3fe0ee412 gbg 2014-09-17 04:40:17
c1485 4ec559b86cfcf3525c05b3067dfc93f95431efab gbg 2014-09-17 04:15:47
c1485 5a7f22188dcae14b979985c75feebb47388be676 gbg 2014-09-16 02:29:31
K2155 2e7558f7db2b6e31da2519cad202b86da09adb9b nac 2014-09-04 01:01:16
k2155 86ded46bdb75580f51d14ba9b9d02c5b0e74199b nac 2014-09-04 00:58:06
c1474 1e6975340fddfad71c1da85972c906b15ad455c3 nac 2014-07-28 03:16:10
c1474 5abda4b993a526d461af27de8e74b352f173e775 gbg 2014-07-03 14:15:32
Update tpl library for EFT Bank File Creation with workaround for amounts 91dab2d3618b99b8758bf65d58cd8facc6df08ff gbg 2014-03-03 07:29:21
d2561 a3d2e47f82c1e0d9b245391d8e9cebec9a900afd gbg 2014-02-21 04:33:43
d2561 46df2f4ab87f400e7d20dfb31faf448d396f04fa gbg 2014-02-21 03:35:00
Commit 5efbfe70f325ed37582eba8fb8fd609e6e3e42a4 - c1580
Author: ec2-user
Author date (UTC): 2016-05-31 03:38
Committer name: ec2-user
Committer date (UTC): 2016-05-31 03:38
Parent(s): 5e92f8eb00d4c5e131183741c0b48440a59c41e6
Signing key:
Tree: 40acbcf5135738b01238abc2d8e2680a1a87fac4
File Lines added Lines deleted
mfg/2013/base/src/txmeth60.p 363 255
mfg/2013/base/src/xftxtots.p 75 0
File mfg/2013/base/src/txmeth60.p changed (mode: 100644) (index 1210825..ad6921d)
1 /* txmeth60.p - qad TAX CALCULATION ROUTINE THAT CALLS QUANTUM */
2 /* txmeth20.p - qad TAX CALCULATION ROUTINE THAT CALLS QUANTUM */
3 /* Copyright 1986 QAD Inc. All rights reserved. */
4 /* REVISION: 8.6 CREATED : 10/20/97 *K0JV* Shankar Subramanian */
1 /* txmeth60.p - qad GENERIC TAX CALCULATION ROUTINE */
2 /* txmeth01.p - qad GENERIC TAX CALCULATION ROUTINE */
3 /* Copyright 1986 QAD Inc. All rights reserved. */
4 /* $Id$: */
5 /* Revision: 7.3 CREATED: 11/18/92 By: bcm *G413* */
6 /* Revision: 7.4 MODIFIED: 07/02/93 By: bcm *H010* */
7 /* 10/22/93 By: bcm *H212* */
8 /* 03/17/94 By: bcm *H296* */
9 /* 03/29/94 By: bcm *H309* */
10 /* 09/20/94 By: bcm *H531* */
11 /* 09/20/94 By: bcm *H610* */
12 /* 02/23/95 By: jzw *H0BM* */
13 /* Revision: 8.5 MODIFIED: 07/05/95 By: taf *J053* */
14 /* 05/08/96 By: jzw *H0KY* */
15 /* REVISION: 8.6 MODIFIED: 09/03/96 By: jzw *K008* */
5 16 /* REVISION: 8.6E LAST MODIFIED: 02/23/98 BY: *L007* A. Rahane */ /* REVISION: 8.6E LAST MODIFIED: 02/23/98 BY: *L007* A. Rahane */
6 /* REVISION: 8.6E LAST MODIFIED: 05/09/98 BY: *L00Y* Jeff Wootton */
7 /* REVISION: 8.6E LAST MODIFIED: 06/22/98 BY: *J2D9* Sachin Shah */
8 /* REVISION: 8.6E LAST MODIFIED: 06/30/98 BY: *L01B* Jim Josey */
9 /* REVISION: 8.6E LAST MODIFIED: 10/11/98 BY: *L0BG* Surendra Kumar */
10 /* REVISION: 8.6E LAST MODIFIED: 10/26/98 BY: *L0CF* Sami Kureishy */
11 /* REVISION: 8.6E LAST MODIFIED: 08/12/99 BY: *J3KY* Sachin Shinde */
17 /* 11/25/96 By: *K01X* jzw */
18 /* 11/10/97 BY: *K197* Jeff Wootton */
19 /* REVISION: 8.6E LAST MODIFIED: 04/22/98 BY: *J2D9* Sachin Shah */
20 /* REVISION: 8.6E LAST MODIFIED: 10/04/98 BY: *J314* Alfred Tan */
21 /* REVISION: 8.6E LAST MODIFIED: 04/27/99 BY: *J3DV* Santosh Rao */
22 /* REVISION: 8.6E LAST MODIFIED: 08/20/99 BY: *J3KY* Sachin Shinde */
12 23 /* REVISION: 9.1 LAST MODIFIED: 08/12/00 BY: *N0KC* myb */ /* REVISION: 9.1 LAST MODIFIED: 08/12/00 BY: *N0KC* myb */
13 /* REVISION: 9.1 LAST MODIFIED: 09/25/00 BY: *N0W4* BalbeerS Rajput */
14 /* REVISION: 9.1 LAST MODIFIED: 02/12/01 BY: *M11P* Veena Lad */
15 /* Old ECO marker removed, but no ECO header exists *F0PN* */
16 /* Revision: 1.9.2.6 BY: Ashish M. DATE: 12/10/01 ECO: *M1R1* */
17 /* Revision: 1.9.2.8 BY: Paul Donnelly (SB) DATE: 06/28/03 ECO: *Q00M* */
18 /* Revision: 1.9.2.9 BY: Veena Lad DATE: 09/17/03 ECO: *N2KV* */
19 /* Revision: 1.9.2.10 BY: Manjusha Inglay DATE: 11/22/03 ECO: *P19S* */
20 /* Revision: 1.9.2.11 BY: Sajan Chhetri DATE: 01/21/04 ECO: *Q05H* */
21 /* Revision: 1.9.2.12 BY: Priya Idnani DATE: 01/07/05 ECO: *Q0GD* */
22 /* Revision: 1.9.2.13 BY: Katie Hilbert DATE: 01/07/05 ECO: *Q0GH* */
23 /* $Revision$ BY: Tejasvi Kulkarni DATE: 02/21/06 ECO: *Q0R7* */
24 /* REVISION: 9.1 LAST MODIFIED: 09/11/00 BY: *M0S3* Veena Lad */
25 /* REVISION: 9.1 LAST MODIFIED: 10/11/00 BY: *L12X* Shilpa Athalye */
26 /* REVISION: 9.1 LAST MODIFIED: 09/30/00 BY: *N0W4* Mudit Mehta */
27 /* Old ECO marker removed, but no ECO header exists *F0PN* */
28 /* Revision: 1.11.2.8 BY: Manjusha Inglay DATE: 04/26/02 ECO: *M1X7* */
29 /* Revision: 1.11.2.9 BY: Samir Bavkar DATE: 07/07/02 ECO: *P0B0* */
30 /* Revision: 1.11.2.10 BY: Ashish Maheshwari DATE: 10/16/02 ECO: *N1W5* */
31 /* Revision: 1.11.2.12 BY: Paul Donnelly (SB) DATE: 06/28/03 ECO: *Q00M* */
32 /* Revision: 1.11.2.13 BY: Michael Dempsey DATE: 05/14/07 ECO: *R0C6* */
33 /* Revision: 1.11.2.14 BY: Prajakta Patil DATE: 08/28/09 ECO: *Q3B9* */
34 /* Revision: 1.11.2.16 BY: Neil Curzon DATE: 07/21/10 ECO: *R21S* */
35 /* $Revision$ BY: Jiang Wan DATE: 07/25/10 ECO: *R235* */
24 36 /* Buderim LAST MODIFIED: 2016-Apr-27 BY: gbg *D3465* */ /* Buderim LAST MODIFIED: 2016-Apr-27 BY: gbg *D3465* */
25 37 /*-Revision end---------------------------------------------------------------*/ /*-Revision end---------------------------------------------------------------*/
26 38
27 /*V8:ConvertMode=Maintenance */
28 39 /******************************************************************************/ /******************************************************************************/
29 40 /* All patch markers and commented out code have been removed from the source */ /* All patch markers and commented out code have been removed from the source */
30 41 /* code below. For all future modifications to this file, any code which is */ /* code below. For all future modifications to this file, any code which is */
 
32 43 /* be added. The ECO marker should only be included in the Revision History. */ /* be added. The ECO marker should only be included in the Revision History. */
33 44 /******************************************************************************/ /******************************************************************************/
34 45 /*! /*!
35 txmeth20.p qad Quantum Tax Calculation routine
36
37 I/O Parameter Like Description
38 ------ ------------------- ------------- ---------------------------
39 input tax_code tx2_tax_code Tax Code
40 input tax_round txed_round Rounding Method
41 input rndmthd rnd_rnd_mthd Rounding Method
42 input tax_by_line tx2_by_line Tax By Line
43 input amt_curr tx2d_curr Tax Currency
44 input tax_in sod_tax_in Tax Included
45 input entity en_entity Entity
46 input entity_exrate exr_rate Exchange Rate
47 input exrate exr_rate
48 input tr_type tx2d_tr_type Tax Transaction Type
49 input ref tx2d_ref Document Reference
50 input nbr tx2d_nbr Second Reference
51 input line tx2d_line Line Number
52 input trlr_code tx2d_trl Trailer_code
53 input tax_line tx2d_line Tax Line Number
54 input tax_date tx2d_effdate Tax Rate Effective date
55 input tax_post_date tx2d_effdate GL Posted Date
56 input adj_factor mfc_decimal Adjustment Factor
57 input company-code en_entity Company Code
58 input divn-code sod_site Division Code
59 input cmvd-addr ad_addr Customer Id
60 input cmvd-taxclass ad_taxc Customer Tax Class
61 input shipfrom-taxzone ad_tax_zone Ship-from Tax Zone
62 input shipto-taxzone ad_tax_zone Ship-to Tax Zone
63 input orderaccept-taxzone ad_tax_zone Order Acceptance Tax Zone
64 input shipfrom-incity mfc_logical Ship-from Incity indicator
65 input shipto-incity mfc_logical Ship-to Incity indicator
66 input orderaccept-incity mfc_logical Ord Accept Incity indicator
67 input lineitem-qty sod_qty_ord Line Item Quantity
68 input taxc tx2_pt_taxc Item Tax Class
69 input first-taxtype mfc_logical First Tax Type
70 input taxable so_taxable Taxable
71 input vq-post mfc_logical Quantum Register Post flag
72 input vq-exch-rate exr_rate Exch Rate: Trans Curr - USD
73 input vq-exch-rate2 exr_rate2 Exch Rate: Trans Curr - USD
74 input vq-rndmthd cu_rnd_mthd Rounding Method:Trans Curr- US
75 output result-status integer Result Status
76 input-output tot_amt tx2d_totamt Extended Amount
77 output taxes tx2d_totamt Taxes
78 output adj_amt tx2d_totamt Taxable Base Amount
79 output recoverable tx2d_totamt Taxable Base Amount
80 output tax_base_amt tx2d_totamt Taxable Base Amount
81 output ntax_amt tx2d_totamt Non-Taxable Amount
46 txmeth01.p qad Generic Tax Calculation routine
47 receives the following parameters
48 input tax_code tx2_tax_code Tax Code
49 input tax_round txed_round Rounding Method
50 input tax_curr tx2d_curr Tax Currency
51 input tax_in sod_tax_in Tax Included In Price
52 input tr_type tx2d_tr_type Tax Transaction Type
53 input ref tx2d_ref Document Reference
54 input nbr tx2d_nbr Second Reference
55 input line tx2d_line Line Number
56 input trlr_code trl_code Trailer_code
57 input tax_line tx2d_line Tax Line Number
58 input adj_factor mfc_decimal Adjustment factor
59 input exrate so_ex_rate Transaction exchange rate
60 input exrate2 so_ex_rate2 Transaction exchange rate
61 input tot_amt tx2d_totamt Total Amount
62 input adjust_factor mfc_decimal Flexible Adjustment Factor
63 output taxes mfc_decimal Taxes
64 output tax_base_amt mfc_decimal Taxable Base Amount
65 output ntax_amt mfc_decimal Non-Taxable Amount
82 66
83 67 */ */
84 68 /*! /*!
85 69 NOTE: ANY CHANGES MADE TO THIS PROGRAM SHOULD ALSO BE MADE TO NOTE: ANY CHANGES MADE TO THIS PROGRAM SHOULD ALSO BE MADE TO
86 all TXMETH*.P PROGRAMS
87 */
88 /***************************************************************************/
89 {us/bbi/mfdeclre.i}
90 {us/cx/cxcustom.i "TXMETH20.P"}
91
92 define input parameter tax_code like tx2_tax_code no-undo.
93 define input parameter tax_round like txed_round no-undo.
94 define input parameter rndmthd like rnd_rnd_mthd no-undo.
95 define input parameter tax_by_line like tx2_by_line no-undo.
96 define input parameter amt_curr like tx2d_curr no-undo.
97 define input parameter tax_in like sod_tax_in no-undo.
98 define input parameter entity like en_entity no-undo.
99 define input parameter entity_exrate like exr_rate no-undo.
100 define input parameter exrate like exr_rate no-undo.
101 define input parameter tr_type like tx2d_tr_type no-undo.
102 define input parameter ref like tx2d_ref no-undo.
103 define input parameter nbr like tx2d_nbr no-undo.
104 define input parameter line like tx2d_line no-undo.
105 define input parameter trlr_code like tx2d_trl no-undo.
106 define input parameter tax_line like tx2d_line no-undo.
107 define input parameter tax_date like tx2d_effdate no-undo.
108 define input parameter tax_post_date like tx2d_effdate no-undo.
109 define input parameter adj_factor like mfc_decimal no-undo.
110 define input parameter company-code as character no-undo.
111 define input parameter divn-code as character no-undo.
112 define input parameter cmvd-addr as character no-undo.
113 define input parameter cmvd-taxclass as character no-undo.
114 define input parameter shipfrom-taxzone as character no-undo.
115 define input parameter shipto-taxzone as character no-undo.
116 define input parameter orderaccept-taxzone as character no-undo.
117 define input parameter shipfrom-incity as logical no-undo.
118 define input parameter shipto-incity as logical no-undo.
119 define input parameter orderaccept-incity as logical no-undo.
120 define input parameter lineitem-qty like mfc_decimal no-undo.
121 define input parameter taxc like tx2_pt_taxc no-undo.
122 define input parameter first-taxtype as logical no-undo.
123 define input parameter taxable like so_taxable no-undo.
124 define input parameter vq-post as logical no-undo.
125 define input parameter vq-exch-rate like exr_rate no-undo.
126 define input parameter vq-exch-rate2 like exr_rate2 no-undo.
127 define input parameter vq-rndmthd like cu_rnd_mthd no-undo.
128 define output parameter result-status as integer no-undo.
129 define input-output parameter tot_amt like tx2d_totamt no-undo.
130 define output parameter taxes like tx2d_totamt no-undo.
131 define output parameter adj_amt like tx2d_totamt no-undo.
132 define output parameter recoverable like tx2d_totamt no-undo.
133 define output parameter tax_base_amt like tx2d_totamt no-undo.
134 define output parameter ntax_amt like tx2d_totamt no-undo.
135
136 define variable mc-error-number like msg_nbr no-undo.
137
138 /* DEFINE VARIABLES TO HOLD THE EXTENDED AMOUNT, TAXES AND */
139 /* NON-TAX AMOUNT IN US DOLLARS. THIS IS BECAUSE QUANTUM CAN */
140 /* CALCULATE TAXES IN US DOLLARS ONLY. WE ARE CONVERTING TOT-AMT */
141 /* TO US DOLLARS BEFORE CALLING QUANTUM TO CALCULATE TAXES AND */
142 /* CONVERTING TOT-AMT, TAXES AND NON-TAX AMOUNTS BACK TO */
143 /* TRANSACTION CURRENCY FROM US DOLLARS */
144
145 define variable vq-tot-amt like tx2d_totamt no-undo.
146 define variable vq-taxes like tx2d_totamt no-undo.
147 define variable vq-ntax-amt like tx2d_totamt no-undo.
148
149 /* INCLUDE VQ WORKFILE HERE. THIS FILE HAS A FEW VARIABLE(S) */
150 /* DEFINED THAT WILL ENSURE CALLING OF THE QUANTUM API ONLY ONCE */
151 /* FOR A DOCUMENT. IT HAS A TEMP-TABLE DEFINITION THAT WILL HOLD */
152 /* ALL THE LINE ITEM, TAX TYPE INFORMATION AND WILL CALL */
153 /* VQTXCALC.P AFTER THE LAST LINE ITEM IN A FOR EACH ... LOOP */
154 /* IS PROCESSED. */
155
156 {us/vq/vqwrkdef.i}
70 ALL TXMETH*.P PROGRAMS
71 */
72 /***************************************************************************/
73
74 {us/bbi/mfdeclre.i}
75 {us/gp/gpdecchr.i}
76 /*d3465* start added code >>> */
77 define input parameter tax_code like tx2_tax_code no-undo.
78 define input parameter tax_round like txed_round no-undo.
79 define input parameter amt_curr like tx2d_curr no-undo.
80 define input parameter tax_in like sod_tax_in no-undo.
81 define input parameter tr_type like tx2d_tr_type no-undo.
82 define input parameter ref like tx2d_ref no-undo.
83 define input parameter nbr like tx2d_nbr no-undo.
84 define input parameter line like tx2d_line no-undo.
85 define input parameter trlr_code like tx2d_trl no-undo.
86 define input parameter tax_line like tx2d_line no-undo.
87 define input parameter adj_factor like mfc_decimal no-undo.
88 define variable exrate like so_ex_rate no-undo.
89 define variable exrate2 like so_ex_rate no-undo.
90 define variable inv_disc like tx2d_totamt no-undo.
91 define input-output parameter tot_amt like tx2d_totamt no-undo.
92 define output parameter taxes like tx2d_totamt no-undo.
93 define output parameter adj_amt like tx2d_totamt no-undo.
94 define output parameter recoverable like tx2d_totamt no-undo.
95 define output parameter tax_base_amt like tx2d_totamt no-undo.
96 define output parameter ntax_amt like tx2d_totamt no-undo.
97 define variable disc_amt like tx2d_totamt no-undo.
98
99 exrate = 1.0.
100 exrate2 = 1.0.
101 inv_disc = 0.0.
102
103 /*d3465* end added code <<<< */
104
105
106
107 /*d3465* start deleted code >>>
108 define input parameter tax_code like tx2_tax_code no-undo.
109 define input parameter tax_round like txed_round no-undo.
110 define input parameter amt_curr like tx2d_curr no-undo.
111 define input parameter tax_in like sod_tax_in no-undo.
112 define input parameter tr_type like tx2d_tr_type no-undo.
113 define input parameter ref like tx2d_ref no-undo.
114 define input parameter nbr like tx2d_nbr no-undo.
115 define input parameter line like tx2d_line no-undo.
116 define input parameter trlr_code like tx2d_trl no-undo.
117 define input parameter tax_line like tx2d_line no-undo.
118 define input parameter adj_factor like mfc_decimal no-undo.
119 define input parameter exrate like so_ex_rate no-undo.
120 define input parameter exrate2 like so_ex_rate no-undo.
121 define input parameter inv_disc like tx2d_totamt no-undo.
122 define input-output parameter tot_amt like tx2d_totamt no-undo.
123 define output parameter taxes like tx2d_totamt no-undo.
124 define output parameter adj_amt like tx2d_totamt no-undo.
125 define output parameter recoverable like tx2d_totamt no-undo.
126 define output parameter tax_base_amt like tx2d_totamt no-undo.
127 define output parameter ntax_amt like tx2d_totamt no-undo.
128 define output parameter disc_amt like tx2d_totamt no-undo.
129 *d3465* end deleted code <<<< */
130
131 define variable start_tot like tx2d_totamt no-undo.
132 define variable base_percent like mfc_dec format "->>9.99<<%"
133 label "Base Percent" no-undo.
134 define variable ar_ap as logical initial true no-undo.
135 define variable found_base_tx2d like mfc_logical no-undo.
136 define variable l_mintax like tx2_min no-undo.
137 define variable l_maxtax like tx2_max no-undo.
138 define variable l_mc_error_nbr like msg_nbr no-undo.
139 define variable l_tmp_amt like tx2d_totamt no-undo.
140
141 {us/gp/gpcrnd.i}
142
143 /* INITIALIZE MULTI-CURRENCY PROCEDURE LIBRARY */
144 {us/gp/gprunpdf.i "mcpl" "p"}
145
157 146
158 147 /*d3465* start added code >>>> */ /*d3465* start added code >>>> */
159 148 def var vmessage as char. def var vmessage as char.
 
... ... then do:
196 185 end. end.
197 186 end. end.
198 187 if vqty = ? then vqty = 0. if vqty = ? then vqty = 0.
188 tot_amt = vqty.
199 189
200 190 /*d3465* End added code <<<<<< */ /*d3465* End added code <<<<<< */
201 191
202 if taxable
203 then do:
192 /* FIND TAX RATE MASTER */
193 for first tx2_mstr
194 where tx2_mstr.tx2_domain = global_domain and tx2_tax_code = tax_code
195 no-lock: end. /* FOR FIRST tx2_mstr */
204 196
205 /* FIND TAX RATE MASTER */
206
207 for first tx2_mstr
208 fields(tx2_domain tx2_apr_use tx2_ara_use tx2_pct_recv tx2_tax_code
209 tx2_tax_pct tx2_tax_type)
210 where tx2_mstr.tx2_domain = global_domain and tx2_tax_code = tax_code
211 no-lock:
212 end. /* FOR FIRST tx2_mstr */
197 if not available tx2_mstr
198 then do:
199 /* TAX MASTER DOES NOT EXIST */
200 {us/bbi/pxmsg.i &MSGNUM=872 &ERRORLEVEL=4}
201 end. /* IF NOT AVAILABLE tx2_mstr */
202
203 /* CURRENCY ISSUES FOR TAXABLE AMOUNT? */
204 /* CALCULATE */
205 if tx2_tax_pct = 0 and
206 tx2_base = ""
207 then
208 assign
209 taxes = 0
210 tax_base_amt = tot_amt
211 ntax_amt = 0.
212
213 else do:
214 if tx2_tax_pct = 0
215 then
216 assign
217 taxes = 0
218 ntax_amt = 0.
219
220 if tx2_base > "" then
221 for first code_mstr
222 fields( code_domain code_cmmt code_fldname code_value)
223 where code_mstr.code_domain = global_domain and code_fldname =
224 "txb_base" and
225 code_value = tx2_base no-lock:
226 end. /* FOR FIRST CODE_MSTR */
213 227
214 if not available(tx2_mstr)
215 then do:
216 /* TAX MASTER DOES NOT EXIST */
217 {us/bbi/pxmsg.i &MSGNUM=872 &ERRORLEVEL=4}
218 end. /* IF NOT AVAILABLE(tx2_mstr) */
228 assign
229 start_tot = tot_amt
230 l_tmp_amt = start_tot
231 base_percent = if available code_mstr then
232 getDecFromChar(substring(code_cmmt,1,9))
233 else 100
234 tax_base_amt = tot_amt.
219 235
220 236 /* CHECK TAX INCLUDED */ /* CHECK TAX INCLUDED */
221 237 if tax_in if tax_in
222 then
223 tot_amt = (tot_amt * 100)/(100 + tx2_tax_pct).
224
225 /*d3465*/ tot_amt = vqty.
226 end. /* IF taxable */
227
228 assign
229 taxes = 0
230 ntax_amt = 0
231 tax_base_amt = tot_amt
232 vq-tot-amt = tot_amt.
233
234 /* NEED US CURRENCY CODE FOR MC-CURR-CONV */
235 for first mfc_ctrl
236 fields(mfc_domain mfc_module mfc_field mfc_char)
237 where mfc_ctrl.mfc_domain = global_domain
238 and mfc_module = "vq"
239 and mfc_field = "vqc_us_curr"
240 no-lock:
241 end. /* FOR FIRST mfc_ctrl */
242
243 if available mfc_ctrl
244 then do:
238 then
239 if tx2_inv_disc and inv_disc <> 0 and
240 (tr_type = "18" or tr_type = "22")then
241 assign
242 tot_amt = tot_amt * (1 / (1 + ((base_percent / 100) *
243 ( tx2_tax_pct * (100 - inv_disc) / 10000))))
244 disc_amt = tot_amt - (tot_amt * (1 - (inv_disc / 100)))
245 tot_amt = tot_amt * (1 - (inv_disc / 100))
246 l_tmp_amt = tot_amt.
247 else
248 assign tot_amt = tot_amt / (1 + ((base_percent / 100) *
249 (tx2_tax_pct / 100)))
250 l_tmp_amt = tot_amt.
251
252 /* CHECK TAX BASE */
253 assign
254 tax_base_amt = tot_amt
255 ntax_amt = 0.
245 256
246 /* DO NOT CONVERT THE AMOUNTS PASSED TO AND FROM VERTEX */
247 /* FOR TAX CALCULATION PURPOSES. */
257 if tx2_base > ""
258 then do:
248 259
260 if available code_mstr
261 then do:
262
263 for each txbd_det
264 where txbd_det.txbd_domain = global_domain
265 and txbd_base = tx2_base
266 no-lock:
267
268 found_base_tx2d = no.
269
270 base_tx2d:
271 for each tx2d_det
272 where tx2d_det.tx2d_domain = global_domain
273 and tx2d_ref = ref
274 and tx2d_nbr = nbr
275 and tx2d_trl = trlr_code
276 and tx2d_tr_type = tr_type
277 exclusive-lock:
278
279 if tax_line <> 0 /* TAX_BY_LINE = YES */
280 and tx2d_line <> tax_line /* NOT SAME LINE */
281 then
282 next base_tx2d. /* NOT WANTED */
283
284 if tx2d_tax_type <> txbd_tax_type /* NOT SAME TAX TYPE */
285 then
286 next base_tx2d. /* NOT WANTED */
287
288 found_base_tx2d = yes.
289
290 if not tx2d_tax_in
291 /* FIRST TAX WAS NOT TAX-INCLUDED */
292 or (tx2d_tax_in and not tax_in)
293 /* FIRST TAX WAS TAX-INCLUDED, */
294 /* THIS TAX IS NOT TAX-INCLUDED, */
295 /* SO NEED TO ADD TAX TO THE BASE AMOUNT. */
296 then
297 /* UPDATE tx2d__qadd02[1] AS TO CONTAIN TAX AMOUNT OF */
298 /* CURRENT tx2d_det RECORD AND STORE IT IN */
299 /* tx2d__qadd02[2] TO USE IN SUBSEQUENT LINE OF ORDER */
300 /* TO CALCULATE TAX AMOUNT WITH SAME taxtype IF REQUIRED */
301 assign
302 tx2d__qadd02[1] = tx2d_cur_tax_amt - tx2d__qadd02[1]
303 + tx2d__qadd02[2]
304 tax_base_amt = tax_base_amt + tx2d__qadd02[1]
305 tx2d__qadd02[2] = tx2d__qadd02[1].
306
307 end. /* BASE_TX2D: */
308
309 if found_base_tx2d = no
310 then do:
311 /* TAX DETAIL RECORD FOR TAX BASE TAX TYPE DOES NOT EXIST */
312 {us/bbi/pxmsg.i &MSGNUM=868 &ERRORLEVEL=2}
313 end. /* IF found_base_tx2d = no */
314
315 end. /* FOR EACH txbd_det */
316
317 /* MULTIPLY TOTAL BY PERCENTAGE */
318 assign
319 ntax_amt = tax_base_amt * (1 - base_percent / 100)
320 tax_base_amt = tax_base_amt * base_percent / 100 .
321 end. /* IF AVAILABLE code_mstr */
322
323 else do:
324 /* TAX BASE DOES NOT EXIST */
325 {us/bbi/pxmsg.i &MSGNUM=866 &ERRORLEVEL=2}
326 end. /* IF AVAILABLE code_mstr ELSE */
327
328 end. /* IF TX2_BASE > "" */
329
330
331 /* CHECK MIN/MAX AMOUNTS */
332
333 /* MIN/MAX AMOUNTS ARE CONVERTED TO TRANSACTION CURRENCY, */
334 /* IF REQUIRED AND THEN COMPARED WITH tax_base_amt. */
249 335 assign assign
250 vq-taxes = 0
251 vq-ntax-amt = 0.
336 l_mintax = tx2_min
337 l_maxtax = tx2_max.
252 338
253 /* CALL QUANTUM TO CALCULATE TAXES */
339 if amt_curr <> base_curr
340 then do:
341 run base_to_foreign (input-output l_mintax).
342 run base_to_foreign (input-output l_maxtax).
343 end. /* IF amt_curr <> base_curr */
344
345 if (l_mintax > 0 )
346 and (tax_base_amt > 0 )
347 and (tax_base_amt < l_mintax)
348 then
349 assign
350 ntax_amt = ntax_amt + tax_base_amt - l_mintax
351 tax_base_amt = l_mintax.
254 352
255 /* CREATE TEMP FILE AND STORE ALL THE VALUES IN IT. WHEN WE ARE */
256 /* DONE PROCESSING THE LAST TAX TYPE OF THE LAST LINE, WE WILL */
257 /* CALL VQTXCALC.P SO THAT QUANTUM API WILL BE CALLED ONLY ONCE */
258 /* TO CALCULATE TAXES FOR THE ENTIRE DOCUMENT. THIS APPROACH IS */
259 /* EXPECTED TO REDUCE PROCESSING TIME SIGNIFICANTLY. */
353 else if (l_mintax > 0 )
354 and ( tax_base_amt < 0 )
355 and ((- tax_base_amt) < l_mintax)
356 then
357 assign
358 ntax_amt = ntax_amt - (- tax_base_amt - l_mintax)
359 tax_base_amt = - (l_mintax).
260 360
261 /* WE ARE FORCING THE LINE NUMBERS SINCE TR-TYPE = 18 HAS JUST ONE LINE */
262 /* WITH THE LINE NUMBER AS ZERO . IN THE CASE OF MULTIPLE LINE ITEMS, */
263 /* QUANTUM CANNOT DISTINGUISH BETWEEN LINES */
361 else if (l_maxtax > 0
362 and tax_base_amt > l_maxtax)
363 then
364 assign
365 ntax_amt = ntax_amt + tax_base_amt - l_maxtax
366 tax_base_amt = l_maxtax.
264 367
265 if tr_type = "18"
266 then
267 assign
268 line-ctr = line-ctr + 1
269 line = line-ctr.
368 else if (l_maxtax > 0 )
369 and ( tax_base_amt < 0 )
370 and ((- tax_base_amt) > l_maxtax)
371 then
372 assign
373 ntax_amt = ntax_amt - (- tax_base_amt - l_maxtax)
374 tax_base_amt = - (l_maxtax).
270 375
271 if taxable
272 or (not vq-post
273 and not taxable)
376 /* CALCULATE */
377 taxes = tax_base_amt * (tx2_tax_pct / 100) * adj_factor.
378
379 /*NOTE: THE adj_factor VALUE IS USED TO ALLOW SPECIAL CASE CALCULATIONS
380 SUCH AS VAT DISCOUNT AT PAYMENT OR INVOICE ADJUSTMENTS. */
381
382 /* APPLY ROUNDING */
383 /* DETERMINE ROUNDING METHOD */
384 run gpcrnd (input-output taxes,input tax_round).
385
386 /* DERIVE OUTPUT VALUES */
387 /* FORCE TAX INCLUDED AMOUNTS TO MATCH TOTAL AMOUNT */
388 if tax_in and tx2_inv_disc = false and inv_disc <> 0
274 389 then do: then do:
390 tot_amt = start_tot.
391 if (taxes + ntax_amt + tax_base_amt <> tot_amt) then
392 tax_base_amt = tot_amt - taxes.
393 end. /* IF tax_in */
275 394
276 create temp_file.
277 assign
278 temp_nbr = nbr
279 temp_tax_code = tax_code
280 temp_tax_round = tax_round
281 temp_rndmthd = rndmthd
282 temp_tax_by_line = tax_by_line
283 temp_entity_exrate = temp_entity_exrate
284 temp_exrate = exrate
285 temp_tax_curr = amt_curr
286 temp_tax_in = tax_in
287 temp_trlr_code = trlr_code
288 temp_tax_line = tax_line
289 temp_adj_factor = adj_factor
290 temp_vq_exch_rate = vq-exch-rate
291 temp_vq_rndmthd = vq-rndmthd
292 temp_line = line
293 temp_divn_code = divn-code
294 temp_cmvd_addr = cmvd-addr
295 temp_cmvd_taxclass = cmvd-taxclass
296 temp_tax_date = tax_date
297 temp_posted_date = tax_post_date
298 temp_shipfrom_taxzone = shipfrom-taxzone
299 temp_shipto_taxzone = shipto-taxzone
300 temp_orderaccept_taxzone = orderaccept-taxzone
301 temp_shipfrom_incity = shipfrom-incity
302 temp_shipto_incity = shipto-incity
303 temp_orderaccept_incity = orderaccept-incity
304 temp_lineitem_qty = lineitem-qty
305 temp_taxc = taxc
306 temp_tax_type = tx2_tax_type
307 temp_tot_amt = tot_amt.
308
309 /* TO SATISFY ORACLE STANDARDS ... */
310 if recid(temp_file) = -1
311 then .
312
313 end. /* IF taxable OR (NOT vq-post ...) */
314
315 /* CALL VQTXCALC.P ONLY WHEN WE ARE PROCESSING THE LAST LINE, */
316 /* THE LAST TAX TYPE */
317 if (last-line and last-taxtype)
395 /* HANDLE AP Reverse & AR Absorbed Amounts */
396 /* ADD TRANSACTION TYPES FOR LOGISTICS CHARGES(40-48) */
397 ar_ap = lookup(tr_type,
398 "20,21,22,23,24,25,26,27,28,29,30,32,40,41,42,43,44,45,46,47,48,55") = 0.
399
400 if ar_ap and tx2_ara_use
401 then
402 adj_amt = - taxes.
403
404 else if not ar_ap
318 405 then do: then do:
319 {us/bbi/gprun.i ""vqtxcalc.p""
320 "(input company-code,
321 input entity,
322 input tr_type,
323 input ref,
324 input nbr,
325 input vq-post,
326 input first-taxtype)"}
327 /* WE ARE DONE. SO INITIALIZE THE VALUES BACK TO 'NO'. */
328 assign
329 last-line = no
330 last-taxtype = no.
331 end. /* IF last-line and last-taxtype ... */
332 406
333 end. /* IF AVAILABLE MFC_CTRL */
407 if tx2_apr_use then
408 adj_amt = - taxes.
409
410 if tx2_pct_recv <> 0
411 then do:
412 recoverable = (( taxes) * (tx2_pct_recv / 100)).
413 run gpcrnd (input-output recoverable,input tax_round).
414 end. /* IF tx2_pct_recv <> 0 */
415
416 end. /* ELSE IF NOT ar_ap */
417
418 end. /* IF tx2_tax_pct = 0 ELSE */
419
420 /* CONVERT FROM BASE TO FOREIGN CURRENCY */
421 PROCEDURE base_to_foreign:
422
423 define input-output parameter l_amt like tx2d_totamt no-undo.
424
425 {us/gp/gprunp.i "mcpl" "p" "mc-curr-conv"
426 "(input base_curr,
427 input amt_curr,
428 input exrate2,
429 input exrate,
430 input l_amt,
431 input true, /* ROUND */
432 output l_amt,
433 output l_mc_error_nbr)"}.
434
435 /* ERROR CHECK ROUND METHOD FOR base_curr */
436 if l_mc_error_nbr <> 0
437 then do:
438 {us/bbi/pxmsg.i &MSGNUM=l_mc_error_nbr &ERRORLEVEL=2}
439 end.
440
441 END PROCEDURE. /* PROCEDURE base_to_foreign */
File mfg/2013/base/src/xftxtots.p added (mode: 100644) (index 0000000..1dc8961)
1 /* xftxtots.p - CALCULATE TAX TOTAL AND TOTAL EXCLUDING TAX */
2 /* Copyright 1986-2009 QAD Inc., Carpinteria, CA, USA. */
3 /* All rights reserved worldwide. This is an unpublished work. */
4 /* Revision: eB3SP5 BY: Achint Lele DATE: 02/08/10 ECO: *eb3sp5* */
5 /* BGL LAST MODIFIED: 2016-May-31 BY: gbg *c1580* */
6 /*---------------------------------------------------------------------------*/
7 /*V8:ConvertMode=Report */
8
9 /* FOR A TRANSACTION, LINE, OR TRAILER, PROGRAM CALCULATES: */
10 /* . TOTAL TAX (INCLUDED & NOT INCLUDED IN PRICE) */
11 /* . TOTAL EXCLUDING ANY TAX. */
12 /* PARAMETERS */
13 /* I/O Name Like Description */
14 /* ----- ----------- --------------- ------------------------------ */
15 /* input tax_tr_type tx2d_tr_type Transaction Type Code */
16 /* input ref tx2d_ref Document Reference */
17 /* input nbr tx2d_nbr Number (Related Document) */
18 /* input line tx2d_line Line Number */
19 /* 0 for transaction totals */
20 /* 99999 for trailer totals */
21 /* input trl tx2d_trl Trailer Code */
22 /* null for transaction totals */
23 /* null for line totals */
24 /* output tot_tax tx2d_cur_tax_amt Total Tax */
25 /* output tot_ex_tax tx2d_totamt Transaction/Line/Trailer total */
26 /* excluding any tax */
27
28 {us/bbi/mfdeclre.i}
29
30 define input parameter tax_tr_type like tx2d_tr_type no-undo.
31 define input parameter ref like tx2d_ref no-undo.
32 define input parameter nbr like tx2d_nbr no-undo.
33 define input parameter line like tx2d_line no-undo.
34 define input parameter trl like tx2d_trl no-undo.
35 define output parameter tot_tax like tx2d_cur_tax_amt no-undo.
36 define output parameter tot_ex_tax like tx2d_totamt no-undo.
37
38 assign
39 tot_tax = 0
40 tot_ex_tax = 0.
41
42 for each tx2d_det no-lock
43 where tx2d_det.tx2d_domain = global_domain
44 and tx2d_ref = ref
45 and (tx2d_nbr = nbr or nbr = "")
46 and (tx2d_line = line or line = 0)
47 and (tx2d_trl = trl or (trl = "" and line <> 99999999))
48 and tx2d_tr_type = tax_tr_type :
49
50 if tx2d_tr_type = "25" /* PO RETURN */
51 then do :
52 assign
53 tot_ex_tax = tot_ex_tax -
54 (if tx2d_tottax = 0 then tx2d_totamt
55 else tx2d_tottax)
56 tot_tax = tot_tax - tx2d_cur_tax_amt.
57 end.
58 else do :
59 /* CALCULATE TRANSACTION/LINE/TRAILER TOTAL EXCLUDING ANY TAX. */
60 assign
61 tot_ex_tax =
62 /*c1580* tot_ex_tax + */
63 (if tx2d_tottax = 0 then tx2d_totamt
64 else tx2d_tottax).
65
66 /* CALCULATE TRANSACTION/LINE/TRAILER TAX TOTAL. */
67 assign tot_tax = tot_tax + tx2d_cur_tax_amt.
68 end.
69
70 /* AR ABSORBED AMOUNT DO NOT SHOW UP IN TOTAL */
71 if tx2d_tr_type >= "10"
72 and tx2d_tr_type <= "19"
73 then
74 assign tot_tax = tot_tax + tx2d_cur_abs_ret_amt.
75 end.
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/gbfg55/gbg-20-git

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/gbfg55/gbg-20-git

Clone this repository using git:
git clone git://git.rocketgit.com/user/gbfg55/gbg-20-git

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main