-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from alexeyvolodin/profitreport
Profit report entity. (Продажи -> Прибыльность)
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/Components/Specs/QuerySpecs/Reports/ProfitReportQuerySpecs.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |