Skip to content

Commit

Permalink
Merge pull request #80 from alexeyvolodin/profitreport
Browse files Browse the repository at this point in the history
Profit report entity. (Продажи -> Прибыльность)
  • Loading branch information
tooyz authored Oct 24, 2020
2 parents 6b4687b + ff25459 commit 0216fbf
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Components/Specs/QuerySpecs/Reports/ProfitReportQuerySpecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace MoySklad\Components\Specs\QuerySpecs\Reports;


use MoySklad\Components\Specs\QuerySpecs\QuerySpecs;

class ProfitReportQuerySpecs extends QuerySpecs {
protected static $cachedDefaultSpecs = null;

public function getDefaults()
{
$res = parent::getDefaults();
$res['momentFrom'] = null;
$res['momentTo'] = null;
$res['store.id'] = null;
$res['product.id'] = null;
$res['counterparty.id'] = null;
$res['organization.id'] = null;
$res['store.id'] = null;
$res['project.id'] = null;
$res['retailStore.id'] = null;
return $res;
}
}
19 changes: 19 additions & 0 deletions src/Entities/Reports/ProfitReport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace MoySklad\Entities\Reports;

use MoySklad\Components\Specs\QuerySpecs\Reports\ProfitReportQuerySpecs;
use MoySklad\Entities\Documents\AbstractDocument;
use MoySklad\MoySklad;

class ProfitReport extends AbstractReport {
public static $reportName = 'profit';

public static function byProduct(MoySklad $sklad, ProfitReportQuerySpecs $specs = null){
return static::queryWithParam($sklad, 'byproduct', $specs);
}
public static function byEmployee(MoySklad $sklad, ProfitReportQuerySpecs $specs = null){
return static::queryWithParam($sklad, 'byemployee', $specs);
}

}

0 comments on commit 0216fbf

Please sign in to comment.