Get company gstn number

 Get company gstn number


    LogisticsEntityPostalAddressView        postalAddressView;
    CompanyInfo                             companyInfo;
    TaxInformation_IN                       taxInformation; 
    TaxRegistrationNumbers_IN               TaxRegistrationNumbers_IN;

    companyInfo = CompanyInfo::find();

    select postalAddressView
        where postalAddressView.Entity  ==  companyInfo.RecId
           && postalAddressView.LocationName    ==  BusinessUnit;

    if(postalAddressView)
    {
        select taxInformation
                where taxInformation.RegistrationLocation   == postalAddressView.Location
                   && taxInformation.IsPrimary  == NoYes::Yes
            join TaxRegistrationNumbers_IN
                where TaxRegistrationNumbers_IN.RecId == taxInformation.GSTIN;

           

Comments