Need Help in code for data fetching

Discussion in 'Free Source Codes' started by VISHNU RATHI, Apr 5, 2021.

    
  1. VISHNU RATHI

    VISHNU RATHI Member


    Dear Members,

    I have written code to print specific lines in Invoice priniting.

    but i need is, if HSN Code for stock item is, for example 1 then "Vishnu" should appear else "XYZ" should appear.

    Code is :

    [#Part: EXPINV Column]
    Lines : EXPINV Column1, Testvis, Testvis2, EXPINV Column2

    [Line:TestVis]
    Field:testvis1

    [Field:testvis1]
    Indent:0.6 cm
    Set as:"Vishnu"
    Style:Normal Bold
    Invisible:if @@issales then no else yes

    [Line:testvis2]
    Field:testvis2

    [Field:testvis2]
    Indent:1 cm
    Set as:"XYZ"
    Style:Normal Bold
    Invisible:if @@issales then no else yes
     


  2. VISHNU RATHI

    VISHNU RATHI Member


    *HSN Code for First Stock Item in list.
     


  3. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    The Line you are adding is in TITLE Columns........

    The condition you want is in DATA Line.......... how it is gonna work ???? Logically??

    What if Item 1 has HSN code as 1 and other Items has other numbers????
     
    Samiksha likes this.


  4. VISHNU RATHI

    VISHNU RATHI Member


    Dear sir,
    in data line it is picking up serial number, that's why added line in title.

    In a single invoice i have only one HSN code items.
    or is it possible to get value from 1st stock item HSN in bill if it has more items.?
    can you guide me sir.

    Thanks and Regards.
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You are going in a reverse manner.....

    It is like going to medical to buy medicines and THEN going to Doctor for examination.

    You can make a collection of all the Stockitems you have entered or USE the built-in "InventoryEntries" to obtain the HSN code of the first Item and then accordingly you can set the SETAS in the Title Field. You need to add only 1 Field...........no need of 2.
     
    VISHNU RATHI likes this.


  6. VISHNU RATHI

    VISHNU RATHI Member


    Sir i am new to coding world, tried and unable to fetch hsn value of first stock item,
    can you please guide me with little code.?
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    What you are trying to do?? cannot understand your requirement.

    In your code, you are Adding a LINE......the Column heading has 2 lines and you are adding 2 more.
    You said it is picking a number? How? How ill it pick a number when you have hard coded the SET AS as either Vishnu or XYZ?

    Also show what you have done / tried till now and we can guide you.
    Show screenshots with explanations and also submit your code as made/tried?

    We cannot make full code. This is a learning / training site, so you have to learn and grow.
     
    VISHNU RATHI likes this.


  8. VISHNU RATHI

    VISHNU RATHI Member


    ;; Sir i have tried this code , HSN Code is also coming, but it is picking up first HSN code, want to get last HSN for that stock item,

    [#Part: EXPINV Column]
    Lines : EXPINV Column1, Testvis, Testvis2, EXPINV Column2

    [Line:TestVis]
    Field:testvis1

    [Field:testvis1]
    Indent:0.6 cm
    Set as:mad:@hsntestvis
    Style:Normal Bold
    ;Invisible:if @@hsntestvis="84248200" then no else Yes

    [Line:testvis2]
    Field:testvis2

    [Field:testvis2]
    Indent:0.6 cm
    Set as:"XYZ"
    Style:Normal Bold
    Invisible:if @@hsntestvis="84248200" then no else yes

    [Collection:Inventory Entries]

    [System:Formula]
    hsntestvis:$$CollectionField:$HsnCode:last:GstDetails:StockItem:mad:@vishnu
    vishnu:if NOT $$IsSysName:$StockItemName then @@InvItemName else ""
     

    Attached Files:



  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    In the HSN/SAC Column .... it is showing, then why you need this?
     


  10. VISHNU RATHI

    VISHNU RATHI Member


    To Use a condition, if HSN is for eg. XYZ then Invisible yes else no,

    but from this collectionfield , LAST hsn code is not picking for that stock item,
    $$CollectionField:$HsnCode:last:GstDetails:StockItem:mad:@vishnu

    can you guide me , how to get last HSN Code?
     


  11. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You can use the same condition in the in-built HSN/SAC column.
     


  12. VISHNU RATHI

    VISHNU RATHI Member


    Sir, Can you guide me Part Name or Line Name for HSN/SAC column?
    I was unable to find that.
     


Share This Page