PDC(Postdated checks)

vyankuvyanku Member Posts: 791
If we create new table for PDC contains all the postdated checks information.
Is it possible ?.......
When the due date of the check in PDC is equal to work date then that check is shifted from PDC table to Payment journal automatically for posting purpose.
How can we do this?

Answers

  • MbadMbad Member Posts: 344
    vyanku wrote:
    When the due date of the check in PDC is equal to work date then that check is shifted from PDC table to Payment journal automatically for posting purpose.
    How can we do this?

    Make a report that they can run from the payment journal that fills out the lines. Since they have to check and post the lines anyway there is no need to create some fancy workaround to get it to work automaticly(will only take a couple of seconds to run the report).
  • vyankuvyanku Member Posts: 791
    Will u please explain ?
  • vyankuvyanku Member Posts: 791
    Instade of going on GenJnlLine I create another table test.
    Now I a trying to insert the Postdated checks from PDC table to test table
    For this I write the following code ,
    But I will not execute the IF statement.Any body tell me where is the mistake? ](*,) ](*,) How can I solve this mistake? :-k
    date := WORKDATE;
    IF PDC."Check Due Date" = date THEN
        PDC.INIT;
        test."posting date" := PDC."Check Due Date";
        test.amount := PDC.Amount;
        test."document no." := PDC."Check No.";
        IF test."line no." = test."line no." THEN
        REPEAT
        test."line no." := test."line no." +1;
        UNTIL NEXT=0;
         test.INSERT;
    
  • ssinglassingla Member Posts: 2,973
    What are you trying to do. You are writing INIT code of PDC Table and inserting in Test Table. How you think this will work. I have very less exp. of Tech but can see the problem in this code. Further there is no need of using a variable "Date". Setrange the PDC table for workdate and then run the repeat until loop on the PDC table. Also get the last record of test table and assign the new line number value by adding to the last line number.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • MbadMbad Member Posts: 344
    Your code isnt too good, sadly.
    A few pointers.

    Start by finding the data, then assign, then insert.
    Setcurrentkey('use the best key');
    PDC.setrange('your filter')
    if PDC.find('-') then     // findset if 4.02+
      repeat
        'assign'                  // make sure your primary key fields are filled
        'insert'
      until PDC.next = 0;
    

    To keep track of your line no.(to fill out your primary key i suppose) use a variable, NextLineNo

    And please do not code this on the form/button etc.
  • vyankuvyanku Member Posts: 791
    thanks
    I learned very much from u.
    Thanks Its work now.It is now shifted from PDC to payment journal.
    But how to to delete that shifted entry from PDC?
  • MbadMbad Member Posts: 344
    Can do it in two ways.

    1. after you run the whole thing use PDC.deleteall // be VERY carefull that you have a filter on, else it will delete all records

    2. in the bottom of your repeat-until code just do a pdc.delete // when deleting in a loop it is always a good idea to create a new variable, find the same record, and delete that instead.
  • vyankuvyanku Member Posts: 791
    It will transfer the line from PDC to payment journal and delete that line from PDC
    But I got one more problem.
    after shifteing that line it will take the line no randomly like
    checkno. date line no.
    check no1 date1 1
    check no2 date2 3
    check no3 dae3 5

    My code is below,
    Will u tell me where is the peoblem.
    date := WORKDATE;
    PDC.SETRANGE(PDC."Check Due Date",WORKDATE);
     IF PDC.FIND('-') THEN
    REPEAT
    
         IF PDC."Check Due Date" = date THEN
           REPEAT
           test.INIT;
    
           test."posting date" := PDC."Check Due Date";
           test.amount := PDC.Amount;
           test."document no." := PDC."Check No.";
                    
                     IF test."line no." = test."line no." THEN
                        REPEAT
                        test."line no." := test."line no." +1;
                     UNTIL NEXT=0;
    
           test.INSERT;
           PDC.DELETE;
         UNTIL PDC.NEXT = 0;
    UNTIL NEXT=0;
    
  • MbadMbad Member Posts: 344
    Could be something like this
    variable:PDC2
    test.locktable;
    If test.find('+') then
      NextLineNo := test."line no." + 10000
    else
      NextLineNo := 10000
    //date :=   // dont use date as variable
    PDC.SETRANGE("Check Due Date",WORKDATE);
    IF PDC.FIND('-') THEN
      REPEAT
        test.INIT;
        test."posting date" := PDC."Check Due Date";
        test.amount := PDC.Amount;
        test."document no." := PDC."Check No.";
        test."line no." := NextLineNo;
        test.INSERT;
        NextLineNo += 10000;
        PDC2 := PDC    // just a safe way to not interfere with your loop
        PDC2.DELETE;
      UNTIL PDC.NEXT = 0;
    

    It is your responsibility to control what line nos you want to insert, meaning f.ex. to find the last existing line no and insert after that.
  • vyankuvyanku Member Posts: 791
    Are u defind PDC2 as temp. veriable ???
    But what is its purpose? :-k
  • MbadMbad Member Posts: 344
    vyanku wrote:
    Are u defind PDC2 as temp. veriable ???

    No.
    vyanku wrote:
    But what is its purpose?

    Im just used to using a variable when modifying primary keys/deleting records within loops, because if you are not carefull the loop will terminate. You probably wont need it here though(was just show you what to be aware of).
  • vyankuvyanku Member Posts: 791
    Ok
    Thanks \:D/
    I learned very much from u. \:D/
    Thanks again. \:D/
    :whistle:
  • bijaljambusariabijaljambusaria Member Posts: 46
    Mbad wrote:
    And please do not code this on the form/button etc.

    Can you explain why?
  • Prajeesh_NairPrajeesh_Nair Member Posts: 70
    Hii All :)
    I am also trying to do the PDC for vendor and customer.
    I am doing this by sorting the vendor ledger entry and customer ledger entry usng a PDC header which i created.
    The filters are vendor or customer No and Open Entry in the vendor or customer ledger entry.
    Then i push the appropriate fields to a new table. I am doing this so that i can calculate the balance depending up on the check amount i have entered . Then using a boolean Mark posting the Record. I am little doubtful about the table to which i should enter these data so that it can affect the G/L. ](*,)
    Currently i am using different form to do the PDC for customer and vendor. Can i do this on one form by giving an option? payable and recevable.
    Please Give me All the Information and Ideas :idea: Regarding to this [-o<
  • vyankuvyanku Member Posts: 791
    hi Prajeesh
    i am technical person so i dont know whether i am correct or not but as per my suggession u can do that in one table with filter as payble and receivable.
    One thing postdated check are posted when the work date = pdc date.
    So u should maintain those checks in pDC table when today = pdc date(any payble/receivable) then that check will automatically or by click on button should be moved in Gen. jnl. or u can do this if the chek under payble then that check will move in bank payment journal and if the check is under receivable then that check will move to bank receipt journal.
    Afterposting through these journal the effect will always correct.
    best luck. :D
Sign In or Register to comment.