on 11-29-2013 3:49 AM
Hi,
In A/R Invoice they are using many tax codes. But now onwards they need to maintain only one type of tax code using in single A/R invoice. But end users are take multiple tax codes in one invoice. Is there any stored procedure to block this type of scenario. If they are using multiple tax code the A/R invoice should may rise one error ie., multiple tax code not accepted. Kindly provide stored procedure for this scenario.
Thanks & Regards,
Kishore.
Hi,
Try this
-- Block multi taxcode
declare @numvatgroup int
IF (@object_type='13') and (@transaction_type='A' )
BEGIN
set @numvatgroup=(SELECT COUNT( DISTINCT VATGROUP) FROM INV1 WHERE dbo.INV1.DocEntry = @list_of_cols_val_tab_del );
if @numvatgroup >1
BEGIN
SELECT @Error = 1, @error_message = 'Multi Taxcode not accepted .'
END
END
Hope this helps,
TVSon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
Try this:
if @object_type = '13' and (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')
begin
If exists(SELECT T0.[DocNum] FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode WHERE T1.[VatGroup] <> T2.[ECVatGroup]
where t0.docentry = @list_of_cols_val_tab_del )
begin
select @error = 1, @error_message = 'Multi tax code not allowed '
end
end
Thanks & Regards,
Nagarajan
Hi,
Try this which tested
-- block multi taxcode
declare @numvatgroup int
IF (@object_type='13') and (@transaction_type='A' )
BEGIN
set @numvatgroup=(SELECT COUNT( DISTINCT T1.VATGROUP) FROM INV1 T1 WHERE T1.DocEntry = @list_of_cols_val_tab_del );
if @numvatgroup >1
BEGIN
SELECT @Error = 1, @error_message = 'Multi Taxcode is not accepted'
END
END
Regards,
TVSon
Hi Ravi,
You can use SP_ Transaction Notification in Stored Procedures.
GBU
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.