Преглед на файлове

Merge branch 'zzd' of ssh://was.baoshi56.com:10022/var/git/bswas

LD преди 5 години
родител
ревизия
156fcb2db0
променени са 3 файла, в които са добавени 16 реда и са изтрити 6 реда
  1. 13 4
      app/Http/Controllers/TestController.php
  2. 2 1
      app/Services/OwnerAreaReportService.php
  3. 1 1
      resources/views/customer/project/create.blade.php

+ 13 - 4
app/Http/Controllers/TestController.php

@@ -61,6 +61,8 @@ use App\OrderPackageCommodities;
 use App\OrderPackageCountingRecord;
 use App\OrderPackageCountingRecord;
 use App\OrderTracking;
 use App\OrderTracking;
 use App\Owner;
 use App\Owner;
+use App\OwnerAreaReport;
+use App\OwnerBillReport;
 use App\OwnerFeeDetail;
 use App\OwnerFeeDetail;
 use App\OwnerFeeDetailLogistic;
 use App\OwnerFeeDetailLogistic;
 use App\OwnerPriceExpress;
 use App\OwnerPriceExpress;
@@ -164,10 +166,17 @@ class TestController extends Controller
 
 
     public function test()
     public function test()
     {
     {
-        $w = Waybill::query()->first();
-        $w->owner = $w->owner->name;
-        $w = $w->withoutRelations();
-        dd($w);
+        $a = OwnerBillReport::query()->first();
+        $a->update(["storage_fee" => -700.0]);
+        $b = OwnerAreaReport::query()->first();
+        $b->update([
+              "user_owner_group_id" => "1",
+              "area_on_tray" => "1",
+              "area_on_half_tray" => "1",
+              "area_on_flat" => "1",
+              "accounting_area" => 5.6,
+        ]);
+        dd("ok");
         return view("test");
         return view("test");
     }
     }
 
 

+ 2 - 1
app/Services/OwnerAreaReportService.php

@@ -61,7 +61,7 @@ class OwnerAreaReportService
                     ->where("counting_month",'like',$area->counting_month."%")->first();
                     ->where("counting_month",'like',$area->counting_month."%")->first();
                 if ($report){
                 if ($report){
                     if (!$area->ownerStoragePriceModel)return false;
                     if (!$area->ownerStoragePriceModel)return false;
-                    $diff = $area->accounting_area - $values["accounting_area"];
+                    $diff = $area->accounting_area>0 ? $area->accounting_area - $values["accounting_area"] : $values["accounting_area"];
                     $diffAmount = app("OwnerStoragePriceModelService")->calculationAmount($area->ownerStoragePriceModel, $diff, $area->owner_id, $area->counting_month);
                     $diffAmount = app("OwnerStoragePriceModelService")->calculationAmount($area->ownerStoragePriceModel, $diff, $area->owner_id, $area->counting_month);
                     if ($diffAmount != 0){
                     if ($diffAmount != 0){
                         $up = ["storage_fee"=>$report->storage_fee - $diffAmount];
                         $up = ["storage_fee"=>$report->storage_fee - $diffAmount];
@@ -75,6 +75,7 @@ class OwnerAreaReportService
             DB::commit();
             DB::commit();
             return true;
             return true;
         }catch (\Exception $e){
         }catch (\Exception $e){
+            dd($e->getMessage());
             DB::rollBack();
             DB::rollBack();
             return false;
             return false;
         }
         }

+ 1 - 1
resources/views/customer/project/create.blade.php

@@ -1837,7 +1837,7 @@
                     }
                     }
                 },
                 },
                 filterCustomer(e){
                 filterCustomer(e){
-                    let value = $(e.target).val();
+                    let value = e.target.value;
                     if (value===""){
                     if (value===""){
                         this.filterCustomers=JSON.parse(JSON.stringify(this.customers));
                         this.filterCustomers=JSON.parse(JSON.stringify(this.customers));
                         return;
                         return;