From f50c0ec115e25dc7f980bafda8169ed5ddfe1a8f Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 08 四月 2022 21:04:16 +0800
Subject: [PATCH] Session
---
force-app/main/default/pages/QuotePDF.page | 368 +++++++++++++++++++++------------------------------
1 files changed, 153 insertions(+), 215 deletions(-)
diff --git a/force-app/main/default/pages/QuotePDF.page b/force-app/main/default/pages/QuotePDF.page
index d8564a8..0248eda 100644
--- a/force-app/main/default/pages/QuotePDF.page
+++ b/force-app/main/default/pages/QuotePDF.page
@@ -1,225 +1,163 @@
-<apex:page standardController="Quote" extensions="QuotePDFExtensionController" showHeader="false" sidebar="false" renderAs="pdf" action="{!startQuote}">
-<apex:stylesheet value="{!URLFOR($Resource.quotepdf)}"/>
+<apex:page Controller="QuotePDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" renderAs="pdf">
<head>
-
-<style>
-
-</style>
-
+ <style>
+ @page {
+ size: A4;
+ margin: 1mm 1mm 1mm 1mm;
+ }
+ </style>
</head>
+<body style="font-family: Arial Unicode MS; page-break-inside: auto">
+ <table border="0" width="100%" style="border-collapse: collapse;">
+ <tr>
+ <td style="text-align:right;">{!quoteInfo.quoteDate}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;">{!$ObjectType.Quote.label}#{!quoteInfo.quoteNo}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;">{!$Label.Label_Total_pages}锛歿!pageCnt}</td>
+ </tr>
+ <tr>
+ <td style="text-align:left;">{!$Label.Label_From}锛歿!quoteInfo.dealerName}</td>
+ </tr>
+ <tr>
+ <td style="text-align:left;">{!$ObjectType.Contact.label}锛歿!quoteInfo.dealerContactName} {!$ObjectType.Contact.fields.MobilePhone.label}锛歿!quoteInfo.dealerContactPhone}</td>
+ </tr>
+ <tr>
+ <td style="text-align:left;">{!$ObjectType.Account.fields.Address1__c.label}锛歿!quoteInfo.dealerAddress}</td>
+ </tr>
+ <tr>
+ <td style="text-align:left;">{!$ObjectType.Contact.fields.Phone.label}锛歿!quoteInfo.dealerPhone} {!$ObjectType.Contact.fields.Fax.label}锛歿!quoteInfo.dealerFax}</td>
+ </tr>
+ <tr>
+ <td style="text-align:left;">{!$ObjectType.Contact.fields.Email.label}锛歿!quoteInfo.dealerEmail}</td>
+ </tr>
+ <tr>
+ <td style="text-align:left;"> </td>
+ </tr>
+ <tr>
+ <td style="text-align:left;">{!$Label.Label_To}锛歿!quoteInfo.accountName}</td>
+ </tr>
+ <tr>
+ <td style="text-align:left;">{!quoteInfo.accountContactName}</td>
+ </tr>
+ <tr>
+ <td style="text-align:left;">{!$ObjectType.Contact.fields.Phone.label}锛歿!quoteInfo.accountContactPhone} {!$ObjectType.Contact.fields.Email.label}锛歿!quoteInfo.accountContactEmail}</td>
+ </tr>
+ </table>
-<body style="font-family: Arial Unicode MS;">
+ <br/>
+ Quotation Sheet(Quotation #{!quoteInfo.quoteNo})<br/>
- <!-- 銉氥兗銈哥暘鍙枫伄瀹氱京 -->
- <apex:variable var="count" value="{!0}"/>
-
- <!-- 銉氥兗銈搞伄銉償銉笺儓 -->
- <apex:repeat value="{!printRecords}" var="items" id="thePage">
+ <table border="1" width="100%" style="border-collapse: collapse;table-layout: fixed;">
+ <colgroup>
+ <col width="10%" />
+ <col width="60%" />
+ <col width="10%" />
+ <col width="20%" />
+ </colgroup>
+ <tr style="text-align: center;">
+ <th>{!$Label.Label_Units}</th>
+ <th>{!$Label.Label_Description}</th>
+ <th>{!$ObjectType.QuoteLineItem.fields.Quantity.label}</th>
+ <th>{!$ObjectType.QuoteLineItem.fields.TotalPrice.label}{!currencyIsoCode}</th>
+ </tr>
+ <apex:repeat value="{!printRecords}" var="set">
+ <tr>
+ <td style="text-align: center;"><apex:outputText value="{!set.units}" /></td>
+ <td><apex:outputText value="{!set.description}" /></td>
+ <td style="text-align: right;"><apex:outputText value="{!set.qty}" /></td>
+ <td style="text-align: right;"><apex:outputText value="{!set.total}" /></td>
+ </tr>
+ </apex:repeat>
+ </table>
- <!-- 銉氥兗銈搞偔銉c兂銉愩偣 -->
- <div class="pageCanvas">
-
- <!-- 銉氥兗銈哥暘鍙枫偆銉炽偗銉儭銉炽儓 -->
- <apex:variable var="count" value="{!count + 1}"/>
-
- <!-- 鍚勩儦銉笺偢銇偪銈ゃ儓銉� -->
- <div class="quoteTitle">{!$Label.Quote_Title}</div>
- <!-- 鍚勩儦銉笺偢銇儤銉冦儉銈儯銉炽儛銈� -->
- <div class="headerCanvas">
- <table style="border-style:none; border-color:red;">
- <tr>
- <td>
- <div>Quotation</div>
- <div> </div>
- <div>{!$Label.Quote_Client_Name}</div>
- <div><apex:outputpanel rendered="{!params.Agent1Name!=null}">{!$Label.Contract_Detail_Dealer_Name}</apex:outputpanel><apex:outputpanel rendered="{!params.Agent1Name==null}"> </apex:outputpanel></div>
- <div><apex:outputpanel rendered="{!params.Agent2Name!=null}">{!$Label.Contract_Detail_Dealer_Name}</apex:outputpanel><apex:outputpanel rendered="{!params.Agent2Name==null}"> </apex:outputpanel></div>
- </td>
- <td>
- <div>: </div>
- <div> </div>
- <div>: </div>
- <div><apex:outputpanel rendered="{!params.Agent1Name!=null}">:</apex:outputpanel> </div>
- <div><apex:outputpanel rendered="{!params.Agent2Name!=null}">:</apex:outputpanel> </div>
- </td>
- <td>
- <div> {!params.quoteNo}</div>
- <div> </div>
- <div> {!params.clientName}</div>
- <div> <apex:outputpanel rendered="{!params.Agent1Name!=null}">{!params.agent1Name}</apex:outputpanel></div>
- <div> <apex:outputpanel rendered="{!params.Agent2Name!=null}">{!params.agent2Name}</apex:outputpanel></div>
- </td>
- </tr>
- </table>
- <table style="border-style:none; top:0px; right:0px; position:absolute;">
- <tr>
- <td>
- <div style="text-align:right;">鎶ヤ环鏃ユ湡 : {!params.quoteDateString}</div>
- <div>姝ゆ姤浠峰崟鑷姤浠锋棩璧蜂笁涓湀鍐呮湁鏁�</div>
- </td>
- </tr>
- </table>
- <table style="border-style:none; border-color:green; top:36px; right:0px; position:absolute;">
- <tr>
- <td>
- <div> {!$Label.Quote_Department}</div>
- <div> <apex:outputpanel rendered="{!params.Agent1Name!=null}">{!$Label.phone}</apex:outputpanel></div>
- <div> <apex:outputpanel rendered="{!params.Agent2Name!=null}">{!$Label.phone}</apex:outputpanel></div>
- </td>
- <td>
- <div>: </div>
- <div><apex:outputpanel rendered="{!params.Agent1Name!=null}">:</apex:outputpanel> </div>
- <div><apex:outputpanel rendered="{!params.Agent2Name!=null}">:</apex:outputpanel> </div>
- </td>
- <td>
- <div> {!params.departmentName}</div>
- <div> <apex:outputpanel rendered="{!params.Agent1Name!=null}">{!params.agent1Phone}</apex:outputpanel></div>
- <div> <apex:outputpanel rendered="{!params.Agent2Name!=null}">{!params.agent2Phone}</apex:outputpanel></div>
- </td>
- <td>
- <div style="width:40px; border-style:none;"></div>
- </td>
- <td>
- <div> </div>
- <div> <apex:outputpanel rendered="{!params.Agent1Name!=null}">{!$Label.fax}</apex:outputpanel></div>
- <div> <apex:outputpanel rendered="{!params.Agent2Name!=null}">{!$Label.fax}</apex:outputpanel></div>
- </td>
- <td>
- <div> </div>
- <div><apex:outputpanel rendered="{!params.Agent1Name!=null}">:</apex:outputpanel> </div>
- <div><apex:outputpanel rendered="{!params.Agent2Name!=null}">:</apex:outputpanel> </div>
- </td>
- <td>
- <div> </div>
- <div> <apex:outputpanel rendered="{!params.Agent1Name!=null}">{!params.agent1Fax}</apex:outputpanel></div>
- <div> <apex:outputpanel rendered="{!params.Agent2Name!=null}">{!params.agent2Fax}</apex:outputpanel></div>
- </td>
- </tr>
- </table>
- </div>
-
- <!-- 瑭崇窗閮ㄥ垎銇儤銉冦儉 -->
- <div class="currencyType">鍗樹綅: {!params.trade}</div>
-
- <!-- 銉氥兗銈稿唴銇┏绱般伄REPEAT -->
- <div class="detailCanvas">
- <apex:dataTable value="{!items}" var="item" id="dataTable" styleClass="detailTable" headerClass="detailTableHeader" columnClasses="detailTableCols">
- <apex:column styleClass="detailRowNumber" style="vertical-align:text-top; text-align: center;">
- <apex:facet name="header">{!$Label.Quote_Product_Code}</apex:facet>
- <apex:outputText value="{!item.qli.Item_Order__c}"/>
- </apex:column>
- <apex:column styleClass="detailRowString" style="vertical-align:text-top;">
- <apex:facet name="header"></apex:facet>
- <apex:outputText value="{!item.qli.Asset_Model_No_forPrint__c}"/>
- </apex:column>
- <apex:column styleClass="detailRowString" style="vertical-align:text-top;">
- <apex:facet name="header"></apex:facet>
- <apex:outputText value="{!item.qli.NameForPrintDelimiter__c}"/>
- </apex:column>
- <apex:column styleClass="detailRowString" style="vertical-align:text-top;">
- <apex:facet name="header">{!$Label.Quote_Product_Name}</apex:facet>
- <!-- CHAN-BC6AFM LHJ 20190515 Start-->
- <!-- <apex:outputText value="{!item.qli.NameForPrint__c}"/> -->
- <c:PDFWbr targetStr="{!item.qli.NameForPrint__c}"/>
- <!-- CHAN-BC6AFM LHJ 20190515 End-->
- </apex:column>
- <apex:column styleClass="detailRowNumeric" style="vertical-align:text-top;" rendered="{!params.isUnitPrice==true}">
- <apex:facet name="header">{!$Label.Detail_Price}</apex:facet>
- <apex:outputText value="{0, number, ###,##0.00}">
- <apex:param value="{!item.UnitPrice_c}" />
- </apex:outputText>
- </apex:column>
- <apex:column styleClass="detailRowNumeric" style="vertical-align:text-top;">
- <apex:facet name="header">{!$Label.Quantity}</apex:facet>
- <apex:outputText value="{0, number, ###,###}">
- <apex:param value="{!item.qli.Quantity}" />
- </apex:outputText>
- </apex:column>
- <!-- 2021/01/18 liying start -->
- <apex:column styleClass="detailRowNumeric" style="text-align: center; vertical-align:text-top;" rendered="{!IF(params.isGuranteePeriod, true, false)}">
- <apex:facet name="header">鐗规畩淇濅慨骞撮檺</apex:facet>
- <apex:outputText value="{!item.qli.GuaranteePeriod__c}"/>
- </apex:column>
- <!-- 2021/01/18 liying end -->
- <apex:column styleClass="detailRowNumeric" style="vertical-align:text-top;" rendered="{!params.isOfferAmount==true}">
- <apex:facet name="header">{!$Label.Detail_Sum}</apex:facet>
- <apex:outputText value="{0, number, ###,##0.00}">
- <apex:param value="{!item.TotalPrice_c}" />
- </apex:outputText>
- </apex:column>
- </apex:dataTable>
- </div>
-
- <!-- 鏈�绲傘儦銉笺偢銇仩銇戣〃绀恒仚銈嬪悎瑷堟瑒 -->
- <apex:outputPanel rendered="{!count==maxPageNumber}">
- <div class="totalCanvas">
- <div style="width:120px;">
- <apex:outputPanel rendered="{!params.iSTotalPrice}"><div class="totalLabel">鎶ヤ环鎬婚 : </div></apex:outputPanel>
- <!-- <apex:outputPanel rendered="{!params.isMultiYearPrice && IF(params.trade == 'RMB', true, false)}"><div class="totalLabel">鏈嶅姟鎶ヤ环鎬婚 : </div></apex:outputPanel> -->
- <apex:outputPanel rendered="{!params.isDiscountRate}"><div class="totalLabel">{!$Label.Total_Discount_Percent} : </div></apex:outputPanel>
- <apex:outputPanel rendered="{!params.isDiscountAmount}"><div class="totalLabel">{!$Label.Discount_Amount} : </div></apex:outputPanel>
- <apex:outputPanel rendered="{!params.isTradingPrice}"><div class="totalLabel">{!$Label.Row_Total_Sum} : </div></apex:outputPanel>
- </div>
- <div style="position: absolute; top: 0px; right: 0px; padding-right:5px;">
- <div class="totalValue"><apex:outputText rendered="{!params.iSTotalPrice}" value="{0, number, ###,##0.00}"><apex:param value="{!params.totalPrice}"/></apex:outputText></div>
- <!-- <div class="totalValue"><apex:outputText rendered="{!params.isDiscountAmount}" value="{0, number, ###,##0.00}"><apex:param value="{!params.MultiYearWarrantyTotalPrice}"/></apex:outputText></div> -->
- <!-- <div class="totalValue"><apex:outputText rendered="{!params.isMultiYearPrice && IF(params.trade == 'RMB', true, false)}" value="{0, number, ###,##0.00}"><apex:param value="{!params.MultiYearWarrantyTotalPrice}"/></apex:outputText></div> -->
- <div class="totalValue"><apex:outputText rendered="{!params.isDiscountRate}">{!params.discountRate}%</apex:outputText></div>
- <div class="totalValue"><apex:outputText rendered="{!params.isDiscountAmount}" value="{0, number, ###,##0.00}"><apex:param value="{!params.discountAmount}"/></apex:outputText></div>
- <div class="totalValue"><apex:outputText rendered="{!params.isTradingPrice}" value="{0, number, ###,##0.00}"><apex:param value="{!params.tradingPrice}" /></apex:outputText></div>
- </div>
- </div>
- </apex:outputPanel>
-
- <br />
-
- <!-- 鍚勩儦銉笺偢銇儠銉冦偪銈儯銉炽儛銈� -->
- <apex:outputPanel rendered="{!count==maxPageNumber}">
- <div class="footerCanvas">
- <div class="footerSignLast">
- {!$Label.Quote_OWner} : {!params.ownerName}銆�{!$Label.Quote_Mobile_Phone} : {!params.mobilePhone}<br />
- <br />
- 锛坽!$Label.Quote_Owner_Signature}锛�<br />
-
- </div>
-
- <div class="footerAddress">
-
- <div>
- 鈻!params.addressName}銆�銆�銆�<br />
- {!params.address}锛堥偖缂栵細{!params.postCode}锛�
- </div>
- <!-- <div style="height: 10px;"></div>
- <div>
- 鈻″ゥ鏋楀反鏂紙鍖椾含锛夐攢鍞湇鍔℃湁闄愬叕鍙镐笂娴峰垎鍏徃銆�銆�銆�<br />
- {!params.address}锛堥偖缂栵細{!params.postCode}锛�
- </div>
- <div style="height: 10px;"></div>
- <div>
- 鈻″ゥ鏋楀反鏂紙鍖椾含锛夐攢鍞湇鍔℃湁闄愬叕鍙稿箍宸炲垎鍏徃銆�銆�銆�<br />
- {!params.address}锛堥偖缂栵細{!params.postCode}锛�
- </div> -->
+ <br/>
- </div>
- </div>
- </apex:outputPanel>
- <apex:outputPanel rendered="{!count!=maxPageNumber}">
- <div class="footerSign" style="position:absolute; top:880px;">
- {!$Label.Quote_OWner} : {!params.ownerName}銆�{!$Label.Quote_Mobile_Phone} : {!params.mobilePhone}<br />
- <br />
- 锛坽!$Label.Quote_Owner_Signature}锛�<br />
- </div>
- </apex:outputPanel>
-
- </div>
-
- <!-- 鍚勩儦銉笺偢銈掑尯鍒囥倠鏀广儦銉笺偢銆佹渶绲傘儦銉笺偢銇伅鍑恒仌銇亜銈堛亞銇仐銇︺亜銈� -->
- <apex:outputpanel rendered="{!count<maxPageNumber}">
+ Note:<br/>
+<!-- 1) The payment terms are {!quoteInfo.note1} .<br/>
+ 浠樻鏂瑰紡 {!quoteInfo.note2} 銆�<br/>
+ 2) Quoation valid until {!quoteInfo.note3} .<br/>
+ 鎶ヤ环鏈夋晥鏈熷埌 {!quoteInfo.note3} 銆�<br/>
+ 3) All the commodoties come with {!quoteInfo.note4} year's manufacturer warranty.<br/>
+ 鎵�鏈夊晢鍝佸惈 {!quoteInfo.note4} 骞村巶瀹朵繚淇��<br/>
+ 4) The above quotations are {!quoteInfo.note5} prices, Commodoties shipped to the clien's requirements.<br/>
+ 涓婅堪鎶ヤ环涓� {!quoteInfo.note5} 浠凤紝鍟嗗搧閫佽嚦瀹㈡埛鎸囧畾鍦扮偣銆�<br/>
+ 5) The above quotations are all {!quoteInfo.note6}.<br/>
+ 涓婅堪鎶ヤ环鍧囦负 {!quoteInfo.note7} 浠枫��<br/>
+ 6) Configuration as per attached.<br/>
+ 閰嶇疆娓呭崟璇﹁闄勪欢銆�<br/> -->
+ <apex:outputText value="{!quoteInfo.comment}" escape="false"/>
+<!-- 1) The above quotations are CIP prices, Commodities shipped to the client鈥檚 requirements.<br/>
+ 2) The above quotations are all tax {!quoteInfo.note2}.<br/>
+ 3) The payment terms are {!quoteInfo.note3}.<br/>
+ 4) Quotation valid until {!quoteInfo.note4}.<br/>
+ 5) All the commodities come with {!quoteInfo.note5} year鈥檚 manufacturer warranty.<br/>
+ 6) Configuration as per attached.<br/>
+ 7) Delivery lead time is {!quoteInfo.note7} days after receipt of payment.<br/> -->
+
+ <apex:outputPanel rendered="{!pageCnt > 1}" layout="none">
<div style="page-break-after: always;"/>
- </apex:outputpanel>
-
+ </apex:outputPanel>
+
+<apex:variable value="{!1}" var="cnt1" />
+<apex:repeat value="{!printRecords}" var="set">
+ <!-- <apex:variable value="{!1}" var="cnt2" /> -->
+ <apex:repeat value="{!set.setPage}" var="sp">
+ <table border="1" width="100%" style="border-collapse: collapse;table-layout: fixed; font-size: 12px;">
+ <colgroup>
+ <col width="3%" />
+ <col width="10%" />
+ <col width="15%" />
+ <col width="{!IF(isPrintPrice=='true', 23, 33)}%" />
+ <col width="{!IF(isPrintPrice=='true', 20, 33)}%" />
+ <col width="5%" />
+ <apex:outputPanel rendered="{!isPrintPrice=='true'}" layout="none">
+ <col width="12%" />
+ <col width="12%" />
+ </apex:outputPanel>
+ </colgroup>
+ <!-- <apex:outputPanel rendered="{!cnt2 == 1}" layout="none"> -->
+ <tr style="text-align: center;">
+ <td colspan="{!IF(isPrintPrice=='true', 8, 6)}">{!set.description}{!$Label.Label_Set_detail}</td>
+ </tr>
+ <!-- </apex:outputPanel> -->
+ <tr style="text-align: center;">
+ <td>{!$Label.Label_No}</td>
+ <td>{!$ObjectType.Product2.fields.ProductCode.label}</td>
+ <td>{!$ObjectType.Product2.fields.Product_ECCode__c.label}</td>
+ <td>{!$ObjectType.Product2.fields.Description.label}</td>
+ <td>{!$ObjectType.QuoteLineItem.fields.Description.label}</td>
+ <td>{!$ObjectType.QuoteLineItem.fields.Quantity.label}</td>
+ <apex:outputPanel rendered="{!isPrintPrice=='true'}" layout="none">
+ <td>{!$ObjectType.QuoteLineItem.fields.UnitPrice.label}{!currencyIsoCode}</td>
+ <td>{!$ObjectType.QuoteLineItem.fields.TotalPrice.label}{!currencyIsoCode}</td>
+ </apex:outputPanel>
+ </tr>
+ <apex:repeat value="{!sp}" var="line">
+ <tr>
+ <td style="text-align: center;"><apex:outputText value="{!line.lineNo}" /></td>
+ <td><apex:outputText escape="false" value="{!line.productCode}" /></td>
+ <td><apex:outputText escape="false" value="{!line.productEC}" /></td>
+ <td><apex:outputText escape="false" value="{!line.description}" /></td>
+ <td><apex:outputText escape="false" value="{!line.comment}" /></td>
+ <td style="text-align: right;"><apex:outputText value="{!line.quantity}" /></td>
+ <apex:outputPanel rendered="{!isPrintPrice=='true'}" layout="none">
+ <td style="text-align: right;"><apex:outputText value="{!line.price}" /></td>
+ <td style="text-align: right;"><apex:outputText value="{!line.totalPrice}" /></td>
+ </apex:outputPanel>
+ </tr>
+ </apex:repeat>
+ </table>
+
+ <apex:outputPanel rendered="{!cnt1 < pageCnt - 1}" layout="none">
+ <div style="page-break-after: always;"/>
+ </apex:outputPanel>
+
+ <!-- <apex:variable value="{!cnt2 + 1}" var="cnt2" /> -->
+ <apex:variable value="{!cnt1 + 1}" var="cnt1" />
</apex:repeat>
-
+</apex:repeat>
</body>
-
</apex:page>
\ No newline at end of file
--
Gitblit v1.9.1