• Sailaja N 4
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
User-added image<style type="text/css" media="print">
                @page {
                margin-left: 1cm;
                margin-right: 1cm;
                margin-top: 0.8cm;
                margin-bottom: 2cm;
                                @bottom-center {                 
                content: element(footer);              
                }
                
                @top-center {
                content: element(header);
                
                }
                }
                
                table {
                              page-break-inside: avoid; 
                
                }
                div.footer { 
                             page-break-after: avoid;
                display: block;              
                position:running(footer);
                font-size:12px;
                font-family:" sans-serif";
                }
                div.header {
                display: block;                     
                position: running(header);
                }
                            </style>


if i add "   -fs-table-paginate: paginate;" to gtable in style sheet
footer line is vanishing in all pages except first page.

Please help me on fixing this
Hi frds,

In Iphone when i scroll the screen vertically,
table data(tbody highlighted) is missing


please find the below code


<apex:page standardController="Product2" extensions="SearchProducts_v1" showHeader="false" sidebar="false" id="pageId">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  
    <script>
        function searchProducts(){
        var productName = document.getElementById('searchString').value;
        console.log('productName',productName); 
        if(productName != null && productName!= ''){
            searchProduct(productName);
            $("#invTable").empty();
            $("#errorMsg").hide();
        }else{
            console.log('productName Null'); 
            document.getElementById('errorMsg').innerText = 'ERROR : Please enter a search key to proceed.';
            $("#errorMsg").show();
        }
    }
    function searchInv(evt){
        var productId = evt.id;
        console.log('this',evt);
       
        console.log('productId',productId);  
        search(productId);
    }
    function check(){
        console.log('TEST123',"{!prod}");
       
    }
    </script>
    <apex:slds />
    <!--apex:pageMessages id="test"/-->
   
       
    <div class="slds-scrollable">
        <b><span id = 'errorMsg' style="margin-left: 7px; margin-right: 7px; margin-top: 14px;color:red;display:none"></span></b>
        <apex:form >
            <apex:actionFunction name="searchProduct" action="{!searchProduct}" rerender="panel1" status="status" onbeforedomupdate="check()">
                <apex:param name="prodName" assignTo="{!prodName}" value=""/>
            </apex:actionFunction>
            <apex:actionStatus id="status">
                <apex:facet name="start">
                    <div style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.75; z-index: 1000; background-color: black;">
                        &nbsp;
                    </div>
                    <div style="position: fixed; left: 0; top: 0; bottom: 0; right: 0; z-index: 1001;text-align:center;margin-top:300px;">
                        <img src="{!$Resource.LoadingImage}" title="Please Wait…" />
                    </div>
                </apex:facet>
            </apex:actionStatus>
            <apex:actionFunction name="search" action="{!searchInventory}" rerender="panel2" status="status1">
                <apex:param name="prodName" assignTo="{!ProductId}" value=""/>
            </apex:actionFunction>
            <apex:actionStatus id="status1">
                <apex:facet name="start">
                    <div style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.75; z-index: 1000; background-color: black;">
                        &nbsp;
                    </div>
                    <div style="position: fixed; left: 0; top: 0; bottom: 0; right: 0; z-index: 1001;text-align:center;margin-top:300px;">
                        <img src="{!$Resource.LoadingImage}" title="Please Wait…" />
                    </div>
                </apex:facet>
            </apex:actionStatus>  
            <article class="slds-card" style="margin-left: 7px; margin-right: 7px; margin-top: 10px;">
                <div class="slds-grid slds-wrap" style="width:400px;padding-bottom: 10px;padding-left: 10px;">
                    <div class="slds-col">
                        <div class="slds-form-element">
                            <label class="slds-form-element__label" for="name">Search Product</label>
                            <div class="slds-form-element__control">
                                <input class="slds-input" type="text" id="searchString"/>
                            </div>
                        </div>                              
                    </div>
                   
                    <div class="slds-col">
                        <div class="slds-form-element" style="padding-top: 20px;padding-left: 20px;">
                            <button class="slds-button slds-button--brand" type="button" onclick="searchProducts()">Go</button>
                        </div>
                    </div>
                </div>  
                <!-- Product Selection table -->
                <apex:outputpanel id="panel1"> 
                    <apex:outputpanel rendered="{!showtable1}">                   
                        <apex:repeat value="{!prod}" var="item">
                           
                            <div class="slds-grid slds-wrap" style="width: 472px;">
                                <div class="slds-col slds-size_2-of-4 slds-medium-size_6-of-12 slds-large-size_8-of-12" style="padding-left: 17px;">
                                    <span><a href="/{!item.Id}">{!item.Name}</a></span><tb/>
                                    <span>{!item.Colour_Website__c}</span>
                                </div>
                               
                                <div class="slds-col slds-size_1-of-4 slds-medium-size_6-of-12 slds-large-size_4-of-12">
                                    <apex:outputpanel rendered ="{!if(item.Inventory__r.size >0,true,false)}"> 
                                        <button class="slds-button slds-button--brand" type="button" id="{!item.Id}" onclick="searchInv(this)">Select</button>
                                        <apex:actionStatus startText="Loadinng" id="statusId" styleclass="loading"></apex:actionStatus>
                                    </apex:outputpanel>
                                </div>
                            </div><br/>
                        </apex:repeat>                                 
                    </apex:outputpanel>
                </apex:outputpanel>
            </article>
            <br/>
            <!-- Inventory Table -->
            <apex:outputpanel id="panel2"> 
                <apex:outputpanel rendered="{!showtable2}">
                    <article class="slds-card" style="margin-left: 7px; margin-right: 7px;" id="invTable">
                       
                        <div class="slds-card__header slds-grid">
                            <header class="slds-media slds-media_center slds-has-flexi-truncate">
                                <div class="slds-media__figure">
                                </div>
                                <div class="slds-media__body">
                                    <h2 class="slds-card__header-title">
                                        <span class="slds-text-heading_small">Inventory Summary</span>
                                    </h2>
                                </div>
                                <div class="slds-no-flex">
                                </div>
                            </header>
                        </div>
                          <div class="slds-card__body slds-card__body_inner visible-scrollbar ">
                                <table class="slds-table slds-table_bordered  slds-table_fixed-layout  " id="invTable">
                    <thead>
                                    <tr class="slds-text-title_caps">
                                        <th scope="col" class="slds-cell-wrap">
                                            <div class="" title="Size">Inventory Name</div>
                                        </th>
                                        <th scope="col">
                                            <div class="" title="Size">Size</div>
                                        </th>
                                        <th scope="col">
                                            <div class="" title="Availability">Availability</div>
                                        </th>
                                       
                                    </tr>
                                </thead>
                             
                                <tbody >
                                
                                    <apex:repeat value="{!invAvailabilityMap}" var="i" id="invTable">
                                        <tr class="slds-text-title_caps">
                                            <td class="slds-cell-wrap" >
                                                {!inventoryList[0].Customer_Product__r.name}
                                               
                                            </td>
                                            <td  >
                                                {!i}
                                            </td>
                                            <td >
                                                {!invAvailabilityMap[i]}
                                            </td>
                                        </tr>
                                    </apex:repeat>
                             
                                   
                                </tbody>

                            </table>
                                 </div>
                                                       
                      
                        <footer class="slds-card__footer">
                           
                        </footer>
                    </article>
                </apex:outputpanel>
            </apex:outputpanel>
        </apex:form>
    </div>
</apex:page>

please see the screen shot,red color highlighted box is missing in iphone..

first time when i click on select button,it is showing data. but when i scroll the screen up or down it is vanishing table bodyscreenshot of missing data(red color)
Hi guys,

i have an issue in my iphone,

when i cick on a button it displays vf page having table data.

when i scrol the page up or down , table data is vanishing.

table header is displayed but rows are missing

please help me how to fix it

Thank you,
Sailaja
 
OpportunityLineItem.Total_w_Tax__c -this is formula field 

getting above error in test class

please see the test class below

@isTest
private class ItemizedReceiptTest {
static testMethod void testMethodPostive(){
    Product2 prod = new Product2(
        Name = 'Test',
        IsActive = true
    );
    insert prod;
    Account acc = new Account(Name ='Test');
    insert acc;
    Opportunity testOpp = new Opportunity();
    testOpp.Name='Test Opportunity' ;
    testOpp.AccountId=acc.id;
    testOpp.StageName='Order Placed';
    testOpp.CloseDate= Date.newInstance(2019,03,28);
    insert testOpp;
    Id pricebookId = Test.getStandardPricebookId();
    //Create your pricebook entry
    PricebookEntry pbEntry = new PricebookEntry(
        Pricebook2Id = pricebookId,
        Product2Id = prod.Id,
        UnitPrice = 100.00,
        IsActive = true
    );
    insert pbEntry;
    //create your opportunity line item.  This assumes you already have an opportunity created, called opp
    OpportunityLineItem oli = new OpportunityLineItem(
        OpportunityId = testOpp.Id,
        Quantity = 5,
        PricebookEntryId = pbEntry.Id,
        TotalPrice = pbEntry.UnitPrice,
        GST__c = 7,
        PST__c = 7,
        Total_w_Tax__c = 8 // getting error here
    );
    insert oli;
    ApexPages.StandardController stdSetController = new ApexPages.StandardController(testOpp);
    ItemizedReceipt obj = new ItemizedReceipt(stdSetController);
    obj.total();

}



class

public with sharing class ItemizedReceipt {
   
    public List<OpportunityLineItem> oppLst          { set; get; } //List of Products in a Opportunity
    public Double                    totalPrice_cal  { set; get; } //Variable to calculate Total Price of all the products
    public Double                    totalGST_cal    { set; get; } //Variable to calculate GST of all the products
    public Double                    totalPST_cal    { set; get; } //Variable to calculate PST of all the products
    public Double                    totalAmt_cal    { set; get; } //Variable to calculate Total Amount of all the products
    public DateTime                  getCloseDate    { set; get; } //Variable to get the Created Date
    public String                    dayOfWeek       { set; get; } //Variable to store the Day from the Created Date
    public String                    accName         { set; get; } //Variable to store the Customer Name
   
    public  ItemizedReceipt(ApexPages.StandardController controller) {
        if ( controller.getId() != null ) {
            oppLst = [SELECT Product2.Name, Opportunity.Id, Opportunity.CloseDate, TotalPrice, GST__c, PST__c,
                      Total_w_Tax__c, Opportunity.Account.Name
                      FROM   OpportunityLineItem
                      WHERE  Opportunity.Id=:controller.getId()
                     ];
            getCloseDate = oppLst[0].Opportunity.CloseDate;
            dayOfWeek = getCloseDate.format('EEEE');
            accName = (string)oppLst[0].Opportunity.Account.Name;
            totalPrice_cal = 0.0;
            totalGST_cal = 0.0;
            totalPST_cal = 0.0;
            totalAmt_cal = 0.0;
            total();
        }
    }  
   
    //Method calculates all the totals
    public  void total() {
        for ( integer i = 0; i < oppLst.size(); i++ ) {
            totalPrice_cal += oppLst[i].TotalPrice;
            totalGST_cal   += oppLst[i].GST__c;
            totalPST_cal   += oppLst[i].PST__c;
            totalAmt_cal   += oppLst[i].Total_w_Tax__c;
        }
    }
}

 
Hi everypone,

Please help me on fixing this error in my test class

@isTest
private class ItemizedReceiptTest {
    static testMethod void testMethodPostive(){
        Product2 prod = new Product2(
            Name = 'Test',
            IsActive = true
        );
       
        insert prod;
       
        Account acc = new Account(Name ='Test');
        insert acc;
       
       
        //Create your product
        Opportunity testOpp = new Opportunity();
        testOpp.Name='Test Opportunity' ;
        testOpp.AccountId=acc.id;
        testOpp.StageName='Order Placed';
        testOpp.CloseDate= Date.newInstance(2019,03,28);
        insert testOpp;
       
        Id pricebookId = Test.getStandardPricebookId();
       
       
        //Create your pricebook entry
        PricebookEntry pbEntry = new PricebookEntry(
            Pricebook2Id = pricebookId,
            Product2Id = prod.Id,
            UnitPrice = 100.00,
            IsActive = true
           
        );
        insert pbEntry;
        //create your opportunity line item.  This assumes you already have an opportunity created, called opp
        OpportunityLineItem oli = new OpportunityLineItem(
            OpportunityId = testOpp.Id,
            Quantity = 5,
            PricebookEntryId = pbEntry.Id,
            TotalPrice = pbEntry.UnitPrice
        );
        insert oli;

        PageReference pageRef = Page.ItemizedReceipt;
        Test.setCurrentPage(pageRef);
        system.debug('Products'+prod);
           system.debug('acc'+acc);
         system.debug('testOpp'+testOpp);
         system.debug('pbEntry'+pbEntry);
         system.debug('oli'+oli);
        ApexPages.StandardController sc = new ApexPages.StandardController(testOpp);
        ItemizedReceipt obj = new ItemizedReceipt(sc);
        obj.total();

 }
   
   
}


class:


public with sharing class ItemizedReceipt {
    public List<OpportunityLineItem> oppLst          { set; get; } //List of Products in a Opportunity
    public Double                    totalPrice_cal  { set; get; } //Variable to calculate Total Price of all the products
    public Double                    totalGST_cal    { set; get; } //Variable to calculate GST of all the products
    public Double                    totalPST_cal    { set; get; } //Variable to calculate PST of all the products
    public Double                    totalAmt_cal    { set; get; } //Variable to calculate Total Amount of all the products
    public DateTime                  getCloseDate    { set; get; } //Variable to get the Created Date
    public String                    dayOfWeek       { set; get; } //Variable to store the Day from the Created Date
    public String                    accName         { set; get; } //Variable to store the Customer Name
    public  ItemizedReceipt(ApexPages.StandardController controller) {
        if ( controller.getId() != null ) {
            oppLst = [SELECT Product2.Name, Opportunity.Id, Opportunity.CloseDate, TotalPrice, GST__c, PST__c,
                             Total_w_Tax__c, Opportunity.Account.Name
                      FROM   OpportunityLineItem
                      WHERE  Opportunity.Id=:controller.getId()
                     ];
            getCloseDate = oppLst[0].Opportunity.CloseDate;
            dayOfWeek = getCloseDate.format('EEEE');
            accName = (string)oppLst[0].Opportunity.Account.Name;
            totalPrice_cal = 0.0;
            totalGST_cal = 0.0;
            totalPST_cal = 0.0;
            totalAmt_cal = 0.0;
            total();
        }
    }  
    //Method calculates all the totals
    public  void total() {
        for ( integer i = 0; i < oppLst.size(); i++ ) {
            totalPrice_cal += oppLst[i].TotalPrice;
            totalGST_cal   += oppLst[i].GST__c;
            totalPST_cal   += oppLst[i].PST__c;
            totalAmt_cal   += oppLst[i].Total_w_Tax__c;
        }
    }
}

Thank You
Hi everypone,

Please help me on fixing this error in my test class

@isTest
private class ItemizedReceiptTest {
    static testMethod void testMethodPostive(){
        Product2 prod = new Product2(
            Name = 'Test',
            IsActive = true
        );
       
        insert prod;
       
        Account acc = new Account(Name ='Test');
        insert acc;
       
       
        //Create your product
        Opportunity testOpp = new Opportunity();
        testOpp.Name='Test Opportunity' ;
        testOpp.AccountId=acc.id;
        testOpp.StageName='Order Placed';
        testOpp.CloseDate= Date.newInstance(2019,03,28);
        insert testOpp;
       
        Id pricebookId = Test.getStandardPricebookId();
       
       
        //Create your pricebook entry
        PricebookEntry pbEntry = new PricebookEntry(
            Pricebook2Id = pricebookId,
            Product2Id = prod.Id,
            UnitPrice = 100.00,
            IsActive = true
           
        );
        insert pbEntry;
        //create your opportunity line item.  This assumes you already have an opportunity created, called opp
        OpportunityLineItem oli = new OpportunityLineItem(
            OpportunityId = testOpp.Id,
            Quantity = 5,
            PricebookEntryId = pbEntry.Id,
            TotalPrice = pbEntry.UnitPrice
        );
        insert oli;

        PageReference pageRef = Page.ItemizedReceipt;
        Test.setCurrentPage(pageRef);
        system.debug('Products'+prod);
           system.debug('acc'+acc);
         system.debug('testOpp'+testOpp);
         system.debug('pbEntry'+pbEntry);
         system.debug('oli'+oli);
        ApexPages.StandardController sc = new ApexPages.StandardController(testOpp);
        ItemizedReceipt obj = new ItemizedReceipt(sc);
        obj.total();

 }
   
   
}


class:


public with sharing class ItemizedReceipt {
    public List<OpportunityLineItem> oppLst          { set; get; } //List of Products in a Opportunity
    public Double                    totalPrice_cal  { set; get; } //Variable to calculate Total Price of all the products
    public Double                    totalGST_cal    { set; get; } //Variable to calculate GST of all the products
    public Double                    totalPST_cal    { set; get; } //Variable to calculate PST of all the products
    public Double                    totalAmt_cal    { set; get; } //Variable to calculate Total Amount of all the products
    public DateTime                  getCloseDate    { set; get; } //Variable to get the Created Date
    public String                    dayOfWeek       { set; get; } //Variable to store the Day from the Created Date
    public String                    accName         { set; get; } //Variable to store the Customer Name
    public  ItemizedReceipt(ApexPages.StandardController controller) {
        if ( controller.getId() != null ) {
            oppLst = [SELECT Product2.Name, Opportunity.Id, Opportunity.CloseDate, TotalPrice, GST__c, PST__c,
                             Total_w_Tax__c, Opportunity.Account.Name
                      FROM   OpportunityLineItem
                      WHERE  Opportunity.Id=:controller.getId()
                     ];
            getCloseDate = oppLst[0].Opportunity.CloseDate;
            dayOfWeek = getCloseDate.format('EEEE');
            accName = (string)oppLst[0].Opportunity.Account.Name;
            totalPrice_cal = 0.0;
            totalGST_cal = 0.0;
            totalPST_cal = 0.0;
            totalAmt_cal = 0.0;
            total();
        }
    }  
    //Method calculates all the totals
    public  void total() {
        for ( integer i = 0; i < oppLst.size(); i++ ) {
            totalPrice_cal += oppLst[i].TotalPrice;
            totalGST_cal   += oppLst[i].GST__c;
            totalPST_cal   += oppLst[i].PST__c;
            totalAmt_cal   += oppLst[i].Total_w_Tax__c;
        }
    }
}

Thank You
OpportunityLineItem.Total_w_Tax__c -this is formula field 

getting above error in test class

please see the test class below

@isTest
private class ItemizedReceiptTest {
static testMethod void testMethodPostive(){
    Product2 prod = new Product2(
        Name = 'Test',
        IsActive = true
    );
    insert prod;
    Account acc = new Account(Name ='Test');
    insert acc;
    Opportunity testOpp = new Opportunity();
    testOpp.Name='Test Opportunity' ;
    testOpp.AccountId=acc.id;
    testOpp.StageName='Order Placed';
    testOpp.CloseDate= Date.newInstance(2019,03,28);
    insert testOpp;
    Id pricebookId = Test.getStandardPricebookId();
    //Create your pricebook entry
    PricebookEntry pbEntry = new PricebookEntry(
        Pricebook2Id = pricebookId,
        Product2Id = prod.Id,
        UnitPrice = 100.00,
        IsActive = true
    );
    insert pbEntry;
    //create your opportunity line item.  This assumes you already have an opportunity created, called opp
    OpportunityLineItem oli = new OpportunityLineItem(
        OpportunityId = testOpp.Id,
        Quantity = 5,
        PricebookEntryId = pbEntry.Id,
        TotalPrice = pbEntry.UnitPrice,
        GST__c = 7,
        PST__c = 7,
        Total_w_Tax__c = 8 // getting error here
    );
    insert oli;
    ApexPages.StandardController stdSetController = new ApexPages.StandardController(testOpp);
    ItemizedReceipt obj = new ItemizedReceipt(stdSetController);
    obj.total();

}



class

public with sharing class ItemizedReceipt {
   
    public List<OpportunityLineItem> oppLst          { set; get; } //List of Products in a Opportunity
    public Double                    totalPrice_cal  { set; get; } //Variable to calculate Total Price of all the products
    public Double                    totalGST_cal    { set; get; } //Variable to calculate GST of all the products
    public Double                    totalPST_cal    { set; get; } //Variable to calculate PST of all the products
    public Double                    totalAmt_cal    { set; get; } //Variable to calculate Total Amount of all the products
    public DateTime                  getCloseDate    { set; get; } //Variable to get the Created Date
    public String                    dayOfWeek       { set; get; } //Variable to store the Day from the Created Date
    public String                    accName         { set; get; } //Variable to store the Customer Name
   
    public  ItemizedReceipt(ApexPages.StandardController controller) {
        if ( controller.getId() != null ) {
            oppLst = [SELECT Product2.Name, Opportunity.Id, Opportunity.CloseDate, TotalPrice, GST__c, PST__c,
                      Total_w_Tax__c, Opportunity.Account.Name
                      FROM   OpportunityLineItem
                      WHERE  Opportunity.Id=:controller.getId()
                     ];
            getCloseDate = oppLst[0].Opportunity.CloseDate;
            dayOfWeek = getCloseDate.format('EEEE');
            accName = (string)oppLst[0].Opportunity.Account.Name;
            totalPrice_cal = 0.0;
            totalGST_cal = 0.0;
            totalPST_cal = 0.0;
            totalAmt_cal = 0.0;
            total();
        }
    }  
   
    //Method calculates all the totals
    public  void total() {
        for ( integer i = 0; i < oppLst.size(); i++ ) {
            totalPrice_cal += oppLst[i].TotalPrice;
            totalGST_cal   += oppLst[i].GST__c;
            totalPST_cal   += oppLst[i].PST__c;
            totalAmt_cal   += oppLst[i].Total_w_Tax__c;
        }
    }
}

 
Hi everypone,

Please help me on fixing this error in my test class

@isTest
private class ItemizedReceiptTest {
    static testMethod void testMethodPostive(){
        Product2 prod = new Product2(
            Name = 'Test',
            IsActive = true
        );
       
        insert prod;
       
        Account acc = new Account(Name ='Test');
        insert acc;
       
       
        //Create your product
        Opportunity testOpp = new Opportunity();
        testOpp.Name='Test Opportunity' ;
        testOpp.AccountId=acc.id;
        testOpp.StageName='Order Placed';
        testOpp.CloseDate= Date.newInstance(2019,03,28);
        insert testOpp;
       
        Id pricebookId = Test.getStandardPricebookId();
       
       
        //Create your pricebook entry
        PricebookEntry pbEntry = new PricebookEntry(
            Pricebook2Id = pricebookId,
            Product2Id = prod.Id,
            UnitPrice = 100.00,
            IsActive = true
           
        );
        insert pbEntry;
        //create your opportunity line item.  This assumes you already have an opportunity created, called opp
        OpportunityLineItem oli = new OpportunityLineItem(
            OpportunityId = testOpp.Id,
            Quantity = 5,
            PricebookEntryId = pbEntry.Id,
            TotalPrice = pbEntry.UnitPrice
        );
        insert oli;

        PageReference pageRef = Page.ItemizedReceipt;
        Test.setCurrentPage(pageRef);
        system.debug('Products'+prod);
           system.debug('acc'+acc);
         system.debug('testOpp'+testOpp);
         system.debug('pbEntry'+pbEntry);
         system.debug('oli'+oli);
        ApexPages.StandardController sc = new ApexPages.StandardController(testOpp);
        ItemizedReceipt obj = new ItemizedReceipt(sc);
        obj.total();

 }
   
   
}


class:


public with sharing class ItemizedReceipt {
    public List<OpportunityLineItem> oppLst          { set; get; } //List of Products in a Opportunity
    public Double                    totalPrice_cal  { set; get; } //Variable to calculate Total Price of all the products
    public Double                    totalGST_cal    { set; get; } //Variable to calculate GST of all the products
    public Double                    totalPST_cal    { set; get; } //Variable to calculate PST of all the products
    public Double                    totalAmt_cal    { set; get; } //Variable to calculate Total Amount of all the products
    public DateTime                  getCloseDate    { set; get; } //Variable to get the Created Date
    public String                    dayOfWeek       { set; get; } //Variable to store the Day from the Created Date
    public String                    accName         { set; get; } //Variable to store the Customer Name
    public  ItemizedReceipt(ApexPages.StandardController controller) {
        if ( controller.getId() != null ) {
            oppLst = [SELECT Product2.Name, Opportunity.Id, Opportunity.CloseDate, TotalPrice, GST__c, PST__c,
                             Total_w_Tax__c, Opportunity.Account.Name
                      FROM   OpportunityLineItem
                      WHERE  Opportunity.Id=:controller.getId()
                     ];
            getCloseDate = oppLst[0].Opportunity.CloseDate;
            dayOfWeek = getCloseDate.format('EEEE');
            accName = (string)oppLst[0].Opportunity.Account.Name;
            totalPrice_cal = 0.0;
            totalGST_cal = 0.0;
            totalPST_cal = 0.0;
            totalAmt_cal = 0.0;
            total();
        }
    }  
    //Method calculates all the totals
    public  void total() {
        for ( integer i = 0; i < oppLst.size(); i++ ) {
            totalPrice_cal += oppLst[i].TotalPrice;
            totalGST_cal   += oppLst[i].GST__c;
            totalPST_cal   += oppLst[i].PST__c;
            totalAmt_cal   += oppLst[i].Total_w_Tax__c;
        }
    }
}

Thank You