Dear Experts Seek Help Regarding Manufacturing Journal AutoPost

Discussion in 'Free Source Codes' started by Aslan Iglesias, Jul 16, 2020.

    
  1. Aslan Iglesias

    Aslan Iglesias New Member


    I have written a code for auto generation of Manufacturing Journal but its is showing No entries in Voucher although values to be set are shown in the log, could you please guide me why is it happening?
    The code is attached Below:




    [Collection:MultipleEntryManuJrnlColl]
    Source Collection : ..
    Walk : MultipleItemEntryAggr
    Fetch : *.*,*
    Compute : FinItemNew : $FinItem
    Compute : FinQtyNew : $FinQty

    [Collection:MultipleEntryManuJrnlColl1]
    Source Collection : MultipleEntryManuJrnlColl
    Walk : RawMaterialAggr
    Fetch : FinItemNew,FinQtyNew
    Fetch : *.*,*,FinItemInRawMat
    Filter : WithSameProdName

    [System:Formulae]
    WithSameProdName:$FinItemNew=##FinItemVar
    Capture.JPG
    [Function: MultipleEntryManuJrnlFunc]
    Variable : FinItemVar : String
    Variable : FinItemQtyVar : String
    Variable : RawMaterialVar : String
    Variable : RawMaterialQtyVar : String

    000 : Walk Collection : MultipleEntryManuJrnlColl

    001 : Set : FinItemVar : $FinItem
    002 : Set : FinItemQtyVar : $FinQty
    002a : Log:##FinItemVar
    002b : Log:##FinItemQtyVar
    003 : NEW OBJECT : Voucher
    004 : SET VALUE : Date : #DateforVoucherLine;##SVCurrentDate
    005 : SET VALUE : VoucherTypeName : "Manufacturing Journal"
    006 : SET VALUE : IsInvoice : "No"
    007 : SET VALUE : PERSISTEDVIEW : "Multi Consumption Voucher View";##SVViewName
    008 : Set Value : DESTINATIONGODOWN : "Main Location"
    009 : Set Value : VOUCHERDESTINATIONGODOWN : "Main Location"
    010 : Set Value : VOUCHERSOURCEGODOWN : "Main Location"
    011 : Set Value : DIFFACTUALQTY : "No"
    012 : Set Value : ISMSTFROMSYNC : "No"
    013 : Set Value : ASORIGINAL : "No"
    014 : Set Value : AUDITED : "No"
    015 : Set Value : FORJOBCOSTING : "Yes"
    016 : Set Value : ISOPTIONAL : "No"
    017 : Set Value : EFFECTIVEDATE : #DateforVoucherLine


    018 : Insert Collection object : INVENTORYENTRIESIN;inventoryentriesin
    019 : Set target : INVENTORYENTRIESIN
    020 : SET VALUE : STOCKITEMNAME : $$String:##FinItemVar
    021 : Set Value : ACTUALQTY : $$TgtObject:$$AsQty:##FinItemQtyVar
    021a : Set Value : BILLEDQTY : $$TgtObject:$$AsQty:##FinItemQtyVar

    022 : Set Value : ISDEEMEDPOSITIVE : "Yes"
    023 : Set Value : ISLASTDEEMEDPOSITIVE : "Yes"
    024 : Set Value : ISSCRAP : "No"
    ;025 : Set Value : Rate : $$AsRate:""



    028 : INSERT COLLECTION OBJECT : BATCHALLOCATIONS
    029 : Set Value : GODOWNNAME : "Main Location"
    030 : Set Value : BATCHNAME : "Primary Batch"
    030a : Set Value : DYNAMICCSTISCLEARED : "No"
    031 : Set Value : ACTUALQTY : $$TgtObject:$$AsQty:##FinItemQtyVar
    032 : Set Value : BILLEDQTY : $$TgtObject:$$AsQty:##FinItemQtyVar


    033 : SET TARGET : ....

    034 : Walk Collection : MultipleEntryManuJrnlColl1
    035 : insert collection object : INVENTORYENTRIESOUT;InventoryEntriesOut
    036 : SEt TARGET : INVENTORYENTRIESOUT
    037 : Set : RawMaterialVar : $RawMaterialName
    038 : Set : RawMaterialQtyVar : $RawMaterialQty
    039 : Log:##RawMaterialVar
    039a : Log:##RawMaterialQtyVar
    040 : SET VALUE : STOCKITEMNAME : ##RawMaterialVar
    041 : SET VALUE : ACTUALQTY : -$$TgtObject:$$AsQty:##RawMaterialQtyVar
    042 : SET VALUE : BilledQty : -$$TgtObject:$$AsQty:##RawMaterialQtyVar ;($actualQty *## SSFunctonAutoJrnlNumToCal)

    043 : Set Value : ISDEEMEDPOSITIVE : "No"
    044 : Set Value : ISLASTDEEMEDPOSITIVE : "No"
    045 : Set Value : ISAUTONEGATE : "No"
    046 : Set Value : ISCUSTOMSCLEARANCE : "No"
    047 : Set Value : ISTRACKCOMPONENT : "No"
    048 : Set Value : ISTRACKPRODUCTION : "No"
    049 : Set Value : ISPRIMARYITEM : "No"
    050 : Set Value : ISSCRAP : "No"

    051 : INSERT COLLECTION OBJECT : BATCHALLOCATIONS
    052 : Set Value : GODOWNNAME : "Main Location"
    053 : Set Value : BATCHNAME : "Primary Batch"
    053a : Set Value : DYNAMICCSTISCLEARED : "No"
    054 : Set Value : ACTUALQTY : $$TgtObject:$$AsQty:##RawMaterialQtyVar
    055 : Set Value : BILLEDQTY : $$TgtObject:$$AsQty:##RawMaterialQtyVar
    ;056 : Set Target : ..
    057 : Set Target : ....
    058 : End Walk
    059 : Save Target
    060 : End Walk
     
    Md Amjad Siddiqui likes this.


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Remove 060 : End Walk
     
    Md Amjad Siddiqui likes this.


  3. Aslan Iglesias

    Aslan Iglesias New Member


    Dear Sir, I have been able to solve the same by using your method, here I was trying to generate multiple Auto Journal without BOM using entry from User for the product composition on a Screen/Report. I have made this solution . If the forum give me permission to post this solution fully , I will be happy to post it over forum for others referential purpose.
     
    Md Amjad Siddiqui likes this.


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    There is no rule prohibiting a code to be attached openly in forum. It is all as per your own choice, to share or not to share. Please feel free to exercise your own options.

    Also you can look up the FORUM Guideline on what is allowed and what is not.
     


  5. A Sam

    A Sam Member


    Pls post
     


  6. Mohan.S

    Mohan.S Member


    Found error with below

    Walk : MultipleItemEntryAggr

    Where is the aggr collection
     


  7. Mohan.S

    Mohan.S Member


    Walk : MultipleItemEntryAggr


    And

    Walk : RawMaterialAggr

    Show Error on above code

    where to define this
     


  8. Mohan.S

    Mohan.S Member


    Dear Sir,
    Where is the walk code

    Walk : MultipleItemEntryAggr

    Walk : RawMaterialAggr
     


  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Both are AGGREGATE values..... ... collection of UDFs.
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Both are AGGREGATE values..... ... collection of UDFs.
     


  11. Mohan.S

    Mohan.S Member


    Dear Sir,
    Pls see my modified code in this code The Raw material Consumption is not working. we are set the bill of material properly in Finished goods.

    upload_2021-1-6_16-58-29.png upload_2021-1-6_16-59-0.png

    upload_2021-1-6_16-59-20.png

    See below auto Manufacturing Journal generated by TDL Here Consumption are Empty
    upload_2021-1-6_17-3-34.png


    We need the below manner of entry that is correct.
    upload_2021-1-6_17-4-1.png upload_2021-1-6_16-58-29.png

    Any one have have solution for this pls share with us
    mail Id : trichytally@gmail.com
    or posting the full code here.

    see my attached code.

    Thanks in advance.


    Code:
    ;;;[#Form : Rejection Inward Color]   $$IsJobMaterialIssue:##VoucherTypeName
    
    [#Form :JobMaterial Journal Voucher]
        On :  Form Accept : $IsJobMaterialIssue: CALL : Create Auto Mfg Voucher   
    
    [Function : Create Auto Mfg Voucher]
         001 : Query Box : " Do you want to post \n Auto Manufacturing Voucher" : Yes : No
        002 : If : $$LastResult=Yes
        003 : CALL : MultipleEntryManuJrnlFunc
        004 : END if
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    [Collection:MultipleEntryManuJrnlColl]
    Source Collection : ..
    Walk : INVENTORYENTRIESIN  ;;;;MultipleItemEntryAggr
    Fetch : *.*,*
    Compute : FinItemNew : $StockitemName
    Compute : FinQtyNew  : $ActualQty
    Compute    : MfgGodown     : $VoucherSourceGodown      ;;;;   $VoucherDestinationGodown
    
    [Collection:MultipleEntryManuJrnlColl1]
    Source Collection : MultipleEntryManuJrnlColl
    Walk : MultiComponentItemList
    By:    StockItemname
    Fetch : FinItemNew,FinQtyNew
    Fetch : *.*,*
    Fetch    : ComponentListName, ComponentBasicQty
    Fetch    : MultiComponentItemList.StockitemName, MultiComponentItemList.GodownName
    Fetch    : MultiComponentItemList.ActualQty, MultiComponentItemList.AddlCostAllocPerc, MultiComponentItemList.NatureofItem
    Filter : WithSameProdName
    
    
    [System:Formulae]
    WithSameProdName:$FinItemNew=##FinItemVar
    
    
    [Function: MultipleEntryManuJrnlFunc]
    Variable : FinItemVar : String
    Variable : FinItemQtyVar : String
    Variable : ManufactGdwnVar: String
    
    Variable : RawMaterialVar : String
    Variable : RawMaterialQtyVar : String
    
    000 : Walk Collection : MultipleEntryManuJrnlColl
    
    001 : Set : FinItemVar    : $FinItemNew
    002 : Set : FinItemQtyVar : $FinQtyNew
    003 : Set : ManufactGdwnVar:$MfgGodown
     
    010 : Log:##FinItemVar
    015 : Log:##FinItemQtyVar
    016 : Log:##ManufactGdwnVar
    
    020 : NEW OBJECT : Voucher
    021 : SET VALUE : Date : $Date  ;;;;;#DateforVoucherLine;##SVCurrentDate
    022 : SET VALUE : VoucherTypeName : "Manufacturing Journal"
    023 : SET VALUE : IsInvoice : "No"
    024 : SET VALUE : PERSISTEDVIEW : "Multi Consumption Voucher View";##SVViewName
    025 : Set Value : DESTINATIONGODOWN :  "Main Location"   ;;;;##ManufactGdwnVar
    026 : Set Value : VOUCHERDESTINATIONGODOWN :"Main Location"   ;;;##ManufactGdwnVar
    027 : Set Value : VOUCHERSOURCEGODOWN : "Main Location"  ;;;; ##ManufactGdwnVar
    029 : Set Value : DIFFACTUALQTY : "No"
    030 : Set Value : ISMSTFROMSYNC : "No"
    031 : Set Value : ASORIGINAL : "No"
    035 : Set Value : AUDITED : "No"
    036 : Set Value : FORJOBCOSTING : "Yes"
    037 : Set Value : ISOPTIONAL : "No"
    038 : Set Value : EFFECTIVEDATE : $date ;;#DateforVoucherLine
    
    045 : Insert Collection object : INVENTORYENTRIESIN       ;inventoryentriesin
    046 : Set target: INVENTORYENTRIESIN
    050 : SET VALUE : STOCKITEMNAME : $$String:##FinItemVar
    051 : Set Value : BOMNAME        : $$String:"22 Ct Coper"
    052 : Set Value : Godownname    : ##ManufactGdwnVar
    053 : Set Value : ACTUALQTY : $$TgtObject:$$AsQty:##FinItemQtyVar
    054 : Set Value : BILLEDQTY : $$TgtObject:$$AsQty:##FinItemQtyVar
    
    056 : Set Value : ISDEEMEDPOSITIVE : "Yes"
    057 : Set Value : ISLASTDEEMEDPOSITIVE : "Yes"
    058 : Set Value : ISSCRAP : "No"
    ;025 : Set Value : Rate : $$AsRate:""
    
    060 : INSERT COLLECTION OBJECT : BATCHALLOCATIONS
    065 : Set Value : GODOWNNAME : "Main Location"    ;;;; ##ManufactGdwnVar
    070 : Set Value : BATCHNAME : "Primary Batch"
    075 : Set Value : DYNAMICCSTISCLEARED : "No"
    076 : Set Value : ACTUALQTY : $$TgtObject:$$AsQty:##FinItemQtyVar
    077 : Set Value : BILLEDQTY : $$TgtObject:$$AsQty:##FinItemQtyVar
    080 : SET TARGET : ....
    
    
    082 : Walk Collection : MultipleEntryManuJrnlColl1
    083 : Insert collection object : INVENTORYENTRIESOUT            ;InventoryEntriesOut
    084 : SEt TARGET : INVENTORYENTRIESOUT
    085 : Set : RawMaterialVar    : $Stockitemname
    088 : Set : RawMaterialQtyVar : $ActualQty   ;;;$RawMaterialQty
    089 : Log:##RawMaterialVar
    090 : Log:##RawMaterialQtyVar
    091 : SET VALUE : STOCKITEMNAME : ##RawMaterialVar
    092 : SET VALUE : ACTUALQTY : -$$TgtObject:$$AsQty:##RawMaterialQtyVar
    093 : SET VALUE : BilledQty : -$$TgtObject:$$AsQty:##RawMaterialQtyVar ;($actualQty *## SSFunctonAutoJrnlNumToCal)
    
    100 : Set Value : ISDEEMEDPOSITIVE : "No"
    110 : Set Value : ISLASTDEEMEDPOSITIVE : "No"
    115 : Set Value : ISAUTONEGATE : "No"
    120 : Set Value : ISCUSTOMSCLEARANCE : "No"
    125 : Set Value : ISTRACKCOMPONENT : "No"
    130 : Set Value : ISTRACKPRODUCTION : "No"
    135 : Set Value : ISPRIMARYITEM : "No"
    140 : Set Value : ISSCRAP : "No"
    /*
    151 : INSERT COLLECTION OBJECT : BATCHALLOCATIONS
    152 : Set Value : GODOWNNAME : "Main Location"
    153 : Set Value : BATCHNAME : "Primary Batch"
    154 : Set Value : DYNAMICCSTISCLEARED : "No"
    155 : Set Value : ACTUALQTY : $$TgtObject:$$AsQty:##RawMaterialQtyVar
    165 : Set Value : BILLEDQTY : $$TgtObject:$$AsQty:##RawMaterialQtyVar
    */
    167 : Set Target : ..
    ;;170 : Set Target : ...      ;;; If use Batch Emable This Close Prev Line
    180 : End Walk
    190 : End Walk
    200 : Save Target
    
    
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;        Modification In Voucher Screen
    ;;
    ;;
    
    [#Line: SJ MfdItem]
    ;;    Fields  : Info Field, MVCH StockItem, Simple Field, MVCH BOMName, MVCH BOMNameStorage, Simple Prompt, MVCH Godown, Colon Field, MVCH ActualQty, MVCH BilledQty, MfgVch BOMCompBaseQty
        Local     : Field : Simple Field : Invisible    : NO
        Local    : Field    : MVCH BOMName : Invisible    : No
     

    Attached Files:



Share This Page