Exercise 20

Sales Vouchers With GST Without Inventory

Published


This exercise imports Sales Vouchers with GST — IGST for inter-state sales, CGST and SGST for local sales — from Excel into Tally Prime. There are no stock items. It builds on the Sales Vouchers With Multiple Ledgers exercise and shows how GROUPBY combines rows of the same invoice, how SKIP leaves out the tax entries and tax ledgers that are not needed, and how the GST details of the party and the tax ledgers are created.

The Excel sheet

Each row has the HSN/SAC code (column F), the taxable Amount (column I), the tax percentages and tax amounts (columns J to O) and the ledger names (columns P to S). Invoice 2 spans two rows with different tax rates, so both rows go into one voucher. The tax amounts are already calculated in the sheet.

ABCDEFGHIJKLMNOPQRST
1inv-noinv-datepartygstinstatehsncountryplace-of-supplyamountigst-percigst-amtcgst-perccgst-amtsgst-percsgst-amtsales-ledgerigst-ledgercgst-ledgersgst-ledgernarration
2101/04/2026IGST PartyMaharashtra998313IndiaMaharashtra1001818Sales (IGST) @ 18%igst @ 18%
3201/04/2026Local PartyGujarat998313IndiaGujarat1009999Sales (Local) @ 18%cgst @ 9%sgst @ 9%
4201/04/2026Local PartyGujarat998313IndiaGujarat1006666Sales (Local) @ 12%cgst @ 6%sgst @ 6%

Step 1 — Create the Party Ledger master

The party is created under Sundry Debtors with bill-wise tracking on. Its GST registration type depends on the GSTIN in column D: Regular when a GSTIN is given, otherwise Unregistered. The country defaults to India when column G is empty. For Tally Prime 3.0, the GST details go into LEDGSTREGDETAILS.LIST (registration type, state, place of supply and GSTIN) and the address into LEDMAILINGDETAILS.LIST. The place of supply is taken from column H, or from the state in column E when column H is empty.

<!--
  Excel columns in sales-with-gst-without-inventory.csv:
  A = INV-NO            B = INV-DATE          C = PARTY
  D = GSTIN             E = STATE             F = HSN
  G = COUNTRY           H = PLACE-OF-SUPPLY   I = AMOUNT (taxable value)
  J = IGST-PERC         K = IGST-AMT
  L = CGST-PERC         M = CGST-AMT
  N = SGST-PERC         O = SGST-AMT
  P = SALES-LEDGER      Q = IGST-LEDGER       R = CGST-LEDGER     S = SGST-LEDGER
  T = NARRATION
-->

<!-- Create Party Ledger Masters from Column C -->
<MASTER TYPE="LEDGER">
  <NAME.LIST>
    <NAME COLUMNREFERENCE="C"/>
  </NAME.LIST>
  <ADDITIONALNAME COLUMNREFERENCE="C"/>
  <PARENT>Sundry Debtors</PARENT>
  <ISBILLWISEON>Yes</ISBILLWISEON>
  <ISCOSTCENTRESON>No</ISCOSTCENTRESON>
  <GSTREGISTRATIONTYPE FORMULA="=if(len(trim(D#))=0,&quot;Unregistered&quot;,&quot;Regular&quot;)"/>
  <PARTYGSTIN FORMULA="=trim(D#)"/>
  <COUNTRYNAME FORMULA="=if(len(trim(G#))=0,&quot;India&quot;,G#)"/>
  <STATENAME FORMULA="=proper(trim(E#))"/>
  <LEDSTATENAME FORMULA="=proper(trim(E#))"/>
  <!-- Tally Prime 3.0 -->
  <LEDGSTREGDETAILS.LIST>
    <APPLICABLEFROM>20260401</APPLICABLEFROM>
    <GSTREGISTRATIONTYPE FORMULA="=if(len(trim(D#))=0,&quot;Unregistered/Consumer&quot;,&quot;Regular&quot;)"/>
    <STATE FORMULA="=proper(trim(E#))"/>
    <PLACEOFSUPPLY FORMULA="=if(len(trim(H#))&gt;0,proper(trim(H#)),proper(trim(E#)))"/>
    <GSTIN FORMULA="=trim(D#)"/>
  </LEDGSTREGDETAILS.LIST>
  <LEDMAILINGDETAILS.LIST>
    <APPLICABLEFROM>20260401</APPLICABLEFROM>
    <MAILINGNAME COLUMNREFERENCE="C"/>
    <STATE FORMULA="=proper(trim(E#))"/>
    <COUNTRY FORMULA="=if(len(trim(G#))=0,&quot;India&quot;,G#)"/>
  </LEDMAILINGDETAILS.LIST>
</MASTER>

Step 2 — Create the Sales and Tax Ledger masters

The Sales ledger name is read from column P, and the name already carries the GST rate (for example Sales (Local) @ 18%). Each Sales ledger therefore holds exactly one GST rate, which is written into the ledger's GST details along with the HSN/SAC code from column F. The rate is the IGST percentage (column J), or CGST + SGST (columns L and N) when the IGST percentage is 0 or blank.

<!-- Create Sales Ledger Masters from Column P -->
<MASTER TYPE="LEDGER">
  <NAME.LIST>
    <NAME COLUMNREFERENCE="P"/>
  </NAME.LIST>
  <PARENT>Sales Accounts</PARENT>
  <TAXTYPE>Others</TAXTYPE>
  <ISBILLWISEON>No</ISBILLWISEON>
  <ISCOSTCENTRESON>No</ISCOSTCENTRESON>
  <AFFECTSSTOCK>No</AFFECTSSTOCK>
  <USEFORVAT>No</USEFORVAT>
  <GSTAPPLICABLE FORMULA="=&quot;~[~ Applicable&quot;"/>
  <GSTTYPEOFSUPPLY>Services</GSTTYPEOFSUPPLY>
  <GSTDETAILS.LIST>
    <APPLICABLEFROM>20260401</APPLICABLEFROM>
    <TAXABILITY>Taxable</TAXABILITY>
    <SRCOFGSTDETAILS>Specify Details Here</SRCOFGSTDETAILS>
    <ISREVERSECHARGEAPPLICABLE>No</ISREVERSECHARGEAPPLICABLE>
    <ISNONGSTGOODS>No</ISNONGSTGOODS>
    <STATEWISEDETAILS.LIST>
      <STATENAME FORMULA="=&quot;~[~ Any&quot;"/>
      <RATEDETAILS.LIST>
        <GSTRATEDUTYHEAD>CGST</GSTRATEDUTYHEAD>
        <GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
        <GSTRATE FORMULA="=if(Round(L#,2)&gt;0,Round(L#,2),Round(J#,2)/2)"/>
      </RATEDETAILS.LIST>
      <RATEDETAILS.LIST>
        <GSTRATEDUTYHEAD>SGST/UTGST</GSTRATEDUTYHEAD>
        <GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
        <GSTRATE FORMULA="=if(Round(N#,2)&gt;0,Round(N#,2),Round(J#,2)/2)"/>
      </RATEDETAILS.LIST>
      <RATEDETAILS.LIST>
        <GSTRATEDUTYHEAD>IGST</GSTRATEDUTYHEAD>
        <GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
        <GSTRATE FORMULA="=if(Round(J#,2)&gt;0,Round(J#,2),Round(L#,2)+Round(N#,2))"/>
      </RATEDETAILS.LIST>
      <RATEDETAILS.LIST>
        <GSTRATEDUTYHEAD>Cess</GSTRATEDUTYHEAD>
        <GSTRATEVALUATIONTYPE FORMULA="=&quot;~[~ Not Applicable&quot;"/>
        <GSTRATE>0</GSTRATE>
      </RATEDETAILS.LIST>
      <RATEDETAILS.LIST>
        <GSTRATEDUTYHEAD>State Cess</GSTRATEDUTYHEAD>
        <GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
        <GSTRATE>0</GSTRATE>
      </RATEDETAILS.LIST>
    </STATEWISEDETAILS.LIST>
  </GSTDETAILS.LIST>
  <HSNDETAILS.LIST>
    <APPLICABLEFROM>20260401</APPLICABLEFROM>
    <HSNCODE COLUMNREFERENCE="F"/>
    <SRCOFHSNDETAILS>Specify Details Here</SRCOFHSNDETAILS>
  </HSNDETAILS.LIST>
</MASTER>

The IGST, CGST and SGST ledgers are created under Duties & Taxes, with the duty head (Integrated, Central or State Tax) and the rate taken from the percentage columns. An import ignores a MASTER whose name is empty, so SKIP is placed on the NAME tag, not on the MASTER tag. The IGST ledger is therefore not created when the IGST amount (column K) is 0. The CGST (ledger R, rate L, amount M) and SGST (ledger S, rate N, amount O) masters follow the same pattern.

<!--
  NOTE: udiMagic skips a MASTER when its NAME is empty. Hence, the SKIP condition
  must be used on the NAME tag and NOT on the MASTER tag.
  e.g. SKIP="=Round(K#,2)=0" on NAME skips the IGST ledger when IGST amount is 0.
-->

<!-- Create IGST Ledger Master from Column Q (only when IGST amount is non-zero) -->
<MASTER TYPE="LEDGER">
  <NAME.LIST>
    <NAME SKIP="=Round(K#,2)=0" COLUMNREFERENCE="Q"/>
  </NAME.LIST>
  <PARENT>Duties &amp; Taxes</PARENT>
  <ISCOSTCENTRESON>No</ISCOSTCENTRESON>
  <AFFECTSSTOCK>No</AFFECTSSTOCK>
  <GSTAPPLICABLE FORMULA="=&quot;~[~ Applicable&quot;"/>
  <GSTDUTYHEAD>Integrated Tax</GSTDUTYHEAD>
  <TAXTYPE>GST</TAXTYPE>
  <RATEOFTAXCALCULATION COLUMNREFERENCE="J"/>
</MASTER>

<!-- Create CGST Ledger Master from Column R (only when CGST amount is non-zero) -->
<MASTER TYPE="LEDGER">
  <NAME.LIST>
    <NAME SKIP="=Round(M#,2)=0" COLUMNREFERENCE="R"/>
  </NAME.LIST>
  <PARENT>Duties &amp; Taxes</PARENT>
  <ISCOSTCENTRESON>No</ISCOSTCENTRESON>
  <AFFECTSSTOCK>No</AFFECTSSTOCK>
  <GSTAPPLICABLE FORMULA="=&quot;~[~ Applicable&quot;"/>
  <GSTDUTYHEAD>Central Tax</GSTDUTYHEAD>
  <TAXTYPE>GST</TAXTYPE>
  <RATEOFTAXCALCULATION COLUMNREFERENCE="L"/>
</MASTER>

<!-- Create SGST Ledger Master from Column S (only when SGST amount is non-zero) -->
<MASTER TYPE="LEDGER">
  <NAME.LIST>
    <NAME SKIP="=Round(O#,2)=0" COLUMNREFERENCE="S"/>
  </NAME.LIST>
  <PARENT>Duties &amp; Taxes</PARENT>
  <ISCOSTCENTRESON>No</ISCOSTCENTRESON>
  <AFFECTSSTOCK>No</AFFECTSSTOCK>
  <GSTAPPLICABLE FORMULA="=&quot;~[~ Applicable&quot;"/>
  <GSTDUTYHEAD>State Tax</GSTDUTYHEAD>
  <TAXTYPE>GST</TAXTYPE>
  <RATEOFTAXCALCULATION COLUMNREFERENCE="N"/>
</MASTER>

Step 3 — Write the Voucher tags

One Sales voucher is created for each invoice number. The GST details of the party (GSTIN, registration type, state, country and place of supply) are repeated on the voucher. Then come the ledger entries:

<!-- One Sales Voucher per invoice number in Column A -->
<VOUCHER>
  <GUID FORMULA="=&quot;udi-SPB1-&quot; &amp; A#"/>
  <DATE COLUMNREFERENCE="B"/>
  <EFFECTIVEDATE COLUMNREFERENCE="B"/>
  <VOUCHERTYPENAME>Sales</VOUCHERTYPENAME>
  <VOUCHERNUMBER COLUMNREFERENCE="A"/>
  <REFERENCE COLUMNREFERENCE="A"/>
  <NARRATION COLUMNREFERENCE="T"/>
  <ISINVOICE>Yes</ISINVOICE>
  <PERSISTEDVIEW>Invoice Voucher View</PERSISTEDVIEW>

  <!-- GST details of the party -->
  <PARTYGSTIN FORMULA="=trim(D#)"/>
  <GSTREGISTRATIONTYPE FORMULA="=if(len(trim(D#))=0,&quot;Unregistered&quot;,&quot;Regular&quot;)"/>
  <STATENAME FORMULA="=proper(trim(E#))"/>
  <COUNTRYOFRESIDENCE FORMULA="=if(len(trim(G#))=0,&quot;India&quot;,G#)"/>
  <PLACEOFSUPPLY FORMULA="=if(len(trim(H#))&gt;0,proper(trim(H#)),proper(trim(E#)))"/>
  <PARTYNAME COLUMNREFERENCE="C"/>
  <PARTYLEDGERNAME COLUMNREFERENCE="C"/>
  <BASICBASEPARTYNAME COLUMNREFERENCE="C"/>
  <BASICBUYERNAME COLUMNREFERENCE="C"/>

  <!--
    Party debit: GROUPBY=A# groups all rows of the invoice (e.g. invoice 2 spans two rows
    with different tax rates). Debit = Taxable value + IGST + CGST + SGST, shown as negative.
  -->
  <LEDGERENTRIES.LIST GROUPBY="=A#">
    <LEDGERNAME COLUMNREFERENCE="C"/>
    <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
    <AMOUNT FORMULA="={Round(I#,2)+Round(K#,2)+Round(M#,2)+Round(O#,2)}*-1"/>
    <BILLALLOCATIONS.LIST SKIP="=Len(trim(A#))=0">
      <NAME COLUMNREFERENCE="A"/>
      <BILLTYPE>New Ref</BILLTYPE>
      <AMOUNT FORMULA="={Round(I#,2)+Round(K#,2)+Round(M#,2)+Round(O#,2)}*-1"/>
    </BILLALLOCATIONS.LIST>
  </LEDGERENTRIES.LIST>

  <!--
    Sales credit: grouped by the Sales Ledger name with its rate (Column P),
    which is the same name used in the Sales Ledger master above. Rows of one invoice with
    different rates therefore become separate sales lines, each posted to its own ledger.
  -->
  <LEDGERENTRIES.LIST GROUPBY="=trim(P#)">
    <LEDGERNAME COLUMNREFERENCE="P"/>
    <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
    <AMOUNT FORMULA="={Round(I#,2)}"/>
  </LEDGERENTRIES.LIST>

  <!--
    GROUPBY = IGST/CGST/SGST ledger name (Columns Q/R/S) so that multiple rows of the 
    same invoice with the same tax rate are grouped into one line.
     The SKIP condition skips the ledger if the amount is zero or blank.
  -->
  <!-- IGST credit: skipped when the IGST amount is 0 or blank -->
  <LEDGERENTRIES.LIST GROUPBY="=trim(Q#)" SKIP="={Round(K#,2)}=0">
    <LEDGERNAME COLUMNREFERENCE="Q"/>
    <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
    <AMOUNT FORMULA="={Round(K#,2)}"/>
  </LEDGERENTRIES.LIST>

  <!-- CGST credit: skipped when the CGST amount is 0 or blank -->
  <LEDGERENTRIES.LIST GROUPBY="=trim(R#)" SKIP="={Round(M#,2)}=0">
    <LEDGERNAME COLUMNREFERENCE="R"/>
    <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
    <AMOUNT FORMULA="={Round(M#,2)}"/>
  </LEDGERENTRIES.LIST>

  <!-- SGST credit: skipped when the SGST amount is 0 or blank -->
  <LEDGERENTRIES.LIST GROUPBY="=trim(S#)" SKIP="={Round(O#,2)}=0">
    <LEDGERNAME COLUMNREFERENCE="S"/>
    <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
    <AMOUNT FORMULA="={Round(O#,2)}"/>
  </LEDGERENTRIES.LIST>
</VOUCHER>

Import into Tally

  1. Start Tally Prime and open the company you want to import into.
  2. Minimize Tally (leave it running).
  3. Start udiMagic and select Excel to Tally.
  4. Select option Import data into Tally.
  5. Browse to select both the Excel sheet and the XML tags file — you're prompted for the XML file on the same screen as the Excel sheet.
  6. Follow the wizard to complete the import.
Remarks:
  1. The ledger names for Sales, IGST, CGST and SGST come from columns P to S, so the voucher always matches the ledgers created in the masters. The names also carry the GST rate, for example Sales (Local) @ 18% and cgst @ 9%.
  2. Invoice 2 has two rows at different rates (9% + 9% and 6% + 6%). Both are combined into one voucher; GROUPBY adds up the amounts per ledger, and each rate is posted to its own Sales ledger.
  3. The tax amounts are not calculated by the XML tags. Calculate them in the sheet, for example =I2*J2/100.
  4. The Sales ledger is created with its GST rate and HSN/SAC code, so the voucher carries no GST rate override.
  5. Leave the GSTIN blank for an unregistered party. Fill the Place-of-Supply only when it differs from the party's state.
Sample files: Download the sample Excel sheet and matching XML tags file for this exercise. Download sales-with-gst-without-inventory.zip

Ready to import your Excel data into Tally?

Download udiMagic and start a 14-day free trial — no credit card required.

Download udiMagic View Pricing