Fetching Voucher Ref No

Discussion in 'Tally Developer' started by Ragavan, Jun 29, 2015.

    
  1. Ragavan

    Ragavan New Member


    Hi

    i found tdl from this forum for import of sales from excel with stock items. I tried to explore addl options like adding

    1) Voucher Ref no to capture the Order No of customer
    2) Delivery/shipping address

    in first place added a new col in excel No 31 for ref no but it doesnt pick up in the voucher at all

    I want to use the above voucher ref for bill ref also - new ref for the invoice

    Though voucher import get error type warning

    FUNCTION: 'Sales Import' LABEL: 650 : Action execution failed!
    FUNCTION: 'Sales Import' LABEL: : Action execution failed!
    FUNCTION: 'Sales Import' LABEL: : Action execution failed!
    FUNCTION: 'Sales Import' LABEL: : Action execution failed!

    Since this didn proceed i cudn try delivery address capturing. how to capture the same too?

    plz let some experts add inputs here & solve these issues





    ;------------- om Sai ram

    [#Menu : Gateway of Tally]

    Key Item : Sales Import : S : Execute : Sy Sales Imports

    /*************** Sales Import ******************/

    [Report : Sy Sales Imports]
    Form : Sy Sales Imports
    Title : $$LocaleString:"Sales Vouchers Import"
    Auto : Yes

    [Form : Sy Sales Imports]
    No Confirm : Yes
    Space Top : 1
    Space Left : 1
    Space Right : 1
    Space Bottom : 1
    Option : Small Size Form
    Full Width : No
    Full Height : No
    Vertical Align : Centre
    Parts : Sy Sales Imports Title, Sy Sales Import Details
    On : Form Accept : Yes : CALL : Sales Import

    Local : Field : Sy Import FileName : Modifies : Sy SVExcelPath : Yes
    Local : Field : Sy Import FileName : Variable : Sy SVExcelPath

    [Part : Sy Sales Imports Title]
    Lines : Sy Sales Imports, Sy Sales Imports Info

    [Line : Sy Sales Imports]
    Fields : Form Sub Title
    Space Bottom : 0.25
    Local : Field : Form Sub Title : Info : $$LocaleString:"Sales Voucher Import"

    [Line : Sy Sales Imports Info]
    Field : Simple Field
    Space Bottom : 0.75
    Local : Field : Simple Field : Info : $$LocaleString:"(Only Tally (XLS) Format is Supported)"
    Local : Field : Simple Field : Full Width : Yes
    Local : Field : Simple Field : Align : Centre

    [Part : Sy Sales Import Details]
    Lines : Sy Import FileName

    [Line : Sy Import FileName]
    Field : Medium Prompt, Sy Import FileName
    Local : Field : Medium Prompt : Info : $$LocaleString:"Import File Name (XLS) :"

    [Field : Sy Import FileName]
    Use : Name Field
    Set as : "Past Excel Path"
    Width : @@NarrWidth
    Full Width : Yes

    [Variable : Sy SVExcelPath]
    Type : String
    Default : ""
    Persist : Yes

    [System : Variable]
    Sy SVExcelPath : ""
    [System : Formula]
    SyExcelFilePath : ##SySVExcelPath

    [Collection: Excel Sales]

    ODBC : "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + @@SyExcelFilePath
    SQL : "Select * from [Sheet1$]"
    ;SQL : "Select Distinct `Inv_No`,`Inv_Date`from [Sheet1$]"
    SQLObject : Sy Sales Object
    Client Only : Yes
    Format : $_1
    Format : $_2
    Format : $_18
    Format : $_17

    [Object: Sy Sales Object]

    SyInvNo : $_1
    SyInvDt : $_2
    SyPartyName : $_3
    SyDcNo : $_4
    SyOrderNo : $_5
    SyModeTerms : $_6
    SySalesLedg : $_7
    SyVatLed : $_8
    SySalAmt : $_9
    SyItemName : $_10
    SyBatName : $_11
    SyQty : $_12
    SyRate : $_13
    SyAmt : $_14
    SyFrChrgs : $_15
    SyVat5 : $_16
    SyCST2 : $_17
    SyCST5 : $_18
    SyLocalSales : $_19
    SyInterStSls : $_20
    SyCForm : $_21
    SySerNum : $_22
    SyFromNum : $_23
    SyEForm : $_24
    SyESerNum : $_25
    SyEFromNum : $_26
    SyNameCC : $_27
    SyCCAmt : $_28
    SyInvAmt : $_29
    SyNaration : $_30

    [Collection : Sy Import Coll]
    Source Collection : Excel Sales
    Fetch : *
    By : SyInvNo : $_1
    Compute : SyInvDt : $_2
    Compute : SyPartyName : $_3
    Compute : SyDcNo : $_4
    Compute : SyOrderNo : $_5
    Compute : SyModeTerms : $_6
    Compute : SySalesLedg : $_7
    Compute : SyVatLed : $_8
    Compute : SySalAmt : $_9
    Compute : SyItemName : $_10
    Compute : SyBatName : $_11
    Compute : SyQty : $_12
    Compute : SyRate : $_13
    Compute : SyAmt : $$AsAmount:$_14
    AggrCompute : SyFrChrgs : Sum : $$AsAmount:$_15
    AggrCompute : SyVat5 : Sum : $$AsAmount:$_16
    AggrCompute : SyCST2 : Sum : $$AsAmount:$_17
    AggrCompute : SyCST5 : Sum : $$AsAmount:$_18
    AggrCompute : SyLocalSales : Sum : $$AsAmount:$_19
    AggrCompute : SyInterStSls : Sum : $$AsAmount:$_20
    Compute : SyCForm : $_21
    Compute : SySerNum : $_22
    Compute : SyFromNum : $_23
    Compute : SyEForm : $_24
    Compute : SyESerNum : $_25
    Compute : SyEFromNum : $_26
    Compute : SyNameCC : $_27
    Compute : SyCCAmt : $_28
    AggrCompute : SyInvAmt : Sum : $$AsAmount:$_29
    Compute : SyNaration : $_30
    Keep Source : ().
    Client Only : Yes

    [Collection : Sy Import Coll Rep]
    Source Collection : Excel Sales
    Fetch : *
    Compute : SyInvNo : $_1
    Compute : SyInvDt : $_2
    Compute : SyPartyName : $_3
    Compute : SyDcNo : $_4
    Compute : SyOrderNo : $_5
    Compute : SyModeTerms : $_6
    Compute : SySalesLedg : $_7
    Compute : SyVatLed : $_8
    Compute : SySalAmt : $$AsAmount:$_9
    Compute : SyItemName : $_10
    Compute : SyBatName : $_11
    Compute : SyQty : $_12
    Compute : SyRate : $_13
    Compute : SyAmt : $$AsAmount:$_14
    Compute : SyFrChrgs : $_15
    /*
    Compute : SyVat5 : $_15
    Compute : SyCST2 : $_16
    Compute : SyCST5 : $_17
    Compute : SyLocalSales : $_18
    Compute : SyInterStSls : $_19
    Compute : SyCForm : $_20
    Compute : SySerNum : $_21
    Compute : SyFromNum : $_22
    */
    Compute : SyNameCC : $_27
    Compute : SyCCAmt : $$AsAmount:$_28
    Compute : SyInvAmt : $$AsAmount:$_29
    Compute : SyNaration : $_30
    Keep Source : ().
    Client Only : Yes
    Filter : SyFilter


    [System : Formula]
    INVDATE : $$Date:(($$StringPart:$SyInvDt:8:2) + "-" + +
    ($$StringPart:$SyInvDt:5:2)+ "-" + +
    ($$StringPart:$SyInvDt:0:4))
    SyFilter: $SyInvNo = ##BillNo

    [Function : Sales Import]

    ;; Definition Block
    Variable : ProgressCount : Number
    Variable : Counter : Number
    Variable : VoucherTypeName : String

    Variable : BillNo : String
    Variable : SySalesQty : String
    Variable : SySalesRate : String
    Variable : SySalesAmt : String
    Variable : InvTotal : String

    Variable : SyInvNo : Number
    Variable : SyInvDt : Date
    Variable : SyPartyName : String
    Variable : SyDcNo : String
    Variable : SyOrderNo : String
    Variable : SyModeTerms : String
    Variable : SySalesLedg : String
    Variable : SyVatLed : String
    Variable : SySalAmt : String
    Variable : SyItemName : String
    Variable : SyBatName : Number
    Variable : SyQty : String
    Variable : SyRate : String
    Variable : SyAmt : String
    Variable : SyFrChrgs : String
    Variable : SyVat5 : String
    Variable : SyCST2 : String
    Variable : SyCST5 : String
    Variable : SyLocalSales : String
    Variable : SyInterStSls : String
    Variable : SyCForm : String
    Variable : SySerNum : String
    Variable : SyFromNum : String
    Variable : SyEForm : String
    Variable : SyESerNum : String
    Variable : SyEFromNum : String
    Variable : SyNameCC : String
    Variable : SyCCAmt : String
    Variable : SyInvAmt : String
    Variable : SyNaration : String

    ;; Procedural Block

    00 : Set : Counter : 0
    10 : Query Box : "Import Sales Voucher ?":Yes:No
    20 : SET : ProgressCount : 1

    30 : IF : NOT ($$NumItems:SyImportColl> 0)
    40 : RETURN
    50 : END IF

    55 : START PROGRESS : ($$NumItems:SyImportColl) : "Importing" : " Sales Vouchers"

    60 : WALK COLLECTION : Sy Import Coll
    65 : If : $$LastResult

    70 : SET : SyInvNo : $$String:$SyInvNo
    75 : SET : SyInvDt : $$String:$SyInvDt
    80 : SET : SyPartyName : $$String:$SyPartyName
    85 : SET : SyDcNo : $$String:$SyDcNo
    90 : SET : SyOrderNo : $$String:$SyOrderNo
    95 : SET : SyModeTerms : $$String:$SyModeTerms
    100 : SET : SySalesLedg : $$String:$SySalesLedg
    105 : SET : SyVatLed : $$String:$SyVatLed
    110 : SET : SySalAmt : $$String:$SySalAmt
    115 : SET : SyItemName : $SyItemName
    116 : SET : SyBatName : $$String:$SyBatName
    120 : SET : SyQty : $$String:$SyQty
    125 : SET : SyRate : $$String:$SyRate
    130 : SET : SyAmt : $$String:$SyAmt
    135 : SET : SyFrChrgs : $$String:$SyFrChrgs
    140 : SET : SyVat5 : $$String:$SyVat5
    145 : SET : SyCST2 : $$String:$SyCST2
    150 : SET : SyCST5 : $$String:$SyCST5
    155 : SET : SyLocalSales : $$String:$SyLocalSales
    160 : SET : SyInterStSls : $$String:$SyInterStSls
    165 : SET : SyCForm : $$String:$SyCForm
    170 : SET : SySerNum : $$String:$SySerNum
    175 : SET : SyFromNum : $$String:$SyFromNum
    176 : SET : SyEForm : $$String:$SyEForm
    177 : SET : SyESerNum : $$String:$SyESerNum
    178 : SET : SyEFromNum : $$String:$SyEFromNum
    180 : SET : SyNameCC : $$String:$SyNameCC
    185 : SET : SyCCAmt : $$String:$SyCCAmt
    190 : SET : SyInvAmt : $$String:$SyInvAmt
    195 : SET : SyNaration : $$String:$SyNaration
    ;200 : SET : SyFrChrgs : $$String:$SyFrChrgs

    210 : SET : SVViewName : $$SysName:InvVchView
    220 : NEW OBJECT : Voucher
    230 : SET VALUE : Date : @@INVDATE
    240 : SET VALUE : VoucherTypeName : $$VchTypeSales
    250 : SET VALUE : Narration : $SyNaration
    260 : SET VALUE : PARTYNAME : $SyPartyName
    270 : SET VALUE : VOUCHERNUMBER : ##SyInvNo
    280 : SET VALUE : BASICDUEDATEOFPYMT : $$String:$SyModeTerms
    290 : SET VALUE : PARTYLEDGERNAME : $SyPartyName
    300 : SET VALUE : BASICBASEPARTYNAME : $SyPartyName
    310 : SET VALUE : BASICBUYERNAME : $SyPartyName
    311 : SET VALUE : CSTFORMISSUETYPE : $$String:$SyEForm
    312 : SET VALUE : CSTFORMISSUENUMBER : $$String:$SyEFromNum
    320 : SET VALUE : CSTFORMRECVTYPE : $$String:$SyCForm
    330 : SET VALUE : CSTFORMRECVNUMBER : $$String:$SyFromNum
    331 : SET VALUE : CSTFORMISSUESERIESNUM : $$String:$SyESerNum
    340 : SET VALUE : CSTFORMRECVSERIESNUM : $$String:$SySerNum
    350 : SET VALUE : ISINVOICE : Yes

    360 : Insert Collection Object : INVOICEDELNOTES
    370 : SET VALUE : BASICSHIPPINGDATE : @@INVDATE
    380 : SET VALUE : BASICSHIPDELIVERYNOTE : $$Number:$SyDcNo
    390 : SET TARGET : ..

    400 : Insert Collection Object : INVOICEORDERLIST
    410 : SET VALUE : BASICORDERDATE : @@INVDATE
    420 : SET VALUE : BASICPURCHASEORDERNO : $$Number:$SyOrderNo
    430 : SET TARGET : ..

    440 : Insert Collection Object : Ledger Entries
    450 : SET TARGET : LedgerEntries
    460 : SET VALUE : LedgerName : $SyPartyName
    470 : SET VALUE : Amount : -1* ($$TgtObject:($$AsAmount:##SyInvAmt))
    480 : SET VALUE : ISDEEMEDPOSITIVE : "Yes"
    490 : SET VALUE : ISPARTYLEDGER : "Yes"
    500 : SET VALUE : ISLASTDEEMEDPOSITIVE: "Yes"

    510 : Insert Collection Object : BillAllocations
    520 : SET VALUE : Name : $$TgtObject:$$String:##SyInvNo
    530 : SET VALUE : BillType : "New Ref"
    540 : SET VALUE : Amount : -1 * ($$TgtObject:($$AsAmount:##SyInvAmt))
    ;541 : Log : ##SyInvAmt
    550 : Set Target : ..

    560 : Set : BillNo : $SyInvNo
    ;570 : Msg Box : "BillNo" : ##BillNo
    580 : Walk Collection : Sy Import Coll Rep
    590 : Set : SySalesQty : $$String:$SyQty
    600 : Set : SySalesRate : $$String:$SyRate
    610 : Set : SySalesAmt : $$String:$SyAmt
    ;611: Log : $SyAmt

    620 : INSERT COLLECTION OBJECT : ALLINVENTORYENTRIES
    630 : SET VALUE : STOCKITEMNAME : $SyItemName
    640 : SET VALUE : ISDEEMEDPOSITIVE : "No"
    650 : SET VALUE : ACTUALQTY : $$TgtObject:$$AsQty:##SySalesQty * -1
    660 : SET VALUE : BILLEDQTY : $$TgtObject:$$AsQty:##SySalesQty * -1
    670 : SET VALUE : RATE : $$TgtObject:$$AsRate:##SySalesRate ;* -1
    680 : SET VALUE : Amount : $$TgtObject:$$AsAmount:##SySalesAmt
    ; 681 : Log : ##SySalesAmt

    690 : INSERT COLLECTION OBJECT : BATCH ALLOCATIONS
    700 : SET VALUE : GODOWNNAME : "Kaba Plaza"
    710 : SET VALUE : BatchName : $$String:##SyBatName
    720 : SET VALUE : Amount : $$TgtObject:$$AsAmount:##SySalesAmt
    730 : SET VALUE : ActualQty : $$TgtObject:$$AsQty:##SySalesQty * -1
    740 : SET VALUE : BilledQty : $$TgtObject:$$AsQty:##SySalesQty * -1
    750 : SET TARGET : ..

    760 : Insert Collection Object : ACCOUNTINGALLOCATIONS
    770 : SET VALUE : LedgerName : $SySalesLedg
    780 : SET VALUE : Amount : ($$TgtObject:($$AsAmount:##SySalesAmt))
    790 : SET VALUE : ISDEEMEDPOSITIVE : "No"
    800 : SET VALUE : ISLASTDEEMEDPOSITIVE : "No"
    810 : SET VALUE : TAXCLASSIFICATIONNAME : $SyVatLed
    ;820 : SET TARGET : ..
    830 : Insert Collection Object : CATEGORYALLOCATIONS
    840 : Set Value : Category : "Primary Cost Category"
    850 : Set Value : ISDEEMEDPOSITIVE : "No"
    860 : Insert Collection Object : COSTCENTREALLOCATIONS
    870 : Set Value : Name : $$String:$SyNameCC
    880 : Set Value : Amount : /*-1 * */ ($$TgtObject:($$AsAmount:##SySalesAmt)) ;;$$ASAmount:$SyCCAmt
    ; 881 : Log : ##SySalesAmt
    890 : SET TARGET : ..

    900 : END WALK

    /************ Ledger Entries ****************/

    910 : Insert Collection Object : Ledger Entries
    920 : SET TARGET : LedgerEntries
    930 : SET VALUE : LedgerName : "Frieght Outwards"
    940 : SET VALUE : Amount : ($$TgtObject:($$AsAmount:##SyFrChrgs))
    950 : SET VALUE : ISDEEMEDPOSITIVE : "No"
    ;951 : Log : ##SyFrChrgs
    960 : SET TARGET : ..

    970 : Insert Collection Object : Ledger Entries
    980 : SET TARGET : LedgerEntries
    990 : SET VALUE : LedgerName : "VAT Exempted"
    1000 : SET VALUE : Amount : ($$TgtObject:($$AsAmount:##SyLocalSales))
    1010 : SET VALUE : ISDEEMEDPOSITIVE : "No"
    1020 : SET TARGET : ..

    1030 : Insert Collection Object : Ledger Entries
    1040 : SET TARGET : LedgerEntries
    1050 : SET VALUE : LedgerName : "CST Exempted"
    1060 : SET VALUE : Amount : ($$TgtObject:($$AsAmount:##SyInterStSls))
    1070 : SET VALUE : ISDEEMEDPOSITIVE : "No"
    1080 : SET TARGET : ..

    1090 : Insert Collection Object : Ledger Entries
    1100 : SET TARGET : LedgerEntries
    1105 : SET VALUE : TAXCLASSIFICATIONNAME : "Output VAT @ 5%"
    1110 : SET VALUE : LedgerName : "OutPut VAT@5%"
    1120 : SET VALUE : Amount : -1 * ($$TgtObject:($$AsAmount:##SyVat5))
    1121 : SET VALUE : VATASSESSABLEVALUE: -1 * ($$TgtObject:($$AsAmount:##SySalesAmt))
    1122 : SET VALUE : PREVAMOUNT : ($$TgtObject:($$AsAmount:##SyVat5))
    1123 : SET VALUE : PREVINVTOTALAMT : ($$TgtObject:($$AsAmount:##SySalesAmt))
    1130 : SET VALUE : ISDEEMEDPOSITIVE : "No"
    1140 : SET TARGET : ..

    1150 : Insert Collection Object : Ledger Entries
    1160 : SET TARGET : LedgerEntries
    1165 : SET VALUE : TAXCLASSIFICATIONNAME : "Interstate Sales @ 2% Against Form C"
    1170 : SET VALUE : LedgerName : "OutPut CST@2%";;"Out Put Cst 2%"
    1180 : SET VALUE : Amount : -1 *($$TgtObject:($$AsAmount:##SyCST2))
    1181 : SET VALUE : VATASSESSABLEVALUE: -1 * ($$TgtObject:($$AsAmount:##SySalesAmt))
    1182 : SET VALUE : PREVAMOUNT : ($$TgtObject:($$AsAmount:##SyCST2))
    1183 : SET VALUE : PREVINVTOTALAMT : ($$TgtObject:($$AsAmount:##SySalesAmt))
    1190 : SET VALUE : ISDEEMEDPOSITIVE : "No"
    1200 : SET TARGET : ..

    1210 : Insert Collection Object : Ledger Entries
    1220 : SET TARGET : LedgerEntries
    1225 : SET VALUE : TAXCLASSIFICATIONNAME : "Interstate Sales @ 5%"
    1230 : SET VALUE : LedgerName : "OutPut CST@5%";;"OUTPUT CST 5%"
    1240 : SET VALUE : Amount : -1 * ($$TgtObject:($$AsAmount:##SyCST5))
    1241 : SET VALUE : VATASSESSABLEVALUE: -1 * ($$TgtObject:($$AsAmount:##SySalesAmt))
    1242 : SET VALUE : PREVAMOUNT : ($$TgtObject:($$AsAmount:##SyCST2))
    1243 : SET VALUE : PREVINVTOTALAMT : ($$TgtObject:($$AsAmount:##SySalesAmt))
    1250 : SET VALUE : ISDEEMEDPOSITIVE : "No"
    ;1251 : Log : ##SyCST5
    1260 : SET TARGET : ..

    1280 : SET : SyAMT : $$AsAmount:0
    1290 : SET VALUE : PersistedView : ##SVViewName
    ; 1300 : Log Object
    ; 1310 : Log Target
    ; 1320 : Exec Command : "tdlfunc.log"
    1330 : CREATE TARGET
    1340 : SHOW PROGRESS : ##ProgressCount
    1350 : SET : ProgressCount : ##ProgressCount + 1
    1360 : End If
    1370 : END WALK
    1380 : Increment : Counter
    1390 : Msg Box : "Status" : "Sales Vouchers Imported \n successfully!!! "
    1400 : RETURN
     


  2. karthik loganadin

    karthik loganadin New Member


    Hi,
    Did you found the error?. If possible, could you please share it.

    regards
    Karthik
     


  3. sivam

    sivam Active Member


    Declare SySalesQty Variable as Number and Use it.
     


  4. karthik loganadin

    karthik loganadin New Member


    Thanks Mr. NallaSivam.

    For the line 580 : Walk Collection : Sy Import Coll Rep ,
    where the invoice number is passed?
    Please advice.

    Regards
    Karthik
     


  5. gone

    gone New Member


    Hi,
    Above given code adding patry address like below, It's not working
    Set Value : BASICBUYERADDRESS :$$FullList:ADDRESS:Ledger:$Party
    Please advise.
    regards,
    Krishna
     
    Last edited: Jan 6, 2020


Share This Page