|
|
|
Re: Coupan calculation in pos [message #679884 is a reply to message #679883] |
Thu, 09 April 2020 09:18   |
 |
Amjad_1975
Messages: 82 Registered: January 2017
|
Member |
|
|
no sir this not a full code Code are as below
I have a 3 blocks 1 is control which r havinf trigger
key-next-item-----which r working with barcode scanner
2nd block master 3rd transaction
everythingis working fine except coupan
trigger key-next-item
block
control.A
DECLARE
l_match boolean:=false;
l_continue boolean:=true;
VV varchar2(30);
aa number(8);
bb varchar2(15);
cc varchar2(8);
dd varchar2(8);
a number;
b number;
vn number;
EE NUMBER;
ff number;
BEGIN
BEGIN
SELECT stk_code INTO :control.a FROM add_item
WHERE add_item.stk_code=:control.a;
EXCEPTION
WHEN NO_DATA_FOUND THEN
MESSAGE('Item code does not Excist');
MESSAGE('Item code does not Excist');
CLEAR_ITEM;
RAISE FORM_TRIGGER_FAILURE;
END;
go_block('itrn_bar');
FIRST_rECORD;
WHILE l_continue and not l_match LOOP
select c_date
into
vv from add_item where stk_code = :control.a;
if to_char(sysdate,'mon-dd-yyyy hh:mi:ss')>=vv then
message('!!! Coupan is Expired '|| vv);
message('!!! Coupan is Expired '|| vv);
go_block('control');
end if;
IF :itrn_bar.item_Code=:CONTROL.a THEN
:itrn_bar.qty:=:itrn_bar.qty+1;
:itrn_bar.t_cost:=:itrn_bar.qty*:itrn_bar.unt_price;
L_MATCH:=TRUE;
ELSE
if :system.last_record!='TRUE' THEN
NEXT_RECORD;
ELSE
L_CONTINUE:=FALSE;
END IF;
END IF;
END LOOP;
next_RECORD;
IF NOT L_MATCH THEN
select stk_code,description,qty,itm_dis,itm_tax,c_dis,unt_prc,ad_level2,op_typ,cust_no into
:itrn_bar.item_Code,
:itrn_bar.item_name,
:itrn_bar.qty,
:itrn_bar.dis_prc,
:itrn_bar.tax,
:itrn_bar.c_prc,
aa,
bb,
cc,
dd
from add_item,CLIENT
where stk_code=:control.a and
CLIENT.cust_no=:imaster_bar.p_code;
if cc='level2' then
:itrn_bar.unt_price:=bb;
else
:itrn_bar.unt_price:=aa;
end if;
:itrn_bar.t_cost:=:itrn_bar.qty*:itrn_bar.unt_price;
:coupan_amt:=:ITRN_BAR.TCOST_TOTAL/100*:itrn_bar.c_prc;
END IF;
go_block('control');
go_item('control.a');
clear_block;
END;
sir sorry for not manipulating the code
My problem is this I want to calculate coupan disc
from TCOST_TOTAL it's working but only when I go to
Same code suppose Coupan code if I moved to any other code for entry like icode 2 or 3 etc so coup_disc is becoming null my code is
in master table fields
date
p_code
name
in transaction
item_code
description
qty
unit price
coupan_dis---c_prc
-------------------
grand total---tcost_total
coupan amount----coupan_amt
thanks
[Updated on: Thu, 09 April 2020 09:25] Report message to a moderator
|
|
|
|
|
Re: Coupan calculation in pos [message #679889 is a reply to message #679888] |
Thu, 09 April 2020 11:42   |
 |
Amjad_1975
Messages: 82 Registered: January 2017
|
Member |
|
|
Sir above little mistake actually coupan code having no
Unit price but still same issue whenever coupan code has come discount should be directly calculate from Grand total only
As mentioned my above code
Item_code desc. Qty. Unt_prc. C_disc Total
1. ABC. 1. 200. 200
C002. 10% disc. 1. 0. 10. 0
2. Device. 2. 150. 300
3. Etc 1. 50. 50
g_tot 230+50=270
C_disc 3 should be 27
Thanks
[Updated on: Thu, 09 April 2020 11:42] Report message to a moderator
|
|
|
|
|
|
|
Re: Coupan calculation in pos [message #679931 is a reply to message #679930] |
Tue, 14 April 2020 04:27   |
 |
Amjad_1975
Messages: 82 Registered: January 2017
|
Member |
|
|
Sir this simple code
DECLARE
l_match boolean:=false;
l_continue boolean:=true;
VV DATE;
BEGIN
go_block('itrn_bar');
FIRST_rECORD;
WHILE l_continue and not l_match LOOP
IF :itrn_bar.item_Code=:CONTROL.a THEN
:itrn_bar.qty:=:itrn_bar.qty+1;
L_MATCH:=TRUE;
ELSE
if :system.last_record!='TRUE' THEN
NEXT_RECORD;
ELSE
L_CONTINUE:=FALSE;
END IF;
END IF;
END LOOP;
next_RECORD;
IF NOT L_MATCH THEN
--:EMP.cc =:CONTROL.zz then
select stk_code,description,qty,unt_prc,C_DIS into
:itrn_bar.item_Code,
:itrn_bar.item_name,
:itrn_bar.qty,
:itrn_bar.unt_price,
:itrn_bar.C_prc
from add_item
where stk_code=:control.a
:itrn_bar.total:=:itrn_bar.qty*:itrn_bar.unt_price;
END IF;
if :itrn_bar.item_code!=:control.a OR L_MATCH=TRUE then
previous_record;
end if;
go_item('control.a');
clear_block;
END;
At coupan discount field formula
:itrn_bar.G_tot/100*:itrn_bar.c_prc;
Thanks
[Updated on: Tue, 14 April 2020 04:28] Report message to a moderator
|
|
|
|
Re: Coupan calculation in pos [message #679933 is a reply to message #679932] |
Tue, 14 April 2020 05:29   |
 |
Amjad_1975
Messages: 82 Registered: January 2017
|
Member |
|
|
Grant total is in transaction block
Sir control block having only field named A ----key-next-item
Others all fields are in transaction block
I have only 2 blocks
Control block having only field name a
Imaster_bar --- master block
Date
Party code
Party name
Itrn_bar -- transaction block
Fields
Item_code
Desc
Qty
Unit price
C_disc
Total
Grant total
Coupan discount
Net total
[Updated on: Tue, 14 April 2020 05:30] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Coupan calculation in pos [message #679992 is a reply to message #679989] |
Thu, 16 April 2020 11:35   |
 |
Amjad_1975
Messages: 82 Registered: January 2017
|
Member |
|
|
There are total 5 blocks
Control block
Which r containing item A where m firing a trigger key-next code as above
Imaster_bar---master block
Itrn_bar----child
Button block containing only buttons
Block42 only buttons
G_tot as Grand total. Summarized
Am_paid as coupan amount
Net_tot. As net total
Sir that's why m asking questions because m wrong somewhere
If I put all these 3 coloums in itrn_bar block may be m wrong kindly correct me where m wrong n kindly solved this issue I saw on this forum you r one of the genius person there is no doubt about this.
Thanks
[Updated on: Thu, 16 April 2020 11:38] Report message to a moderator
|
|
|
|
Re: Coupan calculation in pos [message #679994 is a reply to message #679993] |
Thu, 16 April 2020 13:28   |
 |
Amjad_1975
Messages: 82 Registered: January 2017
|
Member |
|
|
Mr @cadot you r always useless person on this forum I red all threads you are always disgraceful person you r never able to answers of any question you r not eligible person for this forum join any circus that will be better for u always I don't know why you r interfering in this matter if you r not able answer.
This forum for all anybody can questions here and answers
[Updated on: Thu, 16 April 2020 13:31] Report message to a moderator
|
|
|
|
|
|
|
|
|