Fetch PAN for selected Party AddressType in Sales Purchase Vouchers

Discussion in 'Tally Developer' started by naren1234, Jul 8, 2023.

    
  1. naren1234

    naren1234 Member


    Dear Experts,

    At the time of recording a Sales or Purchase invoice vouchers, when i look under the 'Party Details' screen which pops-up after selecting the Party Ledger, i can see a field for GSTIN under the Buyer/Supplier Party details (respectively), but there is no field for their PAN.

    When the 'Enable multiple addresses' option is enabled (which allows us to save different GSTIN and PAN in the same Party Ledger by adding multiple Address Name), the GSTIN under the 'Party Details' reflects the correct GST number as per the selected 'Address Type' for that Party, and it is stored in that voucher as PartyGSTIN. So in a vouchers collection, I can fetch $PartyGSTIN stored in a voucher.
    Similarly, is the correct Party PAN (as per selected AddressType) also stored in the voucher record somewhere, so that we can fetch that in a vouchers collection?

    Just FYI, I checked the Purchase & Sales Columnar registers with 'show PAN' = yes. But, it always shows the PAN from the Ledger, even when a Party Address Type containing a different PAN was selected in that voucher.

    We don't want that behaviour because, in the existing company data, if a party's PAN got changed, their new PAN was added to a new Address Name created in their existing Ledger; keeping the old PAN at the Ledger (primary) level (see attached screenshot for illustration).
    And therefore, when recording Sales, Purchase, Debit Note or Credit Note vouchers after such party's PAN is updated, the users simply select the new Address Name in the 'Party Details' screen, which has the updated PAN.

    Thanks.

    P.S. If we try to replicate the default code used to fetch Party GSTIN for a selected AddressType, and store the acquired Party PAN in the voucher (so we can fetch the same in a vouchers collection), it will only work for new vouchers created after implementing the code.
     

    Attached Files:



  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    If assuming you are using TDS/TCS in your Data .... the correct methodology is to create a new Ledger with updated PAN. This will not create havoc with your TDS reporting.
     


  3. naren1234

    naren1234 Member


    Yes sir, it is for TDS/TCS purpose.
    And from now onwards the methodology has also changed as you have correctly pointed out, creating New Ledger with updated PAN.

    For earlier transactions, as requested above, is it possible to get the voucher details with correct PAN?
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Wherever you need to display the new/updated PAN as per Voucher Entry ...... kindly refer to the field where you need to display..........
    In that field.......... make....local formula
    val01 : If NOT $$IsEmpty:#PANFieldNameinVoucher then "thatvalue" else ""
    In Set As --- If NOT $$IsEmpty:mad:Val01 then @Val01 else "defaultPANdetails" (as per Ledger)
     
    naren1234 likes this.


  5. naren1234

    naren1234 Member


    Thank you !
    I will add a custom field accordingly.
     



  6. Sir, Just for knowledge base, Only One PAN for a ONE Party and One GSTIN for ONE State, can have different GSTIN if having Multiple state business
     


Share This Page