|
@@ -3,8 +3,7 @@
|
|
|
|
|
|
namespace app\admin\controller;
|
|
|
|
|
|
-use app\admin\model\CgdInfo;use app\admin\model\GoodCombind;use app\admin\model\InvoiceOrder;use app\admin\model\InvoicePool;use app\admin\model\OrderCategory;use app\admin\model\Pay;use app\admin\model\PayInvoice;use app\admin\model\QrdInfo;use app\admin\model\TradePool;use think\App;
|
|
|
-use think\facade\Db;use think\facade\Validate;
|
|
|
+use app\admin\model\CgdInfo;use app\admin\model\GoodCombind;use app\admin\model\InvoiceOrder;use app\admin\model\InvoicePool;use app\admin\model\OrderCategory;use app\admin\model\Pay;use app\admin\model\PayInvoice;use app\admin\model\QrdInfo;use app\admin\model\TradePool;use think\App;use think\facade\Db;use think\facade\Validate;
|
|
|
class Sale extends Base{
|
|
|
public function __construct(App $app) {
|
|
|
parent::__construct($app);
|
|
@@ -520,7 +519,6 @@ class Sale extends Base{
|
|
|
$data[]=$temp;
|
|
|
}
|
|
|
}
|
|
|
-// if(empty($data)==false) $this->error("结算存在进行中业务",1005,$data);
|
|
|
}
|
|
|
$cgdinfo =Db::name('cgd_info')->where(['cxCode'=>$post['orderCode'],'status'=>1,'is_del'=>0])->field('sequenceNo,companyName')->findOrEmpty();
|
|
|
if(!empty($cgdinfo)){
|
|
@@ -643,6 +641,14 @@ class Sale extends Base{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ $InvoiceOrder = InvoiceOrder::with(['ItemInfo'])->where(['code'=>$cgdinfo['sequenceNo'],'status'=>[1,2]])->select();
|
|
|
+ if($InvoiceOrder->isEmpty()==false){
|
|
|
+ foreach ($InvoiceOrder as $item){
|
|
|
+ $hp = PayInvoice::where(['hpNo'=>$item->ItemInfo->invoiceCode])->findOrEmpty();
|
|
|
+ $data[]=['type'=>'发票池关联采购单','username'=> $hp['apply_name'],'orderCode'=>$hp['hpNo'],'companyName'=>$cgdinfo['companyName']];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
$comoOrder = CgdInfo::where(['mainCode'=>$post['orderCode'],'is_comon'=>2,'status'=>1])->field('sequenceNo,companyName')->findOrEmpty();
|
|
|
if(!empty($comoOrder)){
|
|
|
$payNo = Db::name('pay_info')->where(['cgdNo'=>$comoOrder['sequenceNo'],'status'=>1,'is_del'=>0])->value('payNo','');
|
|
@@ -664,7 +670,16 @@ class Sale extends Base{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ $InvoiceOrder = InvoiceOrder::with(['ItemInfo'])->where(['code'=>$comoOrder['sequenceNo'],'status'=>[1,2]])->select();
|
|
|
+ if($InvoiceOrder->isEmpty()==false){
|
|
|
+ foreach ($InvoiceOrder as $item){
|
|
|
+ $hp = PayInvoice::where(['hpNo'=>$item->ItemInfo->invoiceCode])->findOrEmpty();
|
|
|
+ $data[]=['type'=>'发票池关联源头采购单','username'=> $hp['apply_name'],'orderCode'=>$hp['hpNo'],'companyName'=>$comoOrder['companyName']];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|