|
|
@@ -1437,6 +1437,35 @@ TEXT;
|
|
|
MeasuringMachine::query()->firstOrCreate(['code'=>'hengli003'],['name'=>'hengli003']);
|
|
|
}
|
|
|
|
|
|
+ public function testProcurement()
|
|
|
+ {
|
|
|
+ $procurementDeliveries=ProcurementDeliverie::query()
|
|
|
+ ->where('receipt_amount',0)
|
|
|
+ ->where('created_at','>=','2021-04-01 00:00:00')
|
|
|
+ ->where('created_at','<',Carbon::now()->toDateTimeString())
|
|
|
+ ->get();
|
|
|
+ foreach ($procurementDeliveries as $procurementDelivery){
|
|
|
+ $procurementDelivery->update(['receipt_amount'=>$procurementDelivery->amount]);
|
|
|
+ }
|
|
|
+ $procurementCheckSheets=ProcurementCheckSheet::query()
|
|
|
+ ->with('procurementDelivery.procurement')
|
|
|
+ ->where('account_payable',0)
|
|
|
+ ->where('created_at','>=','2021-04-01 00:00:00')
|
|
|
+ ->where('created_at','<',Carbon::now()->toDateTimeString())
|
|
|
+ ->get();
|
|
|
+ foreach ($procurementCheckSheets as $procurementCheckSheet){
|
|
|
+ if ($procurementCheckSheet->id==913)continue;
|
|
|
+ $procurementCheckSheet->update(['account_payable'=>$procurementCheckSheet['procurementDelivery']['receipt_amount']*$procurementCheckSheet['procurementDelivery']['procurement']['cost_price']]);
|
|
|
+ }
|
|
|
+ $procurementCheckSheet=ProcurementCheckSheet::query()->find(914);
|
|
|
+ ProcurementTotalBill::query()->create([
|
|
|
+ 'counting_month'=>'2021-05-01',
|
|
|
+ 'supplier_id'=>84,
|
|
|
+ 'status'=>0,
|
|
|
+ 'total_payable'=>$procurementCheckSheet->account_payable,
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
public function testHttp()
|
|
|
{
|
|
|
return view('httpTest');
|