web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Stored procedure taSopLineIvcInsert truncating decimals

(0) ShareShare
ReportReport
Posted on by

Hi all,

we're using the stored procedure taSopLineIvcInsert (via RapidiOnline's integration tool to make Salesforce and GP work together). Due to business requirements we need invoices originating outside of GP to be synced into GP (and the resulting payments also surfaced back into SF).

The SQL transaction trace details from taSopLineIvcInsert look like this:

declare @p1 int

set @p1=0

declare @p3 int

set @p3=20484

declare @p4 int

set @p4=8200

declare @p5 int

set @p5=0

declare @p7 int

set @p7=722

declare @p28 int

set @p28=722

declare @p29 varchar(255)

set @p29='722                                                                                                                                                                                                                                                            '

exec sp_cursoropen @p1 output,N' EXEC @P1=taSopLineIvcInsert @P2,@P3,@P4,@P5,DEFAULT,DEFAULT,@P6,@P7,@P8,@P9,@P10,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,@P11,@P12,@P13,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,@P14,DEFAULT,DEFAULT,@P15,@P16,@P17,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,@P18,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,@P19,@P20,DEFAULT,@P21,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,@P22 OUTPUT,@P23 OUTPUT  ',@p3 output,@p4 output,@p5 output,N'@P1 int OUTPUT,@P2 smallint,@P3 varchar(21),@P4 varchar(15),@P5 smalldatetime,@P6 varchar(30),@P7 smallint,@P8 numeric(30,0),@P9 numeric(30,0),@P10 numeric(30,0),@P11 varchar(10),@P12 varchar(100),@P13 numeric(30,0),@P14 varchar(15),@P15 varchar(15),@P16 smallint,@P17 varchar(15),@P18 smallint,@P19 varchar(15),@P20 varchar(8),@P21 tinyint,@P22 int OUTPUT,@P23 varchar(255) OUTPUT',@p7 output,3,'SVC0000002','CZ000001047','2016-01-07 00:00:00','E-COZEROERN-OP-C00000143',1,21,2159,101,'DEFAULT','Off-Peak Energy Consumed - NSW',215,'INVOICE','S-GSTTS',1,'S-GSTTS',1,'AUD','QTY',0,@p28 output,@p29 output

select @p1, @p3, @p4, @p5, @p7, @p28, @p29

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Stored procedure taSopLineIvcInsert truncating decimals

    Mapping the above I believe yields:

    msdn.microsoft.com/.../ff623968.aspx

    ELEMENT NAME | VALUE

    SOPTYPE 3

    SOPNUMBE 'SVC0000002'

    CUSTNMBR 'CZ000001047'

    DOCDATE '2016-01-07 00:00:00'

    ITEMNMBR 'E-COZEROERN-OP-C00000143'

    AutoAssignBin 1

    UNITPRCE 21

    XTNDPRCE 2159

    QUANTITY 101

    PRCLEVEL 'DEFAULT'

    ITEMDESC 'Off-Peak Energy Consumed - NSW'

    TAXAMNT 215

    DOCID 'INVOICE'

    ITMTSHID 'S-GSTTS'

    IVITMTXB 1

    TAXSCHID 'S-GSTTS'

    UpdateIfExists 1

    CURNCYID 'AUD'

    UOFM 'QTY'

    CKCreditLimit 0

    The values that should be in there for UNITPRCE, XTNDRCE,QUANTITY and TAXAMNT should have decimals and be:

    UNITPRCE 21.34

    QUANTITY 101.20210

    XTNDPRCE 2159.65

    TAXAMNT 215.97

    Looking at the trace shows that the values are being truncated as they are being set as NUMERIC(30,0) when they should be NUMERIC(19,5) if my reading of most stored procedures for eConnect is to be correct? So is the problem that my particular stored procedure is not correct? Is there a way to view the stored procedures as they are set?

  • Suggested answer
    Josh P Profile Picture
    2,895 on at
    RE: Stored procedure taSopLineIvcInsert truncating decimals

    It looks like your output parameter declarations are truncating the values.

    [@P8 numeric(30,0),@P9 numeric(30,0),@P10 numeric(30,0)]

    I would start by setting your output parameters to match the GP parameter data types, and see what you get.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans