Microsoft Windows Java ISDN Information

Computer Software Management Products

 RSS  feed      Home      
Web software.dovada.net.au

Powerful New Keyword Software
Keyword Elite - Powerful New Keyword Software Gave Me The Exact
Keywords To Earn An Extra $8,265 From Google Adwords.

SEO Elite marketing software - Norton Anti Virus - Create easy web video - Great software downloads - Music Movies Games Software


Share |


You are free to use content from this page in your blog or website, in return for a link back to this page from that blog or website.



Great Plains Customization ' Programming Auto-apply in Accounts Receivable


Microsoft Great Plains is one of three Microsoft Business Solutions mid-market ERP products: Great Plains, Solomon, Navision. Considering that Great Plains is now very good candidate for integration with POS application, such as Microsoft Retail Management System or RMS and Client Relation Systems, such as Microsoft CRM ' there is common need in Great Plains customizations and integrations, especially on the level of MS SQL Server transact SQL queries and stored procedures.

In this small article we'll show you how to create auto-apply utility, when you integrate huge number of sales transactions and payments. We will be working with RM20101 ' Receivables Open File and RM20201 ' Receivables Apply Open File.

Let's see SQL code:

declare @curpmtamt numeric(19,5)

declare @curinvamt numeric(19,5)

declare @curpmtnum varchar(20)

declare @curinvnum varchar(20)

declare @curinvtype int

declare @curpmttype int

declare @maxid int

declare @counter int

-- Create a temporary table

create table #temp

(

[ID] int identity(1,1) primary key,

CUSTNMBR varchar(15),

INVNUM varchar(20),

INVTYPE int,

PMTNUM varchar(20),

PMTTYPE int,

INVAMT numeric(19,5),

PMTAMT numeric(19,5),

AMTAPPLIED numeric(19,5)

)

create index IDX_INVNUM on #temp (INVNUM)

create index IDX_PMTNUM on #temp (PMTNUM)

-- Insert unapplied invoices and payments

insert into #temp

(

CUSTNMBR,

INVNUM,

INVTYPE,

PMTNUM,

PMTTYPE,

INVAMT,

PMTAMT,

AMTAPPLIED

)

select

CUSTNMBR = a.CUSTNMBR,

INVNUM = b.DOCNUMBR,

INVTYPE = b.RMDTYPAL,

PMTNUM = a.DOCNUMBR,

PMTTYPE = a.RMDTYPAL,

INVAMT = b.CURTRXAM,

PMTAMT = a.CURTRXAM,

AMTAPPLIED = 0

from RM20101 a

join RM20101 b on (a.CUSTNMBR = b.CUSTNMBR)

join RM00101 c on (a.CUSTNMBR = c.CUSTNMBR)

where

a.RMDTYPAL in (7, 8, 9) and

b.RMDTYPAL in (1, 3) and

a.CURTRXAM 0 and

b.CURTRXAM 0

order by

a.custnmbr,

b.DOCDATE,

a.DOCDATE,

a.DOCNUMBR,

b.DOCNUMBR

-- Iterate through each record

select @maxid = max([ID])

from #temp

select @counter = 1

while @counter = @curpmtamt) and (@curpmtamt>0) and (@curinvamt>0)-- if the invoice amount is greater or the same as the payment amount

begin

select @curinvamt = @curinvamt - @curpmtamt -- invoice amount remaining

-- update with the amount that is applied to the current invoice from

-- the current payment

update #temp

set

AMTAPPLIED = @curpmtamt

where

[ID] = @counter

-- update with amount of invoice remaining

update #temp

set

INVAMT = @curinvamt

where

INVNUM = @curinvnum and

INVTYPE = @curinvtype

-- update with amount of payment remaining

update #temp

set

PMTAMT = 0

where

PMTNUM = @curpmtnum and

PMTTYPE = @curpmttype

end

else if (@curinvamt 0) and (@curinvamt>0)-- if the invoice amount is lesser to the payment amount

begin

select @curpmtamt = @curpmtamt - @curinvamt -- payment amount remaining

-- update with the amount that is applied to the current invoice from

-- the current payment

update #temp

set

AMTAPPLIED = @curinvamt

where

[ID] = @counter

-- update with amount of invoice remaining

update #temp

set

INVAMT = 0

where

INVNUM = @curinvnum and

INVTYPE = @curinvtype

-- update with amount of payment remaining

update #temp

set

PMTAMT = @curpmtamt

where

PMTNUM = @curpmtnum and

PMTTYPE = @curpmttype

end

-- go to the next record

select @counter = @counter + 1

end

-- update the RM Open table with the correct amounts

update

RM20101

set

CURTRXAM = b.INVAMT

from

RM20101 a

join #temp b on (a.DOCNUMBR = b.INVNUM and a.RMDTYPAL = b.INVTYPE)

update

RM20101

set

CURTRXAM = b.PMTAMT

from

RM20101 a

join #temp b on (a.DOCNUMBR = b.PMTNUM and a.RMDTYPAL = b.PMTTYPE)

-- create the RM Apply record or update if records already exist

update

RM20201

set

DATE1 = convert(varchar(10), getdate(), 101),

GLPOSTDT = convert(varchar(10), getdate(), 101),

APPTOAMT = APPTOAMT + a.AMTAPPLIED,

ORAPTOAM = ORAPTOAM + a.AMTAPPLIED,

APFRMAPLYAMT = APFRMAPLYAMT + a.AMTAPPLIED,

ActualApplyToAmount = APFRMAPLYAMT + a.AMTAPPLIED

from

#temp a

join RM20101 b on (b.DOCNUMBR = a.INVNUM and b.RMDTYPAL = a.INVTYPE)

join RM20101 c on (c.DOCNUMBR = a.PMTNUM and c.RMDTYPAL = a.PMTTYPE)

join RM20201 d on (d.APFRDCTY = a.PMTTYPE and

d.APFRDCNM = a.PMTNUM and

d.APTODCTY = a.INVTYPE and

d.APTODCNM = a.INVNUM)

where

a.AMTAPPLIED 0

insert into RM20201

(CUSTNMBR,

DATE1,

GLPOSTDT,

POSTED,

APTODCNM,

APTODCTY,

APTODCDT,

ApplyToGLPostDate,

CURNCYID,

CURRNIDX,

APPTOAMT,

ORAPTOAM,

APFRDCNM,

APFRDCTY,

APFRDCDT,

ApplyFromGLPostDate,

FROMCURR,

APFRMAPLYAMT,

ActualApplyToAmount)

select

CUSTNMBR = a.CUSTNMBR,

DATE1 = convert(varchar(10), getdate(), 101),

GLPOSTDT = convert(varchar(10), getdate(), 101),

POSTED = 1,

APTODCNM = a.INVNUM,

APTODCTY = a.INVTYPE,

APTODCDT = b.DOCDATE,

ApplyToGLPostDate = b.GLPOSTDT,

CURNCYID = b.CURNCYID,

CURRNIDX = '',

APPTOAMT = a.AMTAPPLIED,

ORAPTOAM = a.AMTAPPLIED,

APFRDCNM = a.PMTNUM,

APFRDCTY = a.PMTTYPE,

APFRDCDT = c.DOCDATE,

ApplyFromGLPostDate = c.GLPOSTDT,

FROMCURR = c.CURNCYID,

APFRMAPLYAMT = a.AMTAPPLIED,

ActualApplyToAmount = a.AMTAPPLIED

from

#temp a

join RM20101 b on (b.DOCNUMBR = a.INVNUM and b.RMDTYPAL = a.INVTYPE)

join RM20101 c on (c.DOCNUMBR = a.PMTNUM and c.RMDTYPAL = a.PMTTYPE)

where

a.AMTAPPLIED 0 and

not exists (select 1

from RM20201 d

where d.APFRDCTY = a.PMTTYPE and

d.APFRDCNM = a.PMTNUM and

d.APTODCTY = a.INVTYPE and

d.APTODCNM = a.INVNUM)

drop table #temp

About The Author

Andrew Karasev is Chief Technology Officer in Alba Spectrum Technologies ' USA nationwide Great Plains, Microsoft CRM customization company, with offices in Chicago, San Francisco, Los Angeles, San Diego, Phoenix, Houston, Miami, Atlanta, New York, Madrid, Brazil, Moscow ( http://www.albaspectrum.com), you can reach Andrew 1-866-528-0577, he is Dexterity, SQL, C#.Net, Crystal Reports and Microsoft CRM SDK developer; akarasev@albaspectrum.com


Cat 18793


The Sims 2 Double Deluxe: 3 Great Games in one.
ebay image$10.99 (0 Bids)
End Date: Thursday Feb-9-2012 8:14:29 PST
Buy It Now for only: $20.99
Buy It Now | Bid now | Add to watch list

Fat Cat Forex Scalper - Manual Trading System - Works Great
ebay image$7.99
End Date: Saturday Mar-3-2012 21:01:51 PST
Buy It Now for only: $7.99
Buy It Now | Add to watch list

Webroot SecureAnywhere Complete 2012, 3 users, Retail box,Great AntiVirus
ebay image$39.99 (1 Bid)
End Date: Thursday Feb-9-2012 8:54:37 PST
Bid now | Add to watch list

NEW Finale PrintMusic Print MAC/WIN MakeMusic PHR11 -Great Notation Software
ebay image$84.99
End Date: Sunday Feb-19-2012 11:03:52 PST
Buy It Now for only: $84.99
Buy It Now | Add to watch list

CARMEN SANDIEGO'S GREAT CHASE THROUGH TIME CD Ages 8-12
ebay image$7.95 (0 Bids)
End Date: Thursday Feb-9-2012 10:39:41 PST
Buy It Now for only: $12.50
Buy It Now | Bid now | Add to watch list

Great New like condition! Fun and Kids love It!!
ebay image$5.00 (0 Bids)
End Date: Thursday Feb-9-2012 12:41:40 PST
Bid now | Add to watch list

GREAT NAVAL BATTLES I +1Click XP Vista Win 7 Install
ebay image$29.95
End Date: Wednesday Mar-7-2012 7:16:12 PST
Buy It Now for only: $29.95
Buy It Now | Add to watch list

NASA Exploring Aeronautics CD-ROM for students BRAND NEW great for kids, schools
ebay image$3.49 (0 Bids)
End Date: Thursday Feb-9-2012 14:04:26 PST
Buy It Now for only: $7.99
Buy It Now | Bid now | Add to watch list

Video Tutorials to make Learning C++ programming Easy-PC-DVD
ebay image$16.99
End Date: Wednesday Mar-7-2012 17:47:50 PST
Buy It Now for only: $16.99
Buy It Now | Add to watch list

IVR SMS VoiceXML Telephony Programming API w/ Voicent Gateway SDK [FREE TRIAL]
ebay image$0.01 (0 Bids)
End Date: Thursday Feb-9-2012 14:14:37 PST
Bid now | Add to watch list

AVERY DESIGN PRO 2004~SIGN &LABEL CREATION~GREAT SOFTWARE~L@@K~BUY LOW PRICE~WOW
ebay image$7.77 (0 Bids)
End Date: Thursday Feb-9-2012 14:33:10 PST
Buy It Now for only: $17.77
Buy It Now | Bid now | Add to watch list

JAVA PROGRAMMING CBTs Video Training Tutorials 9+ Hours
ebay image$2.95
End Date: Sunday Feb-26-2012 19:17:17 PST
Buy It Now for only: $2.95
Buy It Now | Add to watch list

LIVE PIX PHOTO EDITING SOFTWARE~GREAT FOR PRODUCTION & PICTURES~NO RESERVE-L@@K
ebay image$7.77 (0 Bids)
End Date: Thursday Feb-9-2012 14:34:14 PST
Buy It Now for only: $47.77
Buy It Now | Bid now | Add to watch list

AVG AntiVirus 2012 1 PC 1 Year Commercial License Great Value
ebay image$9.99
End Date: Saturday Mar-3-2012 12:13:50 PST
Buy It Now for only: $9.99
Buy It Now | Add to watch list

PRINT ARTIST PLATINUM~BRAND NEW IN SEALED PACK~NO RESRV~SELL AT GREAT PRICE!L@@K
ebay image$7.77 (0 Bids)
End Date: Thursday Feb-9-2012 15:02:37 PST
Buy It Now for only: $17.77
Buy It Now | Bid now | Add to watch list

Resumes & Cover Letters for Dummies Software Fast S & H Low S & H Great Help A+
ebay image$1.99 (0 Bids)
End Date: Thursday Feb-9-2012 19:30:07 PST
Buy It Now for only: $2.99
Buy It Now | Bid now | Add to watch list

PC/DVD - BIG BUNDLE DIESEL PACK 7 GREAT GAMES - 18 Wheels of Steel, Drive Green
ebay image$11.52
End Date: Thursday Feb-23-2012 12:37:13 PST
Buy It Now for only: $11.52
Buy It Now | Add to watch list

Great Invasions: The Dark Ages 350-1066ad PC-CD - NEW in BOX
ebay image$9.98 (0 Bids)
End Date: Friday Feb-10-2012 4:29:20 PST
Buy It Now for only: $11.98
Buy It Now | Bid now | Add to watch list

Maurice Ashley Teaches Chess -Ages 6+ great learning CD, Win-XP/Vista/7 (32-bit)
ebay image$3.69
End Date: Wednesday Feb-22-2012 13:52:58 PST
Buy It Now for only: $3.69
Buy It Now | Add to watch list

Great Invasions: The Dark Ages 350-1066ad PC-CD - NEW in BOX
ebay image$9.98 (0 Bids)
End Date: Friday Feb-10-2012 4:44:36 PST
Buy It Now for only: $11.98
Buy It Now | Bid now | Add to watch list

STEVEN SPIELBERG'S DIRECTOR'S CHAIR - PC COMPUTER GAME CD-ROM - Great Condition!
ebay image$14.00 (0 Bids)
End Date: Friday Feb-10-2012 4:46:40 PST
Buy It Now for only: $25.00
Buy It Now | Bid now | Add to watch list

NERO 10 Multimedia Suite PLATINUM HD Editing PC NEW Factory Sealed Great Gift!
ebay image$49.95
End Date: Saturday Mar-3-2012 7:47:15 PST
Buy It Now for only: $49.95
Buy It Now | Add to watch list

Great Invasions: The Dark Ages 350-1066ad PC-CD - NEW in BOX
ebay image$9.98 (0 Bids)
End Date: Friday Feb-10-2012 4:59:10 PST
Buy It Now for only: $11.98
Buy It Now | Bid now | Add to watch list

Suturing Techniques & Suture Types Training Video Skills DVD -great for MD RN PA
ebay image$9.50
End Date: Saturday Feb-11-2012 14:35:28 PST
Buy It Now for only: $9.50
Buy It Now | Add to watch list

Great Invasions: The Dark Ages 350-1066ad PC-CD - NEW in BOX
ebay image$9.98 (0 Bids)
End Date: Friday Feb-10-2012 5:15:16 PST
Buy It Now for only: $11.98
Buy It Now | Bid now | Add to watch list

Great Invasions: The Dark Ages 350-1066ad PC-CD - NEW in BOX
ebay image$9.98 (0 Bids)
End Date: Friday Feb-10-2012 5:30:27 PST
Buy It Now for only: $11.98
Buy It Now | Bid now | Add to watch list

Forex trading software = 30 pips Indicator=Scalping 1 MIN=great ind for scalpers
ebay image$16.90
End Date: Tuesday Feb-28-2012 9:59:44 PST
Buy It Now for only: $16.90
Buy It Now | Add to watch list

Discover Great Britain PC-CD-ROM Win95-XP - NEW in JC
ebay image$7.98 (0 Bids)
End Date: Friday Feb-10-2012 5:31:29 PST
Buy It Now for only: $9.98
Buy It Now | Bid now | Add to watch list

History Great Battles Medieval XBOX 360 *NEW*
ebay image$39.99
End Date: Thursday Feb-9-2012 18:26:47 PST
Buy It Now for only: $39.99
Buy It Now | Add to watch list

Home Business Plan

Peel Away Ads Marketing And Advertising without Pop-Ups, Fly-Ins or Pop-Unders
home | Software site map | custom google search | Software articles | Privacy policy
Copyright © 2009 www.dovada.net.au