How to Get Difference Between two Field in Select Mode

Discussion in 'Tally Developer' started by Sohail Khan, Dec 28, 2020.

    
  1. Sohail Khan

    Sohail Khan Member


    Dear Experts,
    Please help me in getting the difference Quantity Between Two Quantity Fields in Select Mode.
    Thank You.

    Code:
    [#Line  : DB Title]
    Add:Right Fields:Before:DSP MainDateTitle:BillSelectedQuantity, BillsSelectedActQty, Difference
    [Field : BillSelectedQuantity]
      Use : Name Field
      Set as  :if @@InselectMode Then $$String:@SelectedTotal + $$String:@SelectedTotalQty Else ""
      Width  : 20
      Align  : Centre
      SelectedTotal    : $$LocaleString:"Bills Selected for : "
      SelectedTotalQty  : $$String:##SelectedLineVariable2
      Invisible  :  ##IsVoucherregister
      [Field : BillsSelectedActQty]
      Use : Name Field
      Set as  :if @@InselectMode1 Then $$String:@SelectedTotal + $$String:@SelectedTotalQty  Else ""
      Width  : 20
      Align  : Centre
      SelectedTotal    : $$LocaleString:"Actual Qty :"
      SelectedTotalQty  : $$String:##SelectedLineVariable3
      Invisible  :  ##IsVoucherregister
      [Field : Difference]
      Use : Name Field
      Set as  :if @@InselectMode1 Then $$String:@SelectedTotal + $$String:@SelectedTotalDiff else ""
      Width  : 20
      Align  : Centre
      SelectedTotal    : $$LocaleString:"Difference :"
      SelectedTotalDiff  : $$String:@@Difference
      Invisible  :  ##IsVoucherregister
      [System:Formula]
      Difference: #BillsSelectedActQty-#BillSelectedQuantity
    
     
    Last edited: Jan 1, 2021


  2. Himanshu-2002

    Himanshu-2002 Active Member


    Convert the qty in number and Subtract it

    Example
    Set as:( $$Number:$ActualQty) - ($$Number:$BilledQty)
     
    Sohail Khan likes this.


  3. Sohail Khan

    Sohail Khan Member


    Thank You. I solved it by using this Set as:($$Number:##SelectedLineVariable3) - ($$Number:##SelectedLineVariable2).
     


  4. Sohail Khan

    Sohail Khan Member


    How Do I make Field: Difference Invisible if the There is no Value in Actual Qty Field.
    I have tried.
    Invisible: $$IsSales:##VoucherTypeName Or $$IsEmpty:##SelectedLineVariable3
    Invisible: $$IsSales:##VoucherTypeName Or $$IsEmpty:$ActQty


    [#Line : DB Title]
    Add:Right Fields:Before:DSP MainDateTitle:BillSelectedQuantity, BillsSelectedActQty, Difference

    [Field : BillSelectedQuantity]
    Use : Name Field
    Set as :if @@InselectMode Then $$String:mad:SelectedTotal + $$String:mad:SelectedTotalQty Else ""
    Width : 20
    Align : Centre
    SelectedTotal : $$LocaleString:"Bills Selected for : "
    SelectedTotalQty : $$String:##SelectedLineVariable2
    Invisible : ##IsVoucherregister
    [Field : BillsSelectedActQty]
    Use : Name Field
    Set as :if @@InselectMode1 Then $$String:mad:SelectedTotal + $$String:mad:SelectedTotalQty Else ""
    Width : 20
    Align : Centre
    SelectedTotal : $$LocaleString:"Actual Qty :"
    SelectedTotalQty : $$String:##SelectedLineVariable3
    Invisible : ##IsVoucherregister
    [Field : Difference]
    Use : Name Field
    Set as: if @@InselectMode Then @SelectedTotal + @SelectedTotalDiff else ""
    Width : 20
    Align : Centre
    SelectedTotal : $$LocaleString:"Difference :"
    SelectedTotalDiff : $$String:(($$Number:##SelectedLineVariable3) - ($$Number:##SelectedLineVariable2))
    Invisible : $$IsSales:##VoucherTypeName Or $$IsEmpty:$$Value:##SelectedLineVariable3
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Try......... AND instead of OR
     


  6. Sohail Khan

    Sohail Khan Member


    ok Solved by Using this. Thank You.
    [Field : Difference]
    Use : Name Field
    Set as: if @@InselectMode Then @SelectedTotal + @SelectedTotalDiff else ""
    Width : 20
    Align : Centre
    SelectedTotal : IF $$IsEmpty:##SelectedLineVariable3 Then "" Else $$LocaleString:"Difference :"
    SelectedTotalDiff : IF $$IsEmpty:##SelectedLineVariable3 Then "" Else $$String:(($$Number:##SelectedLineVariable3) - ($$Number:##SelectedLineVariable2))
    Invisible : $$IsSales:##VoucherTypeName
     


Share This Page