on 02-12-2018 8:18 AM
Hi All,
Approval procedure query required on AR credit memo, when the batch in sales return document date is more than > 120 days of delivery date.
Items are managed by batches.
Anything less than 120 days of delivery date no approval is required.
Appreciated for your help
San
Thanks Jimmy,
My scenario in breif
Step 1 :Delivery note --> copy to A/R Invoice, relation ship closed here.
Step 2: Stand alone Sales Return--> Copy to A/R Credit memo
the links available from Sales returns to delivery note is batch number.
I will be requiring, delivery date and batch number should check with Sales returns date and batch number.
this is because same item can be delivered with different batch numbers.
We should accept all items based on sales returns , but credit memo can be generated only after approval.
The approval required for posting credit memo( sales return date) more than 120 days of delivery date
Your logic works fine when there is no batch involved. can we get the same by linking with batch numbers.
Regards,
San
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi San,
I used to have a similar scenario - compare the dates between a credit note and a return. Your approval query may look like below.
Please note that this is based on the hypothesis that you are using the Copy To/Copy From when converting a document to another, so the documents are related from one to another along the business flow. For example, a Delivery is copied to a Return, then the Return is copied to the AR Credit Note. If any of these documents is created manually, not based on another, it may not be captured in this query so the approval process will not be triggered. If that's the case, you may have to add the other conditions.
SELECT DISTINCT 'True' FROM
ORIN INNER JOIN RIN1 ON RIN1.DocEntry = ORIN.DocEntry
INNER JOIN RDN1 ON RDN1.trgetentry = RIN1.Docentry and RDN1.LineNum = RIN1.Baseline and RIN1.itemcode=RDN1.ItemCode and RDN1.TargetType = 14
INNER JOIN DLN1 ON DLN1.trgetentry = RDN1.Docentry and DLN1.LineNum = RDN1.Baseline and DLN1.itemcode = RDN1.Itemcode and DLN1.TargetType =16
INNER JOIN ORDN ON ORDN.DocEntry = RDN1.DocEntry
INNER JOIN ODLN ON ODLN.DocEntry = DLN1.DocEntry
WHERE Datediff(dd,ORDN.DocDueDate, ODLN.taxdate) > 120
Additionally, there will be other steps in setting up an approval process, you may refer to this link for more details:
Cheers,
Jimmy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.