Sales Master Import

Discussion in 'Tally Integration' started by Partha Mondal, Apr 14, 2021.

    
  1. Partha Mondal

    Partha Mondal Member


    Dear All member,

    Getting error in my TDL. When Import sales transaction from excel.
    can anyone help me.

    Thanks in advance.

    ;;;; Shri Ganeshji

    [#Menu : GateWay of Tally]

    Key Item : Sales (Master) Import : K : Execute : Rpt_Ledgermaster_Import

    [Report : Rpt_Ledgermaster_Import] ;; Auto Report

    Form : Frm_Ledgermaster_Import
    Title : $$LocaleString:"Sales Master Import"
    Auto : Yes

    [Form: Frm_Ledgermaster_Import]

    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 : Part_Ledgermaster_Import_Title, Part_Ledgermaster_Import_Details
    On : Form Accept : Yes : CALL : Func_ImportMain
    ;On : Export Object : $$IsStockItem :Call: D ontover r ideExi s tingItem

    Local : Field : Fld_Import_FileName : Modifies : Var_SVExcelPath : Yes
    Local : Field : Fld_Import_FileName : Variable : Var_SVExcelPath

    [Part: Part_Ledgermaster_Import_Title]

    Lines : Line_Ledgermaster_Imports, Line_Ledgermaster_Imports_Info

    [Line: Line_Ledgermaster_Imports]

    Fields : Form Sub Title
    Space Bottom : 0.25
    Local : Field : Form Sub Title : Info : $$LocaleString:"Sales Master Import"

    [Line: Line_Ledgermaster_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: Part_Ledgermaster_Import_Details]

    Lines : Line_Import_FileName

    [Line: Line_Import_FileName]

    Field : Medium Prompt, Fld_Import_FileName
    Local : Field : Medium Prompt : Info : $$LocaleString:"Import File Name (XLS / XLSX) :"

    [Field: Fld_Import_FileName]

    Use : Name Field
    Width : @@NarrWidth
    Set as : "F:\Salesdemo.xlsx"
    Full Width : Yes


    [Variable: Var_SVExcelPath]

    Type : String
    Default : ""
    Persist : Yes

    [System: Variable]

    Var_SVExcelPath : ""

    [System: Formula]

    ExcelFilePath : ##Var_SVExcelPath

    [Collection : SalesMaster_Excel_Coll]
    ODBC : "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ= " + @@ExcelFilePath
    SQL : "Select * from [Sheet1$]"
    SQLObject : PMSales Object
    Client Only : Yes

    [System : Formula]
    INVOICEDATE : $$Date:(($$StringPart:$SyInvDt:8:2) + "-" + +
    ($$StringPart:$SyInvDt:5:2)+ "-" + +
    ($$StringPart:$SyInvDt:0:4))
    SyFilter: $PMInvoiceNo = ##InvoiceNo

    [Object : PMSales Object]

    PMInvoiceNo: $_2
    PMInvDate: $_4
    PMInvType: $_5
    PMPartyName: $_6
    PMItemName: $_21
    PMActualQty: $_33
    PMBilledQty: $_35
    PMItemRate: $_38

    [Collection : Excel_Source_Coll]
    Source Collection : SalesMaster_Excel_Coll

    Compute : PMInvoiceNo: $_2
    Compute : PMInvDate: $_4
    Compute : PMInvType: $_5
    Compute : PMPartyName: $_6
    Compute : PMItemName: $_21
    Compute : PMActualQty: $_33
    Compute : PMBilledQty: $_35
    Compute : PMItemRate: $_38

    [Function:Func_ImportMain]

    Variable : Counter : Number : 2
    Variable : ProgressCount : Number

    Variable : InvoiceNo : String
    Variable : InvDate : Date
    Variable : PMBilledQty : String
    Variable : PMActualQty : String

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

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

    60 : START PROGRESS : ($$NumItems:SalesMaster_Excel_Coll) : "Importing" : " Sales Vouchers"

    70 : WALK COLLECTION :SalesMaster_Excel_Coll

    71 : Set : PMActualQty : $$String:$PMActualQty
    72 : Set : PMBilledQty : $$String:$PMBilledQty

    80 : If : $$LastResult
    ;66 : Log:$$SysInfo:ipaddress
    90 : SET : SVViewName : $$SysName:InvVchView

    100 : NEW OBJECT : Voucher
    110 : SET VALUE : Date : $PMInvDate ;@@INVOICEDATE
    120 : SET VALUE : VoucherTypeName : $$VchTypeSales
    140 : SET VALUE : PARTYNAME : $PMPartyName
    150 : SET VALUE : VOUCHERNUMBER : $PMInvoiceNo

    170 : SET VALUE : PARTYLEDGERNAME : $PMPartyName
    180 : SET VALUE : BASICBASEPARTYNAME : $PMPartyName
    190 : SET VALUE : BASICBUYERNAME : $PMPartyName

    260 : SET VALUE : ISINVOICE : Yes

    261 : INSERT COLLECTION OBJECT : InventoryEntries
    262 : SET VALUE : STOCKITEMNAME : $PMItemName
    263 : SET VALUE : ISDEEMEDPOSITIVE : "No"
    264: SET VALUE : ActualQty : $$AsQty:##PMActualQty
    265: SET VALUE : BilledQty : $$AsQty:##PMBilledQty

    280 : Set Target: ..

    ;00 : Log:$$SysInfo:Ipaddress
    298 : End If
    299 : Show Progress : ##Counter
    300 : Increment : Counter
    320 : End Walk
    330 : End Progress Error.jpg
     


Share This Page