|
|
@@ -3580,6 +3580,7 @@ class WindykacjaStatsHelper {
|
|
|
$company = WindykacjaStatsModel::get_company($user);
|
|
|
$nr_konta = FunkcjeL1::bankowy_make_nrach($company->NR_RACH_MASS_PAY, $user->ID_BILLING_USERS, 0);
|
|
|
$data_arr["ACCOUNT_NUMBER"] = $nr_konta;
|
|
|
+ $data_arr["SERVICES_STREETS"] = WindykacjaStatsModel::getAllServicesStreetsCSV($user);
|
|
|
// set default values
|
|
|
//$data_arr["A_STATUS"] = "WAITING";
|
|
|
//$data_arr["PAY_FVAT"] = 0;
|
|
|
@@ -4975,7 +4976,28 @@ class WindykacjaStatsModel {
|
|
|
return $_cache[$cache_key];
|
|
|
}
|
|
|
|
|
|
- public static function get_umowy_from_l2(&$user) {
|
|
|
+ public static function getAllServicesStreetsCSV($user) {
|
|
|
+ $streets = array();
|
|
|
+ $db = DB::getDB();
|
|
|
+ $sql = "
|
|
|
+ select s.`S_ADDRESS_STREET`
|
|
|
+ from `COMPANIES` c
|
|
|
+ join `DEALS_TABLE` d on(d.`ID_BILLING_USERS`=c.`ID`)
|
|
|
+ join `SERVICES` s on(s.`ID_BILLING_USERS`=c.`ID` and s.`ID_DEALS_TABLE`=d.`ID`)
|
|
|
+ where c.`ID`='{$user->ID}'
|
|
|
+ -- and c.`A_ADM_COMPANY`='19994_PODMIOT_Vectra_wlasciciel'
|
|
|
+ and s.`NAME_LIST_SERVICES` in ('TV','USERS2','VOIP')
|
|
|
+ and s.`A_STATUS` not in ('DELETED')
|
|
|
+ ";
|
|
|
+ $res = $db->query($sql);
|
|
|
+ while ($r = $db->fetch($res)) {
|
|
|
+ $streets[$r->S_ADDRESS_STREET] = true;
|
|
|
+ }
|
|
|
+ $streets = (!empty($streets))? implode(',', array_keys($streets)) : '';
|
|
|
+ return $streets;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function get_umowy_from_l2($user) {
|
|
|
$ret = array();
|
|
|
$db_webone = DB::getDB();
|
|
|
if (!$db_webone) {
|