Kaynağa Gözat

Umowy kiedy rozliczyć (closes #90)

Piotr Labudda 11 yıl önce
ebeveyn
işleme
7b206d4f61
1 değiştirilmiş dosya ile 3 ekleme ve 13 silme
  1. 3 13
      SE/superedit-POKAZ_OFERTY_AKTUALNE_FUNC.php

+ 3 - 13
SE/superedit-POKAZ_OFERTY_AKTUALNE_FUNC.php

@@ -1287,7 +1287,7 @@ body {font:11px helvetica, arial;}
 			return;
 		}
 
-		$deals = PokazOfertyHelper::get_deals_by_month($month, array('A_STATUS'=>'NORMAL'));
+		$deals = PokazOfertyHelper::getDealsRozlicz($month, array('A_STATUS'=>'NORMAL'));
 
 		if (empty($deals)) {
 			echo '<p>' . "Brak umów w wybranym miesiącu" . '</p>';
@@ -1358,12 +1358,9 @@ body {font:11px helvetica, arial;}
 		$tblOutCells['check_errors'] = 			(object)array('class'=>'num', 'type'=>'array_of_errors');
 
 		if(V::get('DBG_PO', '', $_GET)>0){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">deals (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($deals);echo'</pre>';}
-		$dealsAll = PokazOfertyHelper::get_deals_created_in_month($month, array('A_STATUS'=>'NORMAL', 'pominId'=>array_keys($deals)));
-		if(V::get('DBG_PO', '', $_GET)>0){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">dealsAll (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($dealsAll);echo'</pre>';}
 
 		$dealsOut = array();
 		foreach ($deals as $k_id => $v_deal_row)    $dealsOut[$k_id] = $v_deal_row;
-		foreach ($dealsAll as $k_id => $v_deal_row) $dealsOut[$k_id] = $v_deal_row;
 
 		foreach ($dealsOut as $k_id => $v_deal_row) {
 			$deal = new Column_deals_table();
@@ -4968,12 +4965,10 @@ class PokazOfertyHelper {
 		return $deals;
 	}
 
-	public static function get_deals_created_in_month($month, $params = array()) {
+	public static function getDealsRozlicz($month, $params = array()) {
 		$deals = array();
 
 		$sql_status = "";
-		$sql_pominId = "";
-
 		$status = V::get('A_STATUS', '', $params);
 		if (!empty($status)) {
 			$allowed_status = array('WAITING', 'NORMAL');
@@ -4990,18 +4985,13 @@ class PokazOfertyHelper {
 				$sql_status = "and d.`A_STATUS` in (" . implode(',', $sql_status_arr) . ")";
 			}
 		}
-		$pominId = V::get('pominId', '', $params);
-		if (!empty($pominId)) {
-			$sql_pominId = "and `ID` not in(" . implode(",", $pominId) . ")";
-		}
 
 		$db = DB::getDB();
 		$sql = "select d.*
 			from `DEALS_TABLE` as d
 			where
-				d.`A_RECORD_CREATE_DATE` like '{$month}-%'
+				d.`ROZLICZ_MONTH` like '{$month}-%'
 				{$sql_status}
-				{$sql_pominId}
 		";
 		$res = $db->query($sql);
 		while ($r = $db->fetch($res)) {