Changeset 34e771d
- Timestamp:
- Jun 1, 2018, 6:01:56 PM (5 years ago)
- Branches:
- master
- Children:
- 1a20251
- Parents:
- 0eb0537
- Files:
-
- 4 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
common/document.php
r0eb0537 r34e771d 157 157 static function getListTypes() { 158 158 $list = array(); 159 for($i=1;$i< 50;$i++) {159 for($i=1;$i<25;$i++) { 160 160 $item = self::getClassNameFromType($i); 161 161 if($item) { -
common/pricewriter/basepricewriter.php
r0eb0537 r34e771d 30 30 protected $vendor_filter = ''; ///< Фильтр по производителю 31 31 protected $count_filter = ''; ///< Фильтр по наличию 32 protected $show_vc = false; ///< Колонока с наименованием производителя 33 protected $show_vn = false; ///< Колонока с наименованием производителя 32 34 33 35 /// Конструктор … … 40 42 $this->view_groups = false; 41 43 $this->view_groupname = true; 44 $this->show_vc = \cfg::get('site', 'price_show_vc', false); 45 $this->show_vn = \cfg::get('site', 'price_show_vn', false); 42 46 } 43 47 -
common/pricewriter/html.php
r0eb0537 r34e771d 77 77 echo"</center><table><tr>"; 78 78 for ($cur_col = 0; $cur_col < $this->column_count; $cur_col++) { 79 if ( @$CONFIG['site']['price_show_vc']) {79 if ($this->show_vc) { 80 80 echo"<th class='cost'>Код</th>"; 81 81 } … … 83 83 } 84 84 echo"</tr>"; 85 if ( @$CONFIG['site']['price_show_vc']) {85 if ($this->show_vc) { 86 86 $this->span = $this->column_count * 3; 87 87 } else { … … 165 165 $name = $group_name .' '.$name; 166 166 } 167 if ( @$CONFIG['site']['price_show_vc']) {167 if ($this->show_vc) { 168 168 echo"<td>" . html_out($nxt['vc']) . "</td>"; 169 169 } -
common/pricewriter/pdf.php
r0eb0537 r34e771d 112 112 $this->pdf->numCols = $CONFIG['site']['price_col_cnt']; 113 113 114 if ($ CONFIG['site']['price_show_vc']) {114 if ($this->show_vc) { 115 115 $str = iconv('UTF-8', 'windows-1251', 'Код'); 116 116 $this->pdf->AddCol('vc', $CONFIG['site']['price_width_vc'], $str, ''); -
common/pricewriter/xls.php
r0eb0537 r34e771d 72 72 $this->format_line[1]->setFgColor(41); 73 73 $this->format_line[1]->SetSize(12); 74 75 $this->format_exists = array(); 76 $this->format_exists[0] = & $this->workbook->addFormat(); 77 $this->format_exists[0]->setColor(0); 78 $this->format_exists[0]->setFgColor(26); 79 $this->format_exists[0]->SetSize(12); 80 $this->format_exists[0]->SetAlign('right'); 81 $this->format_exists[1] = & $this->workbook->addFormat(); 82 $this->format_exists[1]->setColor(0); 83 $this->format_exists[1]->setFgColor(41); 84 $this->format_exists[1]->SetSize(12); 85 $this->format_exists[1]->SetAlign('right'); 74 86 75 87 // для серых цен … … 126 138 // Настройка ширины столбцов 127 139 128 if (@$CONFIG['site']['price_show_vc']) { 129 $column_width = array(8, 8, 112, 15, 15); 130 } else { 131 $column_width = array(8, 120, 15, 15); 132 } 140 $name_w = 120; 141 if(\cfg::get('site', 'price_show_vc', false)) { 142 $name_w -= 8; 143 } 144 if($this->show_vn) { 145 $name_w -= 12; 146 } 147 $column_width = [8]; 148 $headers = ["N"]; 149 if($this->show_vc) { 150 $column_width[] = 8; 151 $headers[] = "Код"; 152 } 153 $column_width[] = $name_w; 154 $headers[] = "Наименование"; 155 if($this->show_vn) { 156 $column_width[] = 12; 157 $headers[] = "Произв."; 158 } 159 $column_width[] = 15; 160 $headers[] = "Наличие"; 161 $column_width[] = 15; 162 $headers[] = "Цена"; 163 133 164 foreach ($column_width as $id => $width) { 134 165 $this->worksheet->setColumn($id, $id, $width); … … 170 201 if (is_array($this->view_groups)) { 171 202 $this->line++; 172 //$this->Ln(3);173 //$this->SetFont('','',14);174 //$this->SetTextColor(255,24,24);175 203 $str = 'Прайс содержит неполный список позиций, в соответствии с выбранными критериями при его загрузке с сайта.'; 176 204 $str = iconv('UTF-8', 'windows-1251', $str); … … 182 210 $this->line++; 183 211 $this->worksheet->write(8, 8, ' '); 184 if (@$CONFIG['site']['price_show_vc']) { 185 $headers = array("N", "Код", "Наименование", "Наличие", "Цена"); 186 } else { 187 $headers = array("N", "Наименование", "Наличие", "Цена"); 188 } 212 189 213 foreach ($headers as $id => $item) { 190 214 $headers[$id] = iconv('UTF-8', 'windows-1251', $item); … … 275 299 $this->worksheet->write($this->line, $c++, $nxt['id'], $this->format_line[$i]); // номер 276 300 277 if ( @$CONFIG['site']['price_show_vc']) {301 if ($this->show_vc) { 278 302 $str = iconv('UTF-8', 'windows-1251', $nxt['vc']); 279 303 $this->worksheet->write($this->line, $c++, $str, $this->format_line[$i]); // код производителя … … 289 313 $name = iconv('UTF-8', 'windows-1251', $name); 290 314 $this->worksheet->write($this->line, $c++, $name, $this->format_line[$i]); // наименование 315 316 if ($this->show_vn) { 317 $str = iconv('UTF-8', 'windows-1251', $nxt['proizv']); 318 $this->worksheet->write($this->line, $c++, $str, $this->format_line[$i]); // наименование производителя 319 } 291 320 292 321 $nal = $this->GetCountInfo($nxt['cnt'], $nxt['transit']); 293 322 $str = iconv('UTF-8', 'windows-1251', $nal); 294 $this->worksheet->write($this->line, $c++, $str, $this->format_ line[$i]); // наличие - пока не отображается323 $this->worksheet->write($this->line, $c++, $str, $this->format_exists[$i]); // наличие - пока не отображается 295 324 296 325 $cost = $pc->getPosSelectedPriceValue($nxt['id'], $this->cost_id, $nxt); -
config_all.sample.php
r0eb0537 r34e771d 32 32 ); 33 33 $CONFIG['site']['price_show_vc'] = 0; // Отображать ли столбец с кодом производителя в прайсах 34 $CONFIG['site']['price_show_vn'] = 1; // Отображать ли столбец с наименованием производителя в прайсах 34 35 35 36 -
web/core.php
r0eb0537 r34e771d 813 813 } 814 814 815 $tmpl =new BETemplate;815 $tmpl = new BETemplate; 816 816 testForeignSession(); 817 818 $dop_status=array('new'=>'Новый', 'err'=>'Ошибочный', 'inproc'=>'В процессе', 'ready'=>'Готов', 'ok'=>'Отгружен');819 if (is_array(@$CONFIG['doc']['status_list'])) {820 $CONFIG['doc']['status_list'] = array_merge($dop_status, $CONFIG['doc']['status_list']);821 } else {822 $CONFIG['doc']['status_list'] = $dop_status;823 } -
web/include/acl/service/main.php
r0eb0537 r34e771d 65 65 "mask" => \acl::VIEW | \acl::APPLY 66 66 ), 67 'scripts' => array(68 "name" => "Сценарии и операции",69 "mask" => \acl::VIEW | \acl::APPLY70 ),71 67 'sendprice' => array( 72 68 "name" => "Управление рассылкой прайс-листов", -
web/include/api/document.php
r0eb0537 r34e771d 90 90 \acl::accessGuard([ 'firm.global', 'firm.' . $firm_id], \acl::UPDATE); 91 91 } 92 if ($document->getDocData('ok')) { 93 throw new \Exception("Операция не допускается для проведённого документа!"); 94 } 95 if ($document->getDocData('mark_del')) { 96 throw new \Exception("Операция не допускается для документа, отмеченного для удаления!"); 97 } 92 98 $document->updateDocumentHeader($data); 93 99 $firm_id = $document->getDocData('firm_id'); // т.к. могло измениться -
web/include/doc.realizaciya.php
r0eb0537 r34e771d 63 63 $this->get_docdata(); 64 64 return $this->id; 65 } 66 67 public function getExtControls() { 68 return $this->ext_controls = array( 69 'ishop' => [ 70 'type' => 'label_flag', 71 'label' => 'Заявка интернет-магазина', 72 ], 73 'buyer_info' => [ 74 'type' => 'buyer_info', 75 ], 76 'delivery_info' => [ 77 'type' => 'delivery_info', 78 ], 79 'pay_type' => [ 80 'type' => 'select', 81 'label' => 'Способ оплаты', 82 'data_source' => 'paytype.listnames', 83 ], 84 'status' => [ 85 'type' => 'status', 86 'label' => 'Статус', 87 ], 88 'worker_id' => [ 89 'type' => 'select', 90 'label' => 'Сотрудник', 91 'data_source' => 'worker.listnames', 92 ], 93 ); 65 94 } 66 95 -
web/include/doc.zayavka.php
r0eb0537 r34e771d 51 51 'type' => 'select', 52 52 'label' => 'Способ оплаты', 53 'data_source' => 'paytype s',53 'data_source' => 'paytype.listnames', 54 54 ], 55 55 'status' => [ … … 60 60 'type' => 'select', 61 61 'label' => 'Сотрудник', 62 'data_source' => 'worker s',62 'data_source' => 'worker.listnames', 63 63 ], 64 64 ); … … 324 324 if (@$this->dop_data['pay_type']) { 325 325 $tmpl->addContent("<b>Способ оплаты: </b>"); 326 switch ($this->dop_data['pay_type']) { 327 case 'bank': $tmpl->addContent("безналичный"); 328 break; 329 case 'cash': $tmpl->addContent("наличными"); 330 break; 331 case 'card': $tmpl->addContent("картой ?"); 332 break; 333 case 'card_o': $tmpl->addContent("картой на сайте"); 334 break; 335 case 'card_t': $tmpl->addContent("картой при получении"); 336 break; 337 case 'wmr': $tmpl->addContent("Webmoney WMR"); 338 break; 339 default: $tmpl->addContent("не определён ({$this->dop_data['pay_type']})"); 326 $ldo = new \Models\LDO\paytypes(); 327 $paytypes = $ldo->getData(); 328 if(isset($paytypes[$this->dop_data['pay_type']])) { 329 $tmpl->addContent($paytypes[$this->dop_data['pay_type']]); 330 } 331 else { 332 $tmpl->addContent("не определён ({$this->dop_data['pay_type']})"); 340 333 } 341 334 $tmpl->addContent("<br>"); … … 384 377 $tmpl->addContent("<option value=''>Не задан</option>"); 385 378 } 386 foreach ($CONFIG['doc']['status_list'] as $id => $name) { 379 $ldo = new \Models\LDO\zstatuses(); 380 $status_list = $ldo->getData(); 381 foreach ($status_list as $id => $name) { 387 382 $s = (@$this->dop_data['status'] == $id) ? 'selected' : ''; 388 383 $tmpl->addContent("<option value='$id' $s>$name</option>"); -
web/incomp_orders.php
r0eb0537 r34e771d 107 107 108 108 $new_lines = $inproc_lines = $other_lines = $ready_lines = ''; 109 109 $ldo = new \Models\LDO\zstatuses(); 110 $zstatus_list = $ldo->getData(); 110 111 while ($line = $res->fetch_assoc()) { 111 112 if ($line['status'] == 'ok' || $line['status'] == 'err') { … … 118 119 $line['status'] = 'new'; 119 120 } 120 $status = @$ CONFIG['doc']['status_list'][$line['status']];121 $status = @$zstatus_list[$line['status']]; 121 122 if ($line['resp_name'] == 'anonymous') { 122 123 $line['resp_name'] = '-'; -
web/js/doceditor.js
r0eb0537 r34e771d 11 11 doc.label_classname = 'label'; 12 12 doc.input_id_prefix = 'dochead_'; 13 listproxy.prefetch(['agent.shortlist', 'firm.listnames', 'mybank.shortlist', 'store.shortlist', 'price.listnames', 'deliverytype.listnames', 'deliveryregion.getlist', 'deliveryregion.listnames']); 13 listproxy.prefetch(['agent.shortlist', 'firm.listnames', 'mybank.shortlist', 'store.shortlist', 'price.listnames', 'deliverytype.listnames', 14 'deliveryregion.getlist', 'deliveryregion.listnames', 'worker.listnames']); 14 15 15 16 function clearHighlight() { … … 20 21 if(response.errortype=='AccessException') { 21 22 if(response.object=='document' && response.action=='cancel') { 22 jAlert(response.errormessage+"<br><br>Вы можете <a href='#' onclick=\"return petitionMenu(event, ' {$this->id}')\""+23 jAlert(response.errormessage+"<br><br>Вы можете <a href='#' onclick=\"return petitionMenu(event, '"+doc.id+"')\""+ 23 24 ">попросить руководителя</a> выполнить отмену этого документа.", "Не достаточно привилегий!", null, 'icon_err'); 24 25 doc.updateMainMenu(); … … 47 48 } 48 49 else if(response.action=='update') { 49 left_block.style.backgroundColor = '# afa';50 left_block.style.backgroundColor = '#cfc'; 50 51 if (hltimer) { 51 52 window.clearTimeout(hltimer); 52 53 } 53 hltimer = window.setTimeout(clearHighlight, 400); 54 hltimer = window.setTimeout(clearHighlight, 500); 55 if(response.content.header) { 56 doc.header = response.content.header; 57 } 54 58 } 55 59 else if(response.action=='apply' || response.action=='cancel' ) { … … 127 131 } 128 132 } 129 function insertContractList(select_elem, data, selected_id, not_select_item) {133 function updateContractList(select_elem, data, selected_id, not_select_item) { 130 134 var i; 131 if(not_select_item) { 132 var opt = newElement('option', select_elem, '', '--не задано--'); 133 opt.value='null'; 134 } 135 select_elem.innerHTML = ''; 136 var found = 0; 137 var selected = 0; 135 138 for(i in data) { 136 var str = data[i].name + " N:" + data[i].altnum + data[i].subtype + ", от " + data[i].date; 139 var str = "N:" + data[i].altnum + data[i].subtype + ", от " + data[i].date; 140 if(data[i].name!=null) { 141 str = data[i].name + " " + str; 142 } 137 143 var opt = newElement('option', select_elem, '', str); 138 144 opt.value = data[i].id; 139 145 if(data[i].id==selected_id) { 140 146 opt.selected=true; 141 } 142 } 143 } 144 145 function initStoreSelect(store_list) { 147 selected = 1; 148 } 149 found = 1; 150 } 151 if(not_select_item) { 152 var opt = newElement('option', select_elem, '', '--не задано--'); 153 opt.value='null'; 154 } 155 } 156 157 function initStoreSelect() { 146 158 var i; 147 159 var firm_id = doc.i_firm_id.value; 148 160 var select_elem = doc.i_store_id; 149 var selected = false; 150 select_elem.innerHTML = ''; 151 152 for(i in store_list) { 153 var line = store_list[i]; 154 if(line.firm_id>0 && line.firm_id!=firm_id) { 155 continue; 156 } 157 var opt = newElement('option', select_elem, '', line.name); 158 opt.value = line.id; 159 if(line.id==doc.header.store_id) { 160 opt.selected = true; 161 selected = true; 162 } 163 } 164 if( (!doc.header.store_id) || (!selected)) { 165 var opt = newElement('option', select_elem, '', '--не задано--'); 166 opt.value='null'; 167 opt.selected=true; 168 } 169 } 170 171 function initBankSelect() { 172 function refill(bank_list) { 161 var store_list; 162 163 function refill() { 164 var selected = false; 165 select_elem.innerHTML = ''; 166 for(i in store_list) { 167 var line = store_list[i]; 168 if(line.firm_id>0 && line.firm_id!=firm_id) { 169 console.log("lfi:"+line.firm_id+",fi:"+firm_id); 170 continue; 171 } 172 var opt = newElement('option', select_elem, '', line.name); 173 opt.value = line.id; 174 if(line.id==doc.header.store_id) { 175 opt.selected = true; 176 selected = true; 177 } 178 } 179 if( (!doc.header.store_id) || (!selected)) { 180 var opt = newElement('option', select_elem, '', '--не задано--'); 181 opt.value='null'; 182 opt.selected=true; 183 } 184 } 185 function onNewData(key, value) { 186 store_list = value; 187 refill(); 188 } 189 if(select_elem.setbind == undefined) { 190 listproxy.bind('store.shortlist', onNewData); 191 } 192 else { 193 refill(); 194 } 195 } 196 197 function initBankSelect() { 198 var select_elem = doc.i_bank_id; 199 var bank_list; 200 function refill() { 173 201 var i; 174 var firm_id = doc.i_firm_id.value; 175 var select_elem = doc.i_bank_id; 202 var firm_id = doc.i_firm_id.value; 176 203 var selected = false; 177 204 select_elem.innerHTML = ''; … … 196 223 } 197 224 } 198 function onNewData(key, data) { 199 refill(data); 200 } 201 listproxy.bind('mybank.shortlist', onNewData); 225 function onNewData(key, value) { 226 bank_list = value; 227 refill(); 228 } 229 if(select_elem.setbind == undefined) { 230 listproxy.bind('mybank.shortlist', onNewData); 231 } 232 else { 233 refill(); 234 } 235 202 236 } 203 237 … … 316 350 document.getElementById('contract_edit_link').href='/test_doc.php?doc_id='+doc.header.contract_id; 317 351 doc.i_contract_id = document.getElementById('dochead_contract_id'); 318 insertContractList(doc.i_contract_id, doc.header.agent_info.contract_list, doc.header.contract_id, true);352 updateContractList(doc.i_contract_id, doc.header.agent_info.contract_list, doc.header.contract_id, true); 319 353 } 320 354 321 355 function onChangeHeaderField() { 322 left_block.style.backgroundColor = '#ff 8';356 left_block.style.backgroundColor = '#ffc'; 323 357 var fstruct = formToArray(); 324 358 delete fstruct['agent_name']; … … 370 404 371 405 function showBuyerEditor(event) { 372 406 alert("В настоящее время эта информация не редактируется!"); 373 407 } 374 408 … … 535 569 return rootElement; 536 570 } 571 572 function newSelectElement(name, options) { 573 var rootElement = document.createElement('div'); 574 rootElement.className = doc.element_classname; 575 var labelElement = document.createElement('div'); 576 labelElement.className = doc.label_classname; 577 var label = document.createTextNode(options.label+':'); 578 labelElement.appendChild(label); 579 rootElement.appendChild(labelElement); 580 var selectElement = document.createElement('select'); 581 selectElement.name = name; 582 selectElement.id = doc.input_id_prefix+name; 583 rootElement.appendChild(selectElement); 584 doc.head_form.appendChild(rootElement); 585 rootElement.select = selectElement; 586 selectElement.label = labelElement; 587 return rootElement; 588 } 537 589 538 590 function initExtFields(data) { … … 544 596 var field = ext_fields[i]; 545 597 switch(field.type) { 598 case 'select': 599 var element = newSelectElement(i, field); 600 var cb = function() { 601 var e = element; 602 var value = data[i]; 603 function refillSelect(key, info) { 604 updateOptionsArray(e.select, info, value, true); 605 }; 606 return refillSelect; 607 }(); 608 listproxy.bind(field.data_source, cb); 609 element.select.onchange = onChangeHeaderField; 610 break; 546 611 case 'text': 547 612 var element = newTextElement(i, data[i], field); … … 618 683 case 'firm.listnames': 619 684 updateOptionsArray(doc.i_firm_id, data, doc.header.firm_id); 620 break;621 case 'store.shortlist':622 initStoreSelect(data);623 685 break; 624 686 case 'cash.shortlist': … … 716 778 var tmp = newElement('div', doc.head_form, 'item', templates.store); 717 779 doc.i_store_id = document.getElementById('dochead_store_id'); 718 listproxy.bind('store.shortlist', onNewData);780 initStoreSelect(); 719 781 doc.i_store_id.onchange = onChangeHeaderField; 720 782 break; -
web/skins/inner/style.css
r0eb0537 r34e771d 893 893 894 894 895 /* Новый вид документов */896 897 #doc_left_block898 {899 float: left;900 background-color: #f5f5f5;901 width: 310px;902 padding: 5px;903 padding-left: 10px;904 padding-top: 0;905 font-size: 12px;906 }907 908 895 909 896 … … 1061 1048 1062 1049 /* ajax вид документов */ 1050 1051 #doc_left_block { 1052 float: left; 1053 background-color: #f5f5f5; 1054 width: 310px; 1055 padding: 5px; 1056 padding-left: 10px; 1057 padding-top: 0; 1058 font-size: 12px; 1059 transition: background-color, 0.5s; 1060 } 1061 1062 1063 1064 1063 1065 #doc_left_block h1 { 1064 1066 text-align: center; … … 1083 1085 background-color: #fff; 1084 1086 width: 100%; 1087 transition: background-color, 0.8s; 1085 1088 } 1086 1089 … … 1090 1093 padding-bottom: 4px; 1091 1094 padding-top: 2px; 1092 border-bottom: 1px #ddd dotted;1095 /*border-bottom: 1px #ddd dotted;*/ 1093 1096 } 1094 1097 … … 1100 1103 #doc_left_block div.infoblock { 1101 1104 cursor: pointer; 1105 border-bottom: 1px #ddd dotted; 1102 1106 } 1103 1107
Note: See TracChangeset
for help on using the changeset viewer.