Archives

 

In some cases, the RadCheckbox will present with this weird 'doubled' effect

 

This article will detail how to rebuild the Dynamics GP UPR00900 table, and discuss some of the fields. I added to the table definition for UPR00900, also.

http://dyndeveloper.com/DynColumn.aspx?TableName=UPR00900

Okay here's my task - in our business every (98%) sales invoice and sales return have 7 line items.

I want to write a query that pivots the line items into columns.

Sounds simple right? Well in our case some transactions are created by manual entry and some (most) by API.

The Transactions created manually have line sequence in the GP increments of 16384, 32768, etc. The Transactions created by the API actually have Line Item Sequences as 1,2,3,4 etc. The API doesn't conform with 16384, etc. 

Here's what I got so far - 

 

Select * From

(select A.CUSTNMBR, A.SOPNUMBE, CAST(A.DOCDATE as date) DocDate, DOCAMNT as DocAmnt,  
B.ITEMDESC,
B.LNITMSEQ 
from SOP30200 A
left outer join SOP30300 B
ON
A.SOPNUMBE=B.SOPNUMBE and A.SOPTYPE=B.SOPTYPE) as SRC
PIVOT
(  MAX (ITEMDESC) for LNITMSEQ in ([16368] , [32768])
) as PVT

My problem - I'm specifying specific Line Item Sequence Numbers - is there an alternative way in SQL to simply specify the first 7 rows in the SOP30300 table as columns?

Row Number(?) instead of PVT? 

Thanks in advance 

 

General - if you were me what would you do type question.

I am integrating transactional data from external software into GP Plains using Smart Connect. 

The external system is going to create an csv file and upload to a SFTP site every two hours. 

Current process - Smart Connect will download the file - upload the data into a SQL staging data - a SQL stored procedure runs and manipulates the data and validates the data.

Smart Connect connects to the staging table - integrates into GP.

External system is an AR module where our customers use a payment portal to pay invoices - apply credits to invoices etc.

I am currently thinking that I want to create a Historical Staging Table for purposes of storing all the data we integrate from the external system into Great Plains and I would create a SQL job that simply empties the staging table each night.

My question is - If you were responsible for this project design would you include a historical SQL table that has all transactions ever integrated or would you just clear the staging table before each integration or end of day or such? 

We expect 80-100 credit card eCheck type transactions each day.

I appreciate any and all opinions - my current opinion would be to include a historical table in the process. 

Note - The staging table does have a column 'IntegratedGP' integer which indicates the transaction has been integrated - so theoretically the staging table could also be allowed to simply grow with all transactions and the IntegratedGP column be used to indicate historical records. Not certain if that's an alternative better than a separate table. 

 

Okay -

Background external software will be giving me data which I have to manipulate in order to integrate into GP.

Here's some sample data - 

Create Table Demo 
(
transaction_code varchar (30),
payment_date date,
payment_type varchar (30),
cust_id varchar (30),
currency varchar (10),
payment_amount float,
invoices varchar (30),
external_id varchar (30),
applied_amount float,
discount_taken float
)


Insert Demo
Values
('TEST12356','2024-04-11','CREDITCARD','ACME001','USD','1500.00','INV001','YAYPAY500','1000.00','0');


Insert Demo
Values
('TEST12356','2024-04-11','CREDITCARD','ACME001','USD','1500.00','INV002','YAYPAY500','1000.00','0');


Insert Demo
Values
('TEST12356','2024-04-11','CREDITCARD','ACME001','USD','1500.00','CREDIT001','YAYPAY500','-500.00','0');

Basically - the data says this - we are settling 2 Invoices (paying off) that total 2000.00 with a credit card payment of 1500 and a credit document worth 500.

The external app will always send me data that I have to figure out how to apply the credit and settle the Invoices. 

I need to take this data: 

And change the line with the credit to include an Invoice Document Number and applied amount. I played around with both a Pivot and a LAG (first time trying it). The math is straight forward - for each transaction code the payment amount (1500) will add up to the sum of applied_amount. I will never have more than 3 documents to apply to - I'm kind of stuck on where to start. 

What populates CURRNIDX on SOP10105 table?

Client has MC registered for USD (only currency in use).

Currency ID = 'USD'

CURRNIDX  = '1008'

Client is working with k-commerce integration which pulls transaction currency ID from CURRNIDX on the SOP10105 table. K-commerce integration is failing as a result of CURRNIDX showing value of 0.  Below set of queries and screenshot of results follow a sample transaction and respective setup tables that displays the issue nicely. 

Note 1: Some transactions have the correct CURRNIDX value of '1008'. 

Note 2: client uses Avalara Avatax for tax calculation

SELECT * FROM MC40000
SELECT CURNCYID, * from RM00201
SELECT CURNCYID, * FROM RM00101 WHERE CUSTNMBR = '105626'
SELECT CURRNIDX,  * FROM SOP10105 WHERE SOPNUMBE = 'INV142564'
SELECT CURRNIDX, CUSTNMBR, * FROM SOP30200 WHERE SOPNUMBE = 'INV142564'
SELECT CURRNIDX, CUSTNMBR, * FROM SOP30200 WHERE SOPNUMBE = 'ORD132066'

 

 

Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3