tag:blogger.com,1999:blog-5285970135510371565.post6947131997972361446..comments2024-03-23T07:53:50.523-04:00Comments on The Dynamics GP Blogster: How to setup "No payments, no interests until June 1, 2009" payment term in Microsoft Dynamics GPMariano Gomezhttp://www.blogger.com/profile/13267738662239812289noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-5285970135510371565.post-29607960874003157922009-01-28T10:56:00.000-05:002009-01-28T10:56:00.000-05:00Greg,Thanks for your inquiry. I would believe that...Greg,<BR/><BR/>Thanks for your inquiry. I would believe that you could create an alternate table that will hold configuration information for "special" payment terms. Then you could setup all these "special" payment terms in GP as I indicated in the article, but change the trigger to join with the alternate table to retrieve the correct data.<BR/><BR/>For example:<BR/><BR/>/* Created by Mariano Gomez, MVP Code is delivered "AS IS". No warranties expressed or implied*/ <BR/>IF OBJECT_ID('dbo.rmSpecialPayments') IS NOT NULL<BR/> DROP TABLE dbo.rmSpecialPayments<BR/>GO<BR/>CREATE TABLE dbo.rmSpecialPayments(<BR/> PaymentTerm varchar(20) PRIMARY KEY,<BR/> DueDate datetime NOT NULL,<BR/> ApplyFrom datetime NOT NULL,<BR/> ApplyTo datetime NOT NULL,<BR/> DEX_ROW_ID int IDENTITY(1,1) NOT NULL,<BR/><BR/>)<BR/>GO<BR/><BR/>ALTER TABLE dbo.rmSpecialPayments WITH CHECK ADD CHECK ((datepart(hour,[DueDate])=(0) AND datepart(minute,[DueDate])=(0) AND datepart(second,[DueDate])=(0) AND datepart(millisecond,[DueDate])=(0)))<BR/>GO<BR/><BR/>ALTER TABLE dbo.rmSpecialPayments WITH CHECK ADD CHECK ((datepart(hour,[ApplyFrom])=(0) AND datepart(minute,ApplyFrom)=(0) AND datepart(second,[ApplyFrom])=(0) AND datepart(millisecond,[ApplyFrom])=(0)))<BR/>GO<BR/> <BR/>ALTER TABLE dbo.rmSpecialPayments WITH CHECK ADD CHECK ((datepart(hour,[ApplyTo])=(0) AND datepart(minute, ApplyTo)=(0) AND datepart(second,[ApplyTo])=(0) AND datepart(millisecond,[ApplyTo])=(0)))<BR/>GO<BR/><BR/>GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.rmSpecialPayments TO DYNGRP<BR/>GO<BR/><BR/>INSERT rmSpecialPayments(PaymentTerm, DueDate, ApplyFrom, ApplyTo)<BR/>VALUES ('JUN012009', '20090601', '20081201', '20081231')<BR/>GO<BR/><BR/>CREATE TRIGGER dbo.trPaymentTerm ON dbo.RM20101 AFTER INSERT<BR/>AS <BR/>BEGIN TRAN <BR/><BR/> UPDATE A WITH (ROWLOCK) SET A.DUEDATE = B.DUEDATE <BR/> FROM dbo.RM20101 A <BR/> INNER JOIN INSERTED I ON (A.DEX_ROW_ID = I.DEX_ROW_ID) <BR/> LEFT OUTER JOIN rmSpecialPayments B ON (I.YMTRMID = B.PaymentTerm)<BR/> WHERE I.DOCDATE BETWEEN B.ApplyFrom AND B.ApplyTo <BR/> <BR/> IF @@ERROR = 0 <BR/> COMMIT TRAN <BR/> ELSE ROLLBACK TRAN<BR/>GO<BR/><BR/>Best regards,<BR/><BR/>MG.-<BR/>Mariano Gomez, MVPMariano Gomezhttps://www.blogger.com/profile/13267738662239812289noreply@blogger.comtag:blogger.com,1999:blog-5285970135510371565.post-42618174880995239662009-01-27T23:05:00.000-05:002009-01-27T23:05:00.000-05:00Hello Mariano,I want to thank you for your posts a...Hello Mariano,<BR/>I want to thank you for your posts as it has taught me a great deal. This post is great, but what if you wanted to make the net terms ID and due date change before the invoice is posted? Can you make this same change on the SOP10100 table and how would that look?<BR/><BR/>Thank you,<BR/>GregGreg Parkerhttps://www.blogger.com/profile/09132623154359261867noreply@blogger.comtag:blogger.com,1999:blog-5285970135510371565.post-9773931099908845522008-12-16T09:13:00.000-05:002008-12-16T09:13:00.000-05:00Mariano,Thanks for the great post. I DO appreciat...Mariano,<BR/>Thanks for the great post. I DO appreciate all the helpful tips.<BR/><BR/>JaphethJapheth Nolthttps://www.blogger.com/profile/03843232140220968462noreply@blogger.comtag:blogger.com,1999:blog-5285970135510371565.post-19984651605448422492008-12-15T16:50:00.000-05:002008-12-15T16:50:00.000-05:00Mariano, this is awesome stuff. For anyone workin...Mariano, this is awesome stuff. For anyone working on their SQL skills having these kind of short examples with detailed explanations is very valuable.<BR/><BR/>VictoriaAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5285970135510371565.post-35146290928158087962008-12-15T09:14:00.000-05:002008-12-15T09:14:00.000-05:00Japhet,Thanks for pointing this out! I will correc...Japhet,<BR/><BR/>Thanks for pointing this out! I will correct this in my post -- fast typing.<BR/><BR/>Best regards,<BR/><BR/>MG.-Mariano Gomezhttps://www.blogger.com/profile/13267738662239812289noreply@blogger.comtag:blogger.com,1999:blog-5285970135510371565.post-29827504764021855392008-12-15T09:00:00.000-05:002008-12-15T09:00:00.000-05:00I am a little confused by your statement "since yo...I am a little confused by your statement "since you cannot change the due date on a SOP order or invoice document". I realize that on an order, the Terms Discount Taken fields is greyed out. But on the invoice, you can click on the blue arrow beside the Terms Discount Taken field which takes you to the Sales Payment Terms Entry window. There you can change the Due Date for the invoice.<BR/><BR/>Maybe I'm missing something.<BR/><BR/>Thanks,<BR/>JaphethJapheth Nolthttps://www.blogger.com/profile/03843232140220968462noreply@blogger.com