feat: 明细使用同步回来的数据“

feature/trippest
lyt 6 years ago
parent 317ed34d1f
commit dd7a4b317f

@ -123,7 +123,7 @@ class Vendor_money extends CI_Controller {
);
foreach ($final_table as $line => $row) {
if ($row['vendor'] == $vendor) {
$ret['trippest']['trippest_sum'] = bcadd($ret['trippest']['trippest_sum'], $row['haina_receipt']);
$ret['trippest']['trippest_sum'] = bcadd($ret['trippest']['trippest_sum'], $row['sync_haina_receipt']);
$ret['trippest']['vendor_sum'] = bcadd($ret['trippest']['vendor_sum'], $row['vendor_receipt']);
$ret['trippest']['vendor_cost'] = bcadd($ret['trippest']['vendor_cost'], $row['group_vendor_cost']);
$ret['trippest']['other_sum'] = bcadd($ret['trippest']['other_sum'], $row['other_price_RMB']);
@ -250,11 +250,11 @@ class Vendor_money extends CI_Controller {
->SetCellValue('A'.$rowCount, ($rowCount-1))
// ->SetCellValue('A'.$rowCount, $row->pn_sn)
->setCellValueExplicit('B'.$rowCount, $row['GRI_No'],PHPExcel_Cell_DataType::TYPE_STRING)
->setCellValue('C'.$rowCount, number_format($row['haina_receipt'], 2, ".", ""))
->setCellValue('C'.$rowCount, number_format($row['sync_haina_receipt'], 2, ".", ""))
->setCellValue('D'.$rowCount, number_format($row['vendor_receipt'], 2, ".", ""))
->SetCellValue('E'.$rowCount, 0)
->SetCellValue('F'.$rowCount, $row['group_vendor_cost'])
->setCellValue('G'.$rowCount, bcsub(bcadd($row['vendor_receipt'],$row['haina_receipt']),$row['group_vendor_cost']))
->setCellValue('G'.$rowCount, bcsub(bcadd($row['vendor_receipt'],$row['sync_haina_receipt']),$row['group_vendor_cost']))
;
$rowCount++;
}

@ -42,6 +42,10 @@ class Vendor_money_model extends CI_Model {
(order_total_receipt-dbo.ConvertToRMB('USD',other_vendor_price))
else ht_origin end
as haina_receipt,
case when other_vendor_price > 0 then
(isnull(sync_total_receipt_sum,0)-vendor_receipt)
else ht_origin end
as sync_haina_receipt,
*
,(select ROUND(SUM(isnull(tourcost,0)),4)
from report_tour where ordernumber=COLI_ID
@ -83,8 +87,13 @@ class Vendor_money_model extends CI_Model {
(select isnull(SUM(GAI_SSJE),0) from BIZ_GroupAccountInfo
where DeleteFlag=0 and GAI_COLI_SN=COLI_SN
and GAI_VEI_SN in ($all_vendor)
and GAI_Type in (" . PAY_OTHER . ")
--and GAI_Type in (" . PAY_OTHER . ")
) as vendor_receipt
,(select SUM(convert(decimal(10,2),isnull(GCI_priceCNY,0))) from
GroupCombineInfo where GCI_GRI_SN=GRI_SN and GCI_VEI_SN in ($all_vendor)
--and COLI_OPI_ID<>435
and ISNULL(GCI_combineNo,'') not in ('','cancel')
) as sync_total_receipt_sum
,coli.COLI_OPI_ID
,(
select top 1 v.COLD_PlanVEI_SN from BIZ_ConfirmLineDetail v where COLD_COLI_SN=COLI_SN
@ -218,6 +227,11 @@ class Vendor_money_model extends CI_Model {
and DeleteFlag=0
and COLD_PlanVEI_SN in ($all_vendor)
) as vendor_name
,(select SUM(convert(decimal(10,2),isnull(GCI_priceCNY,0))) from
GroupCombineInfo where GCI_GRI_SN=GRI_SN and GCI_VEI_SN in ($all_vendor)
--and COLI_OPI_ID<>435
and ISNULL(GCI_combineNo,'') not in ('','cancel')
) as sync_price_sum
FROM CK_GroupInfo cgi
INNER JOIN GRoupInfo gri ON CGI_GRI_SN=GRI_SN
INNER JOIN BIZ_ConfirmLineInfo coli ON COLI_GRI_SN=GRI_SN

@ -188,19 +188,19 @@
}
?>
<?php
if ($trippest['trippest']['other_vendor_sum'] > 0) {
//if ($trippest['trippest']['other_vendor_sum'] > 0) {
?>
<tr class="bg-grey">
<!-- <tr class="bg-grey">
<td>已扣减的其他地接的团款 <br></td>
<td><?php echo $trippest['trippest']['other_vendor_sum'] ?></td>
<td><?php //echo $trippest['trippest']['other_vendor_sum'] ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td colspan="4"></td>
</tr>
</tr> -->
<?php
}
//}
?>
<?php
}
@ -227,8 +227,8 @@
<th>拼团号</th>
<th>总报价/USD</th>
<th>总收款/RMB</th>
<th>计入上表海纳收团款</th>
<th colspan="5">应扣除的其他地接收款: (实时计算, 存在汇率误差)</th>
<th colspan="6">上表地接社接待部分的总团款</th>
<!-- <th colspan="5">应扣除的其他地接收款: (实时计算, 存在汇率误差)</th> -->
</tr>
<?php foreach ($trippest_order_multi_city as $ko => $order) {
?>
@ -237,10 +237,10 @@
<td class="text-left"><?php echo $order['gci_no'] ?></td>
<td><?php echo $order['COLI_Price'] ?></td>
<td><?php echo $order['money_sum'] ?></td>
<td><?php echo bcsub($order['money_sum'], $order["other_vendorprice_RMB"]) ?>
<td colspan="6" class="text-left"><?php echo $order['sync_price_sum'] ?>
<br> <?php echo ($order["vendor_name"]) ?>
</td>
<td colspan="5" class="text-left"><?php echo $order["other_vendorprice_RMB"] ?></td>
<!-- <td colspan="5" class="text-left"><?php // echo $order["other_vendorprice_RMB"] ?></td> -->
</tr>
<?php }
} ?>
@ -343,8 +343,8 @@
<p class="text-center"> 实际总成本</p>
</th>
<th class="text-left">
<p class="text-center"> 财务表读取总成本</p>
<p>读取相同拼团号下的订单的财务表, 列出存在财务表数据未根据实际成本计算的.</p>
<p class="text-center"> 自动生成的财务表所使用的成本金额</p>
<p>对含有多个地接社的订单,由于审核状态不一致,不会自动生成或更新财务表,避免覆盖数据导致错误, 请手动处理。检查金额正确之后, 此处可忽略该团.</p>
<ol class="info-primary">
<li> 数据为空: 虚拟订单没有团号, 无法计算. 如:
<ul>
@ -361,7 +361,7 @@
</li>
</ol>
</th>
<th class="text-left">
<!-- <th class="text-left">
<p class="text-center"> 财务表计算总成本</p>
<p>计算相同拼团号下所有订单的财务表中的产品成本总和, 判断是否存在数据未根据实际成本计算.</p>
<ol class="info-primary">
@ -371,7 +371,7 @@
</ul>
</li>
</ol>
</th>
</th> -->
</tr>
</thead>
<tbody>
@ -384,7 +384,7 @@
</td>
<td><?php echo $diff['total_cost'] ?></td>
<td><?php echo $diff['report_total_cost0'] ?></td>
<td><?php echo $diff['report_cost'] ?></td>
<!-- <td><?php // echo $diff['report_cost'] ?></td> -->
</tr>
<?php } ?>
</tbody>

Loading…
Cancel
Save