function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
34213421 

SAle Price not showing as intented

I have an Invoice Object which had a package of differerent line items. I ahve one line item which says credit which needs to be subtracted from the actual sale of product.

I have 2 issues with this
1. The credit line item is duplicated
2. The sale price is showing up as the total price after discounted on all the line items
 
<td class="text-center">

 <apex:outputField value="{!line.Sale_Price__c}" rendered="{!!line.Item__r.Ignore_Items _on_Inv__c}"/> 

<apex:outputText value="{0, number, $#,###,###.00}" rendered="{!line.Item__r.Ignore_Items_on_Inv__c}">

 <apex:param value="{!totalSalePricePackageItems}" />

 </apex:outputText> <apex:outputField value="{!line.Sale_Price__c}" rendered="{!line.Description__c =='Credit '}"/> 

<apex:outputText value="{0, number, $#,###,###.00}" rendered="{!line.Description__c == 'Credit'}"> <apex:param value ="{!totalPackageItem}"/>

 </apex:outputText> 
</td>
Controller
for(Line__c LineRec : LineList) { 

if(LineRec.Subtotal__c != null) 

FilteredSubTotal += LineRec.Subtotal__c;

 if (LineRec.Item__r.Ignore_tems_on_Inv__c) { 

if(LineRec.Description__c != 'Credit' && LineRec.Description__c != 'Solutions'){ 

tempInvoiceLineList.add(LineRec); totalSalePricePackageItems += LineRec.Sale_Price__c; 
} 

else if(LineRec.OrderApi__Line_Description__c == 'Solutions'){ tempInvoiceLineList.add(LineRec); 
totalSalePricePackageItems = LineRec.Sale_Price__c; 
} 

if (LineRec.Description__c == 'Credit ')
{
 if(LineRec.Sale_Price__c!= 0.00)
{ 
tempInvoiceLineList.add(LineRec); totalPackageItem = LineRec.Sale_Price__c; 
} } } }
​​