Changeset dd4d97c
- Timestamp:
- Mar 19, 2014, 12:34:36 PM (10 years ago)
- Branches:
- master
- Children:
- 55a04f8
- Parents:
- cd75712
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
db_patches/634_640.sql
rcd75712 rdd4d97c 1 ALTER TABLE `doc_cost` CHANGE `context``context` VARCHAR( 8 ) NOT NULL COMMENT 'Контекст цены определяет места её использования';1 ALTER TABLE `doc_cost` ADD `context` VARCHAR( 8 ) NOT NULL COMMENT 'Контекст цены определяет места её использования'; 2 2 ALTER TABLE `doc_cost` ADD `priority` TINYINT NOT NULL COMMENT 'Приоритет задаёт очерёдность цен с одним контекстом' AFTER `context`; 3 3 ALTER TABLE `doc_cost` ADD `bulk_threshold` INT NOT NULL COMMENT 'Порог включения цены по сумме заказа'; -
web/core.php
rcd75712 rdd4d97c 151 151 } 152 152 return $fphone; 153 } 154 155 /// Округление в нужную сторону 156 /// @param number Исходное число 157 /// @param precision Точность округления 158 /// @param direction Направление округления 159 function roundDirect($number, $precision = 0, $direction = 0) 160 { 161 if ($direction==0 ) return round($number, $precision); 162 else 163 { 164 $factor = pow(10, -1 * $precision); 165 return ($direction<0) 166 ? floor($number / $factor) * $factor 167 : ceil($number / $factor) * $factor; 168 } 153 169 } 154 170 -
web/include/doc.core.php
rcd75712 rdd4d97c 269 269 } 270 270 271 /// Округление в нужную сторону 272 /// @param number Исходное число 273 /// @param precision Точность округления 274 /// @param direction Направление округления 275 function roundDirect($number, $precision = 0, $direction = 0) 276 { 277 if ($direction==0 ) return round($number, $precision); 278 else 279 { 280 $factor = pow(10, -1 * $precision); 281 return ($direction<0) 282 ? floor($number / $factor) * $factor 283 : ceil($number / $factor) * $factor; 284 } 285 } 271 286 272 287 273 /// Запись событий документов в лог -
web/include/doc.nulltype.php
rcd75712 rdd4d97c 1762 1762 if (!$this->doc) 1763 1763 throw new Exception("Документ не определён!"); 1764 $r = $db->query("SELECT `doc_list_pos`.`id`, `doc_list_pos`.`tovar`,1764 $res = $db->query("SELECT `doc_list_pos`.`id`, `doc_list_pos`.`tovar`, 1765 1765 `doc_base`.`cost` AS `base_price`, `doc_base`.`group`, `doc_base`.`bulkcnt` 1766 1766 FROM `doc_list_pos` … … 1770 1770 1771 1771 while($l = $res->fetch_assoc()) { 1772 $price = $pc->getPosSelectedPriceValue($l[ 1], $this->dop_data['cena'], $l);1773 $db->update('doc_list_pos', $l[ 0], 'cost', $price);1772 $price = $pc->getPosSelectedPriceValue($l['tovar'], $this->dop_data['cena'], $l); 1773 $db->update('doc_list_pos', $l['id'], 'cost', $price); 1774 1774 } 1775 1775 } -
web/include/doc.poseditor.php
rcd75712 rdd4d97c 207 207 208 208 while ($nxt = $res->fetch_assoc()) { 209 if ($this->cost_id) $nxt['scost'] = $pc->getPos DefaultPriceValue($nxt['pos_id'], $this->cost_id, $nxt);209 if ($this->cost_id) $nxt['scost'] = $pc->getPosSelectedPriceValue($nxt['pos_id'], $this->cost_id, $nxt); 210 210 else $nxt['scost'] = sprintf("%0.2f", $nxt['base_price']); 211 211 $nxt['cost'] = sprintf("%0.2f", $nxt['cost']); … … 247 247 if ($this->cost_id) { 248 248 $pc = PriceCalc::getInstance(); 249 $nxt['scost'] = $pc->getPos DefaultPriceValue($nxt['pos_id'], $this->cost_id, $nxt);249 $nxt['scost'] = $pc->getPosSelectedPriceValue($nxt['pos_id'], $this->cost_id, $nxt); 250 250 } 251 251 else $nxt['scost'] = sprintf("%0.2f", $nxt['bcost']); … … 361 361 if($this->cost_id) { 362 362 $pc = PriceCalc::getInstance(); 363 $nxt['cost'] = $pc->getPos DefaultPriceValue($nxt['pos_id'], $this->cost_id, $nxt);363 $nxt['cost'] = $pc->getPosSelectedPriceValue($nxt['pos_id'], $this->cost_id, $nxt); 364 364 } 365 365 else $nxt['cost'] = $nxt['base_price']; -
web/include/pricecalc.php
rcd75712 rdd4d97c 226 226 227 227 if($res->num_rows!=0) { 228 $line = $res->fetch_ row();228 $line = $res->fetch_assoc(); 229 229 switch($line['type']) { 230 230 case 'pp': $price = $pos_info['base_price'] * $line['value'] / 100 + $pos_info['base_price']; -
web/include/reports/pricetags.php
rcd75712 rdd4d97c 374 374 $pos_info[$id] .= ' '.$pos_info['unit_name']; 375 375 $str = iconv('UTF-8', 'windows-1251', $text . $pos_info[$id]); 376 $pdf-> Cell($param['width'], $param['lheight'], $str, 0, 0, $param['align']);376 $pdf->MultiCell($param['width'], $param['lheight'], $str, 0, $param['align']); 377 377 } 378 378 } -
web/message.php
rcd75712 rdd4d97c 195 195 196 196 if(mb_strlen($comment)>8) { 197 $res = $db->query("SELECT `reg_email` FROM `users` WHERE `id`='{$_SESSION['uid']}'"); 198 list($from) = $res->fetch_row(); 199 if($from=='') $from=$CONFIG['site']['doc_adm_email']; 197 $res = $db->query("SELECT `users`.`reg_email`, `users_worker_info`.`worker_email` FROM `users` 198 LEFT JOIN `users_worker_info` ON `users_worker_info`.`user_id`=`users`.`id` 199 WHERE `id`='{$_SESSION['uid']}'"); 200 $user_info = $res->fetch_array(); 201 if($user_info['worker_email'] != '') $from = $user_info['worker_email']; 202 else if($user_info['reg_email'] != '') $from = $user_info['reg_email']; 203 else $from = $CONFIG['site']['doc_adm_email']; 200 204 201 205 $res = $db->query("SELECT `doc_list`.`altnum`, `doc_list`.`subtype`, `doc_list`.`sum`, `doc_list`.`date`, `doc_agent`.`name`, `doc_types`.`name` … … 208 212 209 213 $date=date("d.m.Y H:i:s",$nxt[3]); 210 211 $txt="Здравствуйте!\nПользователь {$_SESSION['name']} просит Вас отменить проводку документа *$nxt[5]* с ID: $doc, $nxt[0]$nxt[1] от $date на сумму $nxt[2]. Клиент $nxt[4].\n{$ CONFIG['site']['name']}/doc.php?mode=body&doc=$doc \nЦель отмены: $comment.\n IP: $ip\nПожалуйста, дайте ответ на это письмо на $from, как в случае отмены документа, так и об отказе отмены!";214 $proto=@$_SERVER['HTTPS']?'https':'http'; 215 $txt="Здравствуйте!\nПользователь {$_SESSION['name']} просит Вас отменить проводку документа *$nxt[5]* с ID: $doc, $nxt[0]$nxt[1] от $date на сумму $nxt[2]. Клиент $nxt[4].\n{$proto}://{$CONFIG['site']['name']}/doc.php?mode=body&doc=$doc \nЦель отмены: $comment.\n IP: $ip\nПожалуйста, дайте ответ на это письмо на $from, как в случае отмены документа, так и об отказе отмены!"; 212 216 213 217 if($CONFIG['site']['doc_adm_email'])
Note: See TracChangeset
for help on using the changeset viewer.