Files
OMS/app/finance/lib/finder/bill.php
2025-12-28 23:13:25 +08:00

122 lines
4.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
class finance_finder_bill{
/*var $column_edit = "操作";
var $column_edit_width = "80";
var $column_edit_order = "2";
function column_edit($row){
$bill_id = $row['bill_id'];
$status = $row['status'];#判断核销状态
$charge_status = $row['charge_status'];#判断核销状态
$render = app::get('finance')->render();
$render->pagedata['bill_id'] = $bill_id;
$render->pagedata['finder_id'] = $_GET['_finder']['finder_id'];
// if($charge_status == 0){
// return $render->fetch('bill/do_cancel.html');
// }
$href = '';
if($status <> 2 and $row['order_bn']){
$href .= sprintf('<a href="index.php?app=finance&ctl=settlement&act=detailVerification&finder_id=%s&bill_id=%s" target="_blank">核销</a>&nbsp;&nbsp;&nbsp;&nbsp;',$_GET['_finder']['finder_id'],$row['bill_id']);
// $href .= '<a href="index.php?app=finance&ctl=settlement&act=resetOrderBn&p[0]='.$row['bill_id'].'&_finder[finder_id]=' . $_GET['_finder']['finder_id'] . '&finder_id=' . $_GET['_finder']['finder_id'] . '" target="_blank">重置订单号</a>';
return $href;
}
}*/
var $addon_cols = "monthly_id";
var $detail_basic = "原始数据";
function detail_basic($id){
$render = app::get('financebase')->render();
$mdlBill = app::get('financebase')->model("bill");
$mdlBillBase = app::get('financebase')->model("bill_base");
$finance_bill_row = app::get('finance')->model('bill')->getList('unique_id,channel_id',array('bill_id'=>$id));
$filter = array('unique_id'=>$finance_bill_row[0]['unique_id'],'shop_id'=>$finance_bill_row[0]['channel_id']);
$bill_row = $mdlBill->getList('platform_type',$filter);
$base_bill_row = $mdlBillBase->getList('content',$filter);
$class_name = 'financebase_data_bill_'.$bill_row[0]['platform_type'];
if (!ome_func::class_exists($class_name)){
die($bill_row[0]['platform_type'].'无此类型的方法');
}
$instance = kernel::single($class_name);
$array_title = $instance->getTitle();
$array_content = json_decode($base_bill_row[0]['content'],1);
$info = array();
foreach ($array_title as $key => $value) {
$info[$key] = array('title'=>$value,'content'=>$array_content[$key]);
}
$render->pagedata['info'] = $info;
return $render->fetch("admin/bill/detail.html");
}
// var $detail_verification = "核销详情";
// function detail_verification($id){
// $render = app::get('finance')->render();
// $mdlBill = app::get('finance')->model("bill");
// $mdlBillVerificationRelation = app::get('finance')->model('bill_verification_relation');
// $bill_row = $mdlBill->getList('bill_bn',array('bill_id'=>$id));
// $list = $mdlBillVerificationRelation->getList('*',array('bill_bn'=>$bill_row[0]['bill_bn']));
// $render->pagedata['list'] = $list;
// return $render->fetch("settlement/verification_relation_detail.html");
// }
var $detail_oplog = "操作记录";
function detail_oplog($id){
$render = app::get('finance')->render();
$mdlBill = app::get('finance')->model("bill");
$mdlBillLogs = app::get('finance')->model("bill_op_logs");
$bill_row = $mdlBill->getList('bill_bn',array('bill_id'=>$id));
$list = $mdlBillLogs->getList('*',array('log_bn'=>$bill_row[0]['bill_bn']),0,-1,'log_id desc');
$render->pagedata['list'] = $list;
return $render->fetch("settlement/verification_logs.html");
}
public $column_monthly_id = '账期名称';
public $column_monthly_id_order = 1;
public $column_monthly_id_width = 180;
/**
* column_monthly_id
* @param mixed $row row
* @param mixed $list list
* @return mixed 返回值
*/
public function column_monthly_id($row, $list) {
if(!$this->monthly_id) {
$miRows = app::get('finance')->model('monthly_report')->getList('monthly_id, monthly_date', ['monthly_id'=> array_column($list, $this->col_prefix.'monthly_id')]);
$this->monthly_id = array_column($miRows, null, 'monthly_id');
}
return $this->monthly_id[$row[$this->col_prefix.'monthly_id']]['monthly_date'] ? : '';
}
}