hy 6 жил өмнө
parent
commit
8c07deab1f

+ 25 - 25
applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml

@@ -27,8 +27,8 @@
 		  pi_custname,
 		  sum(pd_sendprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0))) as saamount,
 		  sum(pd_total) as costamount,
-	  	  sum(pd_sendprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0)))-sum(pd_total) as profit,
-		  (sum(pd_sendprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0)))-sum(pd_total) )/sum(pd_sendprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0))) as profitpresent
+	  	  sum(pd_netprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0)))-sum(pd_total) as profit,
+		  (sum(pd_netprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0)))-sum(pd_total) )/sum(pd_netprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0))) as profitpresent
 	  from prodiodetail
 	  left join prodinout on pd_piid=pi_Id
 	  left join customer on cu_id = pi_custid
@@ -48,29 +48,29 @@
 	<select id="selectCalculateFields" resultType="string">
 		SELECT ${fields}
 		from(
-		select
-		cu_type,
-		pi_custid,
-		pi_custcode,
-		pi_custname,
-		sum(pd_sendprice*pi_rate*pd_outqty) as saamount,
-		sum(pd_total) as costamount,
-		sum(pd_sendprice*pi_rate*pd_outqty)-sum(pd_total) as profit,
-		(sum(pd_sendprice*pi_rate*pd_outqty)-sum(pd_total) )/sum(pd_sendprice*pi_rate*pd_outqty) as profitpresent
-		from prodiodetail
-		left join prodinout on pd_piid=pi_Id
-		left join customer on cu_id = pi_custid
-		<where>
-			<if test="con != null">
-				${con}
-			</if>
-			<if test="companyId != null">
-				and prodinout.companyid = #{companyId}
-			</if>
-			and pi_class in('出货单','销售退货单')
-		</where>
-		group by pi_custid,pi_custcode,pi_custname,cu_type
-		ORDER BY pi_custname asc
+			select
+				cu_type,
+				pi_custid,
+				pi_custcode,
+				pi_custname,
+				sum(pd_sendprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0))) as saamount,
+				sum(pd_total) as costamount,
+				sum(pd_netprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0)))-sum(pd_total) as profit,
+				(sum(pd_netprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0)))-sum(pd_total) )/sum(pd_netprice*pi_rate*(ifnull(pd_outqty,0)-ifnull(pd_inqty,0))) as profitpresent
+			from prodiodetail
+			left join prodinout on pd_piid=pi_Id
+			left join customer on cu_id = pi_custid
+			<where>
+				<if test="con != null">
+					${con}
+				</if>
+				<if test="companyId != null">
+					and prodinout.companyid = #{companyId}
+				</if>
+				and pi_class in('出货单','销售退货单')
+			</where>
+			group by pi_custid,pi_custcode,pi_custname,cu_type
+			ORDER BY pi_custname asc
 		) a
 	</select>
 

+ 2 - 2
frontend/saas-web/app/view/money/report/TotalPayDetail.js

@@ -223,9 +223,9 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
                     Ext.each(summaryData,function(obj,index){
                         recAmount = obj.vm_endamount-obj.vm_endpreamount
                         if(index==0){
-                            message+='<span>应付余额(' + obj.vm_currency + ')(元):'+recAmount+'</span>'
+                            message+='<span>应付余额(' + obj.vm_currency + ')(元):'+saas.util.BaseUtil.numberFormat(recAmount, 2, true)+'</span>'
                         }else{
-                            message+='<span style="margin:0 0 0 20px">应付余额(' + obj.vm_currency + ')(元):'+recAmount+'</span>'
+                            message+='<span style="margin:0 0 0 20px">应付余额(' + obj.vm_currency + ')(元):'+saas.util.BaseUtil.numberFormat(recAmount, 2, true)+'</span>'
                         }
                     });
                     me.renderSummaryData =message;

+ 2 - 2
frontend/saas-web/app/view/money/report/TotalRecDetail.js

@@ -220,9 +220,9 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
                     Ext.each(summaryData,function(obj,index){
                         recAmount = obj.cm_endamount-obj.cm_endpreamount
                         if(index==0){
-                            message+='<span>应收余额(' + obj.cm_currency + ')(元):'+recAmount+'</span>'
+                            message+='<span>应收余额(' + obj.cm_currency + ')(元):'+saas.util.BaseUtil.numberFormat(recAmount, 2, true)+'</span>'
                         }else{
-                            message+='<span style="margin:0 0 0 20px">应收余额(' + obj.cm_currency + ')(元):'+recAmount+'</span>'
+                            message+='<span style="margin:0 0 0 20px">应收余额(' + obj.cm_currency + ')(元):'+saas.util.BaseUtil.numberFormat(recAmount, 2, true)+'</span>'
                         }
                     });
                     me.renderSummaryData =message;

+ 2 - 2
frontend/saas-web/app/view/purchase/report/PurchasePay.js

@@ -204,9 +204,9 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
                     Ext.each(summaryData,function(obj,index){
                         tax+=(obj.pi_total-obj.pi_nettotal)*obj.pi_rate
                         payAmount = obj.pbd_nowbalance
-                        message+='<span style="margin:0 0 0 20px">付款金额(' + obj.pi_currency + ')(元):'+payAmount+'</span>'
+                        message+='<span style="margin:0 0 0 20px">付款金额(' + obj.pi_currency + ')(元):'+saas.util.BaseUtil.numberFormat(payAmount, 2, true)+'</span>'
                     });
-                    message = '税额(本位币)(元):'+tax+message
+                    message = '税额(本位币)(元):'+saas.util.BaseUtil.numberFormat(tax, 2, true)+message
                     me.renderSummaryData =message;
                 }else{
                     message = '税额(本位币)(元):0'

+ 2 - 2
frontend/saas-web/app/view/sale/report/SaleRec.js

@@ -212,9 +212,9 @@ Ext.define('saas.view.sale.report.SaleRec', {
                     Ext.each(summaryData,function(obj,index){
                         tax+=(obj.pi_total-obj.pi_nettotal)*obj.pi_rate
                         recAmount = obj.rbd_nowbalance
-                        message+='<span style="margin:0 0 0 20px">收款金额(' + obj.pi_currency + ')(元):'+recAmount+'</span>'
+                        message+='<span style="margin:0 0 0 20px">收款金额(' + obj.pi_currency + ')(元):'+saas.util.BaseUtil.numberFormat(recAmount, 2, true)+'</span>'
                     });
-                    message = '税额(本位币)(元):'+tax+message
+                    message = '税额(本位币)(元):'+saas.util.BaseUtil.numberFormat(tax, 2, true)+message
                     me.renderSummaryData =message;
                 }else{
                     message = '税额(本位币)(元):0'