Skip to content

Commit

Permalink
Change biling list.
Browse files Browse the repository at this point in the history
  • Loading branch information
fumikito committed Jan 24, 2021
1 parent 2fce615 commit 1d3e912
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/Hametuha/Sharee/Models/RevenueModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,13 @@ function( $revenue_id ) {
/**
* Get fixed billing in month.
*
* @param int $year Billing year.
* @param int $month Billing month. If 0 is set, all month.
* @param array $types Predefined type of billing.
* @param int $year Billing year.
* @param int $month Billing month. If 0 is set, all month.
* @param array $types Predefined type of billing.
* @param bool $only_with_deducting Choose only deducting.
* @return array
*/
public function get_fixed_billing( $year, $month = 0, $types = [] ) {
public function get_fixed_billing( $year, $month = 0, $types = [], $only_with_deducting = false ) {
$wheres = [];
if ( $month ) {
// Search with year month.
Expand All @@ -582,6 +583,9 @@ function( $type ) {
)
);
}
if ( $only_with_deducting ) {
$wheres[] = $this->db->prepare( '( deducting < %d )', 0 );
}
$wheres = 'WHERE ' . implode( ' AND ', $wheres );
$query = <<<SQL
SELECT
Expand Down

0 comments on commit 1d3e912

Please sign in to comment.