Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IF (SalesHeader."Applies-to Doc. No." <> '') OR (SalesHeader."Applies-to ID" <> '') THEN BEGIN
- IF SalesHeader."Applies-to Doc. No." <> '' THEN BEGIN
- SETCURRENTKEY("Document No.");
- SETRANGE("Document No.",SalesHeader."Applies-to Doc. No.");
- SETRANGE("Document Type",SalesHeader."Applies-to Doc. Type");
- SETRANGE("Customer No.",SalesHeader."Bill-to Customer No.");
- IF SalesHeader."Applies-to Entry No." <> 0 THEN
- SETRANGE("Entry No.",SalesHeader."Applies-to Entry No.");
- END ELSE BEGIN
- SETCURRENTKEY("Customer No.","Applies-to ID",Open,Positive,"Due Date");
- SETRANGE("Customer No.",SalesHeader."Bill-to Customer No.");
- SETRANGE("Applies-to ID",SalesHeader."Applies-to ID");
- END;
- SETRANGE("Currency Code",SalesHeader."Currency Clause Code");
- IF (SalesHeader."Document Type" IN [SalesHeader."Document Type"::"Credit Memo",SalesHeader."Document Type"::"Return Order"]) THEN
- SETRANGE("Document Type","Document Type"::Invoice)
- ELSE BEGIN
- SETRANGE(Positive,FALSE);
- SETRANGE(Prepayment,TRUE);
- END;
- SETFILTER("Amount to Apply",'<>0');
- EXIT(FINDFIRST);
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement