Batch Allocation error while import from excel

Discussion in 'Free Source Codes' started by Mohan.S, Apr 20, 2021.

    
  1. Mohan.S

    Mohan.S Member


    We are writing code for Import data from excel to tally.
    All the data import successfully. but Each batch number taken 1 line for import for each item

    for Ex:
    Item 1 has 10 Batch number this is imported in 10 lines each qty one.

    i need the item name is need to import 1 line and the Batch details are required to import in batch allocation screen repeatedly each one qty/
    any one having solution solve the issue.


    See below the code:


    48 : NEW OBJECT : Voucher
    49 : Set Value : Date : $$String:$ExcelVchDate ;;;;;;$$Date:(($$StringPart:$ExcelVchDate:8:2 +"/"+ $$StringPart:$ExcelVchDate:5:2 + "/"+$$StringPart:$ExcelVchDate:0:4)) ;;"1-Apr-2012" ;;$Date

    50 : SET VALUE : VoucherTypeName : "Purchase" ;;$$VchTypeRcptNote

    51 : SET VALUE : IsInvoice : YES
    52 : SET : SVViewName : $$SysName:InvVchView
    53 : SET VALUE : PERSISTEDVIEW : ##SVViewName
    59 : Set Value : Vouchernumber : $ExcelVchNumber
    60 : SET VALUE : Reference : $SupInvno
    61 : SET VALUE : ReferenceDate : $$String:$SupInvDate ;;;$$Date:(($$StringPart:$SupInvDate:8:2 +"/"+ $$StringPart:$SupInvDate:5:2 + "/"+$$StringPart:$SupInvDate:0:4))

    70 : WALK COLLECTION : EDPurCollDetailsExtract

    71 : INSERT COLLECTION OBJECT : ALLINVENTORYENTRIES
    72 : Set Target : ALLINVENTORYENTRIES[$$LoopIndex]
    73 : SET VALUE : StockItemName : $Item
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    81 : IF : $$IsEmpty:$Name:StockItem:$Item
    82 : Call: PurStockImport
    83 : End If
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    131 : SET : QtyVar : $$String:$ExQty ;; $ItemQty ;;;;
    ;; 101 : Set : DiscVar : $$String:$ExDisc
    132 : SET : RateVar : $$String:$ExRate
    134 : SET : AmtVar : $$String:$ExAmt
    140 : SET VALUE : ActualQty : $$TgtObject:$$AsQty:##QtyVar * -1
    150 : SET VALUE : BilledQty : $$TgtObject:$$AsQty:##QtyVar * -1
    151 : SET VALUE : Rate : $$TgtObject:$$AsRate:$$Number:##RateVar
    156 : SET VALUE : Amount : $$TgtObject:$$AsAmount:##AmtVar ;;;; * -1
    158 : SET VALUE : ISDEEMEDPOSITIVE : yes
    159 : SET : TT AMt : $$AsAmount:##TTAMt + $$AsAmount:##AmtVar
    157 : Log:$$string:##AmtVar + $$String:$Item

    160 : INSERT COLLECTION OBJECT : BATCHALLOCATIONS
    ;; 161 : Set Target : BatchAllocations[$$LoopIndex]
    162 : SET VALUE : GodownName : "Main Location"
    163 : Set Value : batchname : $Batch
    173 : SET VALUE : StockItemName : $Item
    174 : SET VALUE : ActualQty : $$TgtObject:$$AsQty:##QtyVar *- 1
    175 : SET VALUE : BilledQty : $$TgtObject:$$AsQty:##QtyVar *- 1
    176 : SET VALUE : Rate : $$TgtObject:$$AsRate:$$Number:##RateVar
    177 : SET VALUE : Amount : $$TgtObject:$$AsAmount:##AmtVar ;;;* -1
    178 : SET VALUE : IsDeemedPositive : Yes
    179 : SET TARGET : ..

    200 : INSERT COLLECTION OBJECT : ACCOUNTINGALLOCATIONS
    210 : SET VALUE : LEDGERNAME : "PURCHASE" ;;; @@SalesAc ;;; $AcName
    211 : SET VALUE : LedgerFromItem : Yes
    220 : SET VALUE : ISDEEMEDPOSITIVE : Yes
    230 : SET VALUE : AMOUNT : $$TgtObject:$$AsAmount:##AmtVar *-1 ;;;##AmtVar * -1
    ;; 230a: Log: $$String:##AmtVar + $$STring:"Purchae"
    231 : Set Value : GSTClass: "Purchase Taxable"
    240 : SET TARGET : ..
    250 : END WALK
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     

    Attached Files:

    Last edited: Apr 20, 2021


  2. Sanjeev S

    Sanjeev S Active Member


    I suppse you need to add one more set target after 179 i.e.
    179 : SET TARGET : ..
    180 : SET TARGET : ..
     


  3. BizVim IT Solutions

    BizVim IT Solutions New Member


    walk two difference collection
    walk first collection for inventoryentries by stock Item Wise
    and walk second collection for batchallcocation add filter in second collection for same item
     
    farrakh hayat likes this.


  4. Mohan.S

    Mohan.S Member


    ok sir i will try
     


  5. farrakh hayat

    farrakh hayat Member


    Hi Mohan,
    did you got solution?
     


  6. farrakh hayat

    farrakh hayat Member


    Hi Mohan,
    did you got any solution?
     


  7. PANKAJ BHONDLE

    PANKAJ BHONDLE Active Member


    Try This, 160:Insert Collection Object:Item Allocation
     


Share This Page