From 7455b1cc3a35bfae21b7a670c75ba235d0fc00b1 Mon Sep 17 00:00:00 2001 From: Leon Date: Sat, 20 Jun 2020 00:57:02 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 +- db/update440to441.sql | 2 +- www/app/acl.php | 45 +- www/app/entity/contract.php | 43 +- www/app/entity/doc/document.php | 187 ++++---- www/app/entity/doc/goodsissue.php | 24 +- www/app/entity/doc/goodsreceipt.php | 44 +- www/app/entity/doc/incomeitem.php | 2 +- www/app/entity/doc/incomemoney.php | 2 +- www/app/entity/doc/inventory.php | 28 +- www/app/entity/doc/invoice.php | 57 ++- www/app/entity/doc/invoicecust.php | 14 +- www/app/entity/doc/order.php | 2 +- www/app/entity/doc/ordercust.php | 2 +- www/app/entity/doc/outcomeitem.php | 2 +- www/app/entity/doc/outcomemoney.php | 2 +- www/app/entity/doc/outsalary.php | 2 +- www/app/entity/doc/poscheck.php | 16 +- www/app/entity/doc/prodissue.php | 4 +- www/app/entity/doc/prodreceipt.php | 10 +- www/app/entity/doc/retcustissue.php | 4 +- www/app/entity/doc/returnissue.php | 4 +- www/app/entity/doc/serviceact.php | 22 +- www/app/entity/doc/task.php | 4 +- www/app/entity/doc/transitem.php | 2 +- www/app/entity/doc/warranty.php | 2 +- www/app/entity/employee.php | 2 +- www/app/entity/firm.php | 22 +- www/app/entity/item.php | 75 ++-- www/app/entity/message.php | 16 +- www/app/entity/stock.php | 12 +- www/app/entity/user.php | 62 +-- www/app/entity/userrole.php | 64 +-- www/app/helper.php | 115 ++--- www/app/modules/issue/entity/issue.php | 6 +- www/app/modules/issue/entity/project.php | 29 +- www/app/modules/issue/pages/calendar.php | 2 +- www/app/modules/issue/pages/issuelist.php | 87 ++-- www/app/modules/issue/pages/projectlist.php | 98 ++-- www/app/modules/issue/pages/stat.php | 2 +- www/app/modules/note/entity/topic.php | 16 +- www/app/modules/note/entity/topicnode.php | 2 +- www/app/modules/note/pages/main.php | 74 ++-- www/app/modules/note/pages/showtopic.php | 8 +- www/app/modules/ocstore/helper.php | 2 +- www/app/modules/ocstore/options.php | 6 +- www/app/modules/ocstore/orders.php | 123 +++--- www/app/modules/shop/entity/product.php | 12 +- www/app/modules/shop/entity/productgroup.php | 2 +- www/app/modules/shop/pages/base.php | 18 +- www/app/modules/shop/pages/catalog.php | 10 +- www/app/modules/shop/pages/grouplist.php | 8 +- www/app/modules/shop/pages/manufacturers.php | 2 +- www/app/modules/shop/pages/options.php | 6 +- www/app/modules/shop/pages/productlist.php | 26 +- www/app/modules/shop/pages/productview.php | 8 +- www/app/modules/shop/pages/userlogin.php | 21 +- www/app/modules/wc/orders.php | 4 +- www/app/pages/base.php | 20 +- www/app/pages/doc/goodsissue.php | 81 ++-- www/app/pages/doc/goodsreceipt.php | 147 +++--- www/app/pages/doc/incomeitem.php | 25 +- www/app/pages/doc/inventory.php | 6 +- www/app/pages/doc/invoice.php | 33 +- www/app/pages/doc/invoicecust.php | 84 ++-- www/app/pages/doc/outcomeitem.php | 122 ++--- www/app/pages/doc/poscheck.php | 2 +- www/app/pages/doc/prodissue.php | 39 +- www/app/pages/doc/prodreceipt.php | 4 +- www/app/pages/doc/retcustissue.php | 2 +- www/app/pages/doc/returnissue.php | 2 +- www/app/pages/doc/serviceact.php | 48 +- www/app/pages/doc/task.php | 2 +- www/app/pages/firmlist.php | 30 +- www/app/pages/notifylist.php | 2 +- www/app/pages/options.php | 44 +- www/app/pages/reference/contractlist.php | 40 +- www/app/pages/reference/customerlist.php | 14 +- www/app/pages/reference/employeelist.php | 2 +- www/app/pages/reference/itemlist.php | 39 +- www/app/pages/register/doclist.php | 4 +- www/app/pages/register/gilist.php | 8 +- www/app/pages/register/grlist.php | 8 +- www/app/pages/register/itemlist.php | 6 +- www/app/pages/register/ordercustlist.php | 4 +- www/app/pages/register/orderlist.php | 4 +- www/app/pages/register/paycustlist.php | 6 +- www/app/pages/register/paylist.php | 4 +- www/app/pages/register/serlist.php | 4 +- www/app/pages/register/stocklist.php | 2 +- www/app/pages/register/tasklist.php | 16 +- www/app/pages/report/abc.php | 4 +- www/app/pages/report/custactivity.php | 36 +- www/app/pages/report/custorder.php | 2 +- www/app/pages/report/emptask.php | 4 +- www/app/pages/report/income.php | 8 +- www/app/pages/report/itemactivity.php | 6 +- www/app/pages/report/outcome.php | 47 +- www/app/pages/report/payactivity.php | 6 +- www/app/pages/report/paybalance.php | 4 +- www/app/pages/report/price.php | 2 +- www/app/pages/report/prod.php | 4 +- www/app/pages/report/salaryrep.php | 6 +- www/app/pages/roles.php | 227 ++++++---- www/app/pages/service/armpos.php | 10 +- www/app/pages/service/export.php | 79 ++-- www/app/pages/service/import.php | 4 +- www/app/pages/showdoc.php | 8 +- www/app/pages/userlogin.php | 106 ++--- www/app/pages/userprofile.php | 8 +- www/app/pages/users.php | 26 +- www/app/session.php | 2 +- www/app/system.php | 8 +- www/app/widgets/docview.php | 16 +- www/app/widgets/itemsel.php | 10 +- www/app/widgets/wopendocs.php | 2 +- www/app/widgets/wplanneddocs.php | 2 +- www/app/widgets/wrdoc.php | 2 +- www/app/widgets/wsdate.php | 2 +- www/config/config.ini | 16 +- www/templates/emails/invoice.tpl | 10 - www/templates/lang.json | 61 ++- .../modules/issue/pages/issuelist.html | 26 +- .../modules/issue/pages/projectlist.html | 71 +-- www/templates/modules/note/pages/main.html | 21 +- www/templates/modules/ocstore/options.html | 20 +- www/templates/modules/ocstore/orders.html | 17 +- www/templates/modules/shop/pages/aboutus.html | 15 +- www/templates/modules/shop/pages/base.html | 169 +++---- www/templates/modules/shop/pages/catalog.html | 173 ++++---- www/templates/modules/shop/pages/compare.html | 19 +- www/templates/modules/shop/pages/contact.html | 57 +-- .../modules/shop/pages/delivery.html | 15 +- .../modules/shop/pages/grouplist.html | 241 +++++----- www/templates/modules/shop/pages/main.html | 84 ++-- .../modules/shop/pages/manufacturers.html | 67 +-- www/templates/modules/shop/pages/options.html | 195 ++++---- www/templates/modules/shop/pages/order.html | 155 +++---- .../modules/shop/pages/productlist.html | 354 +++++++-------- .../modules/shop/pages/productview.html | 236 +++++----- www/templates/pages/base.html | 87 ++-- www/templates/pages/doc/goodsissue.html | 46 +- www/templates/pages/doc/goodsreceipt.html | 59 +-- www/templates/pages/doc/invoice.html | 32 +- www/templates/pages/doc/invoicecust.html | 34 +- www/templates/pages/doc/outcomeitem.html | 32 +- www/templates/pages/doc/serviceact.html | 34 +- www/templates/pages/doc/task.html | 2 +- www/templates/pages/firmlist.html | 46 +- www/templates/pages/options.html | 76 ++-- .../pages/reference/contractlist.html | 53 +-- .../pages/reference/customerlist.html | 4 +- .../pages/reference/employeelist.html | 2 +- www/templates/pages/reference/itemlist.html | 70 +-- .../pages/reference/servicelist.html | 12 +- www/templates/pages/reference/storelist.html | 2 +- www/templates/pages/register/gilist.html | 24 +- www/templates/pages/register/grlist.html | 28 +- www/templates/pages/register/itemlist.html | 12 +- www/templates/pages/register/tasklist.html | 15 +- www/templates/pages/report/custactivity.html | 4 +- www/templates/pages/report/outcome.html | 4 +- www/templates/pages/roles.html | 417 ++++++++++-------- www/templates/pages/service/armpos.html | 14 +- www/templates/pages/service/export.html | 108 ++--- www/templates/pages/service/import.html | 6 +- www/templates/pages/userlogin.html | 31 +- www/templates/pages/userprofile.html | 1 - www/templates/pages/users.html | 33 +- www/templates/printforms/doc/goodsissue.tpl | 31 +- www/templates/printforms/doc/goodsreceipt.tpl | 14 +- www/templates/printforms/doc/invoice.tpl | 71 +-- www/templates/printforms/doc/invoicecust.tpl | 14 +- www/templates/printforms/doc/order.tpl | 2 +- .../printforms/doc/poscheck_bill.tpl | 4 +- www/templates/printforms/doc/serviceact.tpl | 9 +- .../printforms/doc/serviceact_bill.tpl | 4 +- www/templates/printforms/doc/task.tpl | 4 +- www/templates/printforms/emails/invoice.tpl | 11 + www/templates/printforms/item_tag.tpl | 4 +- www/templates/printforms/report/abc.tpl | 2 +- .../printforms/report/custactivity.tpl | 15 +- www/templates/printforms/report/custorder.tpl | 2 +- www/templates/printforms/report/emptask.tpl | 2 +- www/templates/printforms/report/income.tpl | 48 +- .../printforms/report/itemactivity.tpl | 4 +- www/templates/printforms/report/outcome.tpl | 98 ++-- .../printforms/report/payactivity.tpl | 4 +- .../printforms/report/paybalance.tpl | 10 +- www/templates/printforms/report/price.tpl | 2 +- www/templates/printforms/report/prod.tpl | 2 +- www/templates/widgets/docview.html | 4 +- www/templates/widgets/itemsel.html | 16 +- www/templates_ua/emails/invoice.tpl | 7 - www/templates_ua/lang.json | 52 ++- .../modules/issue/pages/issuelist.html | 47 +- .../modules/issue/pages/projectlist.html | 73 +-- www/templates_ua/modules/note/pages/main.html | 16 +- www/templates_ua/modules/ocstore/options.html | 17 +- www/templates_ua/modules/ocstore/orders.html | 13 +- .../modules/shop/pages/aboutus.html | 15 +- www/templates_ua/modules/shop/pages/base.html | 162 +++---- .../modules/shop/pages/catalog.html | 175 ++++---- .../modules/shop/pages/compare.html | 19 +- .../modules/shop/pages/contact.html | 57 +-- .../modules/shop/pages/delivery.html | 15 +- .../modules/shop/pages/grouplist.html | 241 +++++----- www/templates_ua/modules/shop/pages/main.html | 84 ++-- .../modules/shop/pages/manufacturers.html | 67 +-- .../modules/shop/pages/options.html | 195 ++++---- .../modules/shop/pages/order.html | 155 +++---- .../modules/shop/pages/productlist.html | 354 +++++++-------- .../modules/shop/pages/productview.html | 236 +++++----- www/templates_ua/pages/base.html | 43 +- www/templates_ua/pages/doc/goodsissue.html | 44 +- www/templates_ua/pages/doc/goodsreceipt.html | 55 +-- www/templates_ua/pages/doc/invoice.html | 31 +- www/templates_ua/pages/doc/invoicecust.html | 30 +- www/templates_ua/pages/doc/outcomeitem.html | 35 +- www/templates_ua/pages/doc/serviceact.html | 34 +- www/templates_ua/pages/doc/task.html | 2 +- www/templates_ua/pages/firmlist.html | 44 +- www/templates_ua/pages/options.html | 98 ++-- .../pages/reference/contractlist.html | 58 +-- .../pages/reference/customerlist.html | 2 +- .../pages/reference/employeelist.html | 2 +- .../pages/reference/itemlist.html | 67 +-- www/templates_ua/pages/register/gilist.html | 22 +- www/templates_ua/pages/register/grlist.html | 22 +- www/templates_ua/pages/register/itemlist.html | 12 +- .../pages/register/paycustlist.html | 3 +- www/templates_ua/pages/register/tasklist.html | 6 +- .../pages/report/custactivity.html | 2 +- www/templates_ua/pages/report/outcome.html | 6 +- www/templates_ua/pages/roles.html | 417 ++++++++++-------- www/templates_ua/pages/service/armpos.html | 14 +- www/templates_ua/pages/service/export.html | 6 +- www/templates_ua/pages/service/import.html | 6 +- www/templates_ua/pages/userlogin.html | 33 +- www/templates_ua/pages/userprofile.html | 1 - www/templates_ua/pages/users.html | 33 +- .../printforms/doc/goodsissue.tpl | 38 +- .../printforms/doc/goodsreceipt.tpl | 20 +- www/templates_ua/printforms/doc/invoice.tpl | 70 +-- .../printforms/doc/invoicecust.tpl | 20 +- www/templates_ua/printforms/doc/order.tpl | 2 +- .../printforms/doc/poscheck_bill.tpl | 4 +- .../printforms/doc/serviceact.tpl | 7 +- .../printforms/doc/serviceact_bill.tpl | 4 +- www/templates_ua/printforms/doc/task.tpl | 4 +- .../printforms/emails/invoice.tpl | 11 + www/templates_ua/printforms/item_tag.tpl | 4 +- .../printforms/report/custactivity.tpl | 10 +- www/templates_ua/printforms/report/income.tpl | 48 +- .../printforms/report/itemactivity.tpl | 2 +- .../printforms/report/outcome.tpl | 99 ++--- .../printforms/report/payactivity.tpl | 4 +- .../printforms/report/paybalance.tpl | 10 +- www/templates_ua/widgets/docview.html | 4 +- www/templates_ua/widgets/itemsel.html | 14 +- 260 files changed, 5256 insertions(+), 4905 deletions(-) delete mode 100644 www/templates/emails/invoice.tpl create mode 100644 www/templates/printforms/emails/invoice.tpl delete mode 100644 www/templates_ua/emails/invoice.tpl create mode 100644 www/templates_ua/printforms/emails/invoice.tpl diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bbfc7fdf..ff1fddcd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,13 @@ CHANGELOG ========= -### v4.4.1 (2020-06-15) -* Указание участников в проектах. +### v4.4.1 (2020-06-21) +* Исправления и улучшения в модулях Органайзер (База знаний) и Проекты и задачи. Измеения требуют обновления структуры БД файлом update440to441.sql. * Категории в отчете по продажам -* Исправления и улучшения +* Возможэность добавления изоборажений логотипа, печати и подписи (факсимиле) к +настройкам компании и использование в счете-фактуре. +* Отправка документов (пока только счета-фактуры) по почте в pdf файле. -Для обновления версии обновить папки app, templates, templates_ua. +Для обновления версии обновить папки assets, app, templates, templates_ua. ### v4.4.0 (2020-06-03) diff --git a/db/update440to441.sql b/db/update440to441.sql index 6067fc763..62df79caf 100644 --- a/db/update440to441.sql +++ b/db/update440to441.sql @@ -1,4 +1,4 @@ -ALTER TABLE `issue_history` DROP ` status `; + ALTER TABLE `issue_history` ADD `description` VARCHAR(255) NULL ; diff --git a/www/app/acl.php b/www/app/acl.php index 873caabc2..91aa1fcf7 100644 --- a/www/app/acl.php +++ b/www/app/acl.php @@ -217,20 +217,21 @@ public static function checkExeDoc($doc, $inreg = false, $showerror = true) { return false; } - + /** - * проверка на доступ к отмене документа. - * - * @param mixed $doc документ - * @param mixed $showerror показывать сообщение об ошибке иначе просто вернуть false - */ + * проверка на доступ к отмене документа. + * + * @param mixed $doc документ + * @param mixed $showerror показывать сообщение об ошибке иначе просто вернуть false + */ public static function checkCancelDoc($doc, $inreg = true, $showerror = true) { $user = System::getUser(); - if ($user->rolename =='admins') + if ($user->rolename == 'admins') { return true; - + } + self::load(); - + $aclcancel = explode(',', $user->aclcancel); if (in_array($doc->meta_id, $aclcancel)) { @@ -238,14 +239,15 @@ public static function checkCancelDoc($doc, $inreg = true, $showerror = true) { } if ($showerror == true) { System::setErrorMsg('Нет права отмены документа ' . self::$_metasdesc[$doc]); - if ($inreg == false) + if ($inreg == false) { App::RedirectHome(); + } } return false; } - - + + //проверка на доступ к сервисным станицам public static function checkShowSer($ser, $showerror = true) { if (System::getUser()->rolename == 'admins') { @@ -271,9 +273,9 @@ public static function checkShowSer($ser, $showerror = true) { /** * возвращает ограничение для ресурсов по филиалам - * @param mixed $nul включая те у которых филиал не задан + * @param mixed $nul включая те у которых филиал не задан */ - public static function getBranchConstraint( ) { + public static function getBranchConstraint() { $options = \App\System::getOptions('common'); if ($options['usebranch'] != 1) { return ''; @@ -281,9 +283,9 @@ public static function getBranchConstraint( ) { $id = \App\System::getBranch(); //если выбран конкретный if ($id > 0) { - - return "branch_id in (0,{$id})"; - + + return "branch_id in (0,{$id})"; + } @@ -293,12 +295,11 @@ public static function getBranchConstraint( ) { } if (strlen($user->aclbranch) == 0) { - return "branch_id in (0 )"; + return "branch_id in (0 )"; } //нет доступа ни к одному филиалу - + return "branch_id in (0,{$user->aclbranch})"; - } @@ -332,7 +333,7 @@ public static function getStoreBranchConstraint() { } $id = \App\System::getBranch(); //если выбран конкретный - + if ($id > 0) { return "select stacl.store_id from stores stacl where stacl.branch_id={$id} "; } @@ -428,7 +429,7 @@ public static function getDocBranchConstraint() { /** * Возвращает список филиалов для подстановки в запрос в виде списка цифр - * + * */ public static function getBranchIDsConstraint() { $options = \App\System::getOptions('common'); diff --git a/www/app/entity/contract.php b/www/app/entity/contract.php index 062384782..0a93ac47a 100644 --- a/www/app/entity/contract.php +++ b/www/app/entity/contract.php @@ -20,7 +20,7 @@ protected function init() { protected function afterLoad() { $this->createdon = strtotime($this->createdon); - + $xml = @simplexml_load_string($this->details); $this->shortdesc = (string)($xml->shortdesc[0]); @@ -44,28 +44,31 @@ protected function beforeSave() { return true; } - public static function PayList(){ + public static function PayList() { return array( - 1=>\App\Helper::l('cnal'), - 2=>\App\Helper::l('cbeznal'), - 3=>\App\Helper::l('ckredit'), - 4=>\App\Helper::l('creal') + 1 => \App\Helper::l('cnal'), + 2 => \App\Helper::l('cbeznal'), + 3 => \App\Helper::l('ckredit'), + 4 => \App\Helper::l('creal') ); - } - public static function getList($c,$f=0){ - + } + + public static function getList($c, $f = 0) { + $ar = array(); - if(strlen($f)==0)$f=0; - if($c>0 ) { - $where="disabled <> 1 and customer_id={$c} and coalesce(firm_id,0) = {$f} " ; - - $res = Contract::find($where,'contract_number'); - foreach($res as $k=>$v) { - $ar[$k] = $v->contract_number .' '. $v->shortdesc ; - } - - } - + if (strlen($f) == 0) { + $f = 0; + } + if ($c > 0) { + $where = "disabled <> 1 and customer_id={$c} and coalesce(firm_id,0) = {$f} "; + + $res = Contract::find($where, 'contract_number'); + foreach ($res as $k => $v) { + $ar[$k] = $v->contract_number . ' ' . $v->shortdesc; + } + + } + return $ar; } } diff --git a/www/app/entity/doc/document.php b/www/app/entity/doc/document.php index db156165b..e3de9533d 100644 --- a/www/app/entity/doc/document.php +++ b/www/app/entity/doc/document.php @@ -34,7 +34,7 @@ class Document extends \ZCL\DB\Entity const EX_EXCEL = 2; // Excel const EX_PDF = 3; // PDF const EX_POS = 4; // POS терминал - const EX_MAIL = 5; // Отправка email + const EX_MAIL = 5; // Отправка email // const EX_XML_GNAU = 4; @@ -52,9 +52,9 @@ class Document extends \ZCL\DB\Entity */ public $detaildata = array(); - private static $_metalist = array(); - - + private static $_metalist = array(); + + /** * документы должны создаватся методом create * @@ -322,12 +322,12 @@ public static function create($classname, $branch_id = 0) { $doc = new $fullclassname(); $doc->meta_id = $meta['meta_id']; - + $doc->branch_id = $branch_id; - if ($branch_id == 0 ) { + if ($branch_id == 0) { $doc->branch_id = \App\Acl::checkCurrentBranch(); } - + return $doc; } @@ -438,27 +438,31 @@ public static function getStateName($state) { * * @return mixed */ - public function nextNumber($branch_id=0) { + public function nextNumber($branch_id = 0) { $class = explode("\\", get_called_class()); $metaname = $class[count($class) - 1]; $doc = Document::getFirst("meta_name='" . $metaname . "'", "document_id desc"); $conn = \ZDB\DB::getConnect(); - $branch=""; - if($branch_id>0) $branch=" and branch_id=".$branch_id; - + $branch = ""; + if ($branch_id > 0) { + $branch = " and branch_id=" . $branch_id; + } + $sql = "select document_number from documents_view where meta_name='{$metaname}' {$branch} order by document_id desc limit 0,1"; $prevnumber = $conn->GetOne($sql); if (strlen($prevnumber) == 0) { $prevnumber = $this->getNumberTemplate(); - } - - if (strlen($prevnumber) == 0) + } + + if (strlen($prevnumber) == 0) { return ''; + } $number = preg_replace('/[^0-9]/', '', $prevnumber); - if (strlen($number) == 0) + if (strlen($number) == 0) { $number = 0; + } $letter = preg_replace('/[0-9]/', '', $prevnumber); @@ -606,11 +610,12 @@ public static function getConstraint() { $c .= " and user_id = " . $user->user_id; } - if(strlen($user->aclview)>0) - $c .= " and meta_id in({$user->aclview}) "; - else - $c .= " and meta_id in(0) "; - } + if (strlen($user->aclview) > 0) { + $c .= " and meta_id in({$user->aclview}) "; + } else { + $c .= " and meta_id in(0) "; + } + } return $c; } @@ -682,94 +687,100 @@ public function packDetails($dataname, $list) { } /** - * Локализованное название документа по мета имени - * - * @param mixed $meta_name - */ - public static function getDesc($meta_name){ + * Локализованное название документа по мета имени + * + * @param mixed $meta_name + */ + public static function getDesc($meta_name) { if (isset(self::$_metalist[$meta_name])) { return self::$_metalist[$meta_name]; } $conn = \ZDB\DB::getConnect(); $rs = $conn->Execute("select description, meta_name from metadata "); - foreach ($rs as $m) { + foreach ($rs as $m) { self::$_metalist[$m['meta_name']] = $m['description']; } - return self::$_metalist[$meta_name]; + return self::$_metalist[$meta_name]; } - - - /** + + + /** * Отправка документа по почте * */ public function sendEmail() { global $_config; + $doc = $this->cast(); - if($doc->customer_id==0){ + if ($doc->customer_id == 0) { return; } - + $customer = \App\Entity\Customer::load($doc->customer_id); - - $doc = $this->cast(); - - $filename = strtolower($doc->meta_name).".pdf"; + + + $filename = strtolower($doc->meta_name) . ".pdf"; $html = $doc->generateReport(); - - $dompdf = new \Dompdf\Dompdf(array('isRemoteEnabled' => true,'defaultFont' => 'DejaVu Sans')); - $dompdf->loadHtml($html); - - $dompdf->render(); - - $data = $dompdf->output(); - - $f = tempnam(sys_get_temp_dir(),"eml") ; - file_put_contents($f,$data) ; - - $mail = new \PHPMailer\PHPMailer\PHPMailer(); - $mail->isSMTP(); - $mail->Host = $_config['smtp']['host']; - $mail->Port = $_config['smtp']['port']; - $mail->Username = $_config['smtp']['user']; - $mail->Password = $_config['smtp']['password']; - $mail->SMTPAuth = true; - if($_config['smtp']['tls']=='true'){ - $mail->SMTPSecure = \PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS; - } - - - $mail->setFrom($_config['smtp']['user'],$_config['smtp']['username']); - $mail->addAddress($customer->email); - $mail->Subject = $doc->getEmailSubject(); - $mail->msgHTML($doc->getEmailBody()); - $mail->CharSet = "UTF-8"; - $mail->IsHTML(true); - $mail->AddAttachment($f, $filename, 'base64', 'application/pdf'); - if($mail->send()===false){ - System::setErrorMsg($mail->ErrorInfo); - } else { - System::setSuccessMsg(Helper::l('email_sent')); - } - + + + try { + $dompdf = new \Dompdf\Dompdf(array('isRemoteEnabled' => true, 'defaultFont' => 'DejaVu Sans')); + $dompdf->loadHtml($html); + + $dompdf->render(); + + $data = $dompdf->output(); + + $f = tempnam(sys_get_temp_dir(), "eml"); + file_put_contents($f, $data); + + $mail = new \PHPMailer\PHPMailer\PHPMailer(); + $mail->isSMTP(); + $mail->Host = $_config['smtp']['host']; + $mail->Port = $_config['smtp']['port']; + $mail->Username = $_config['smtp']['user']; + $mail->Password = $_config['smtp']['pass']; + $mail->SMTPAuth = true; + if ($_config['smtp']['tls'] == 'true') { + $mail->SMTPSecure = \PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS; + } + + $mail->setFrom($_config['smtp']['user'], ''); + $mail->addAddress($customer->email); + $mail->Subject = $doc->getEmailSubject(); + $mail->msgHTML($doc->getEmailBody()); + $mail->CharSet = "UTF-8"; + $mail->IsHTML(true); + $mail->AddAttachment($f, $filename, 'base64', 'application/pdf'); + if ($mail->send() === false) { + System::setErrorMsg($mail->ErrorInfo); + } else { + System::setSuccessMsg(Helper::l('email_sent')); + } + } catch (Exception $e) { + System::setErrorMsg($e->message); + } + + @unlink($f); - - } - - /** - * возвращает заполненый шаблон письма - * - */ - protected function getEmailBody(){ - return ""; - } - /** - * возвращает тему письма - * - */ - protected function getEmailSubject(){ - return ""; + + } + + /** + * возвращает заполненый шаблон письма + * + */ + protected function getEmailBody() { + return ""; + } + + /** + * возвращает тему письма + * + */ + protected function getEmailSubject() { + return ""; } } diff --git a/www/app/entity/doc/goodsissue.php b/www/app/entity/doc/goodsissue.php index dc54bb741..19a53605e 100644 --- a/www/app/entity/doc/goodsissue.php +++ b/www/app/entity/doc/goodsissue.php @@ -25,7 +25,7 @@ public function generateReport() { if (strlen($item->snumber) > 0) { $s = ' (' . $item->snumber . ' )'; if (strlen($item->sdate) > 0) { - $s = ' (' . $item->snumber . ',' . H::fd( $item->sdate) . ')'; + $s = ' (' . $item->snumber . ',' . H::fd($item->sdate) . ')'; } $name .= $s; @@ -46,9 +46,9 @@ public function generateReport() { $totalstr = H::sumstr($this->amount); - $firm = H::getFirmData($this->branch_id,$this->headerdata["firm_id"]); + $firm = H::getFirmData($this->branch_id, $this->headerdata["firm_id"]); - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "firm_name" => $firm['firm_name'], "customer_name" => $this->customer_name, @@ -58,7 +58,7 @@ public function generateReport() { "weight" => $weight > 0 ? H::l("allweight", $weight) : '', "ship_address" => $this->headerdata["ship_address"], "ship_number" => $this->headerdata["ship_number"], - "delivery_cost" =>H::fa( $this->headerdata["delivery_cost"]), + "delivery_cost" => H::fa($this->headerdata["delivery_cost"]), "order" => strlen($this->headerdata["order"]) > 0 ? $this->headerdata["order"] : false, "emp_name" => $this->headerdata["emp_name"], "document_number" => $this->document_number, @@ -70,19 +70,19 @@ public function generateReport() { "prepaid" => $this->headerdata['payment'] == \App\Entity\MoneyFund::PREPAID, "payamount" => H::fa($this->payamount) ); - + if ($this->headerdata["contract_id"] > 0) { - $contract=\App\Entity\Contract::load($this->headerdata["contract_id"]); - $header['contract'] = $contract->contract_number ; - $header['createdon'] = H::fd($contract->createdon) ; + $contract = \App\Entity\Contract::load($this->headerdata["contract_id"]); + $header['contract'] = $contract->contract_number; + $header['createdon'] = H::fd($contract->createdon); } - - + + if ($this->headerdata["sent_date"] > 0) { - $header['sent_date'] = H::fd( $this->headerdata["sent_date"]); + $header['sent_date'] = H::fd($this->headerdata["sent_date"]); } if ($this->headerdata["delivery_date"] > 0) { - $header['delivery_date'] = H::fd( $this->headerdata["delivery_date"]); + $header['delivery_date'] = H::fd($this->headerdata["delivery_date"]); } $header["isdelivery"] = $this->headerdata["delivery"] > 1; diff --git a/www/app/entity/doc/goodsreceipt.php b/www/app/entity/doc/goodsreceipt.php index 7b9538acf..3169292f9 100644 --- a/www/app/entity/doc/goodsreceipt.php +++ b/www/app/entity/doc/goodsreceipt.php @@ -14,15 +14,15 @@ class GoodsReceipt extends Document { public function generateReport() { - $firm = H::getFirmData($this->branch_id,$this->headerdata["firm_id"]); - + $firm = H::getFirmData($this->branch_id, $this->headerdata["firm_id"]); + $i = 1; $detail = array(); foreach ($this->unpackDetails('detaildata') as $item) { $name = $item->itemname; if (strlen($item->snumber) > 0) { - $name .= ' (' . $item->snumber . ',' . H::fd( $item->sdate) . ')'; + $name .= ' (' . $item->snumber . ',' . H::fd($item->sdate) . ')'; } $detail[] = array("no" => $i++, @@ -36,13 +36,13 @@ public function generateReport() { ); } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "basedoc" => $this->headerdata["basedoc"], "firm_name" => $firm['firm_name'], - "isfirm" => strlen($firm["firm_name"]) > 0, + "isfirm" => strlen($firm["firm_name"]) > 0, "iscontract" => $this->headerdata["contract_id"] > 0, - "isval" => ($this->_doc->headerdata['val'])>1 , + "isval" => ($this->_doc->headerdata['val']) > 1, "customer_name" => $this->customer_name, "document_number" => $this->document_number, "total" => H::fa($this->amount), @@ -50,22 +50,24 @@ public function generateReport() { "prepaid" => $this->headerdata['payment'] == \App\Entity\MoneyFund::PREPAID, "payamount" => H::fa($this->payamount) ); - if ($this->headerdata["contract_id"] > 0) { - $contract=\App\Entity\Contract::load($this->headerdata["contract_id"]); - $header['contract'] = $contract->contract_number ; - $header['createdon'] = H::fd($contract->createdon) ; + if ($this->headerdata["contract_id"] > 0) { + $contract = \App\Entity\Contract::load($this->headerdata["contract_id"]); + $header['contract'] = $contract->contract_number; + $header['createdon'] = H::fd($contract->createdon); } $header['isdisc'] = $this->headerdata["disc"] > 0; $header['isnds'] = $this->headerdata["nds"] > 0; - $header['isval'] = strlen($this->headerdata['val'])>1; - + $header['isval'] = strlen($this->headerdata['val']) > 1; + $header['disc'] = H::fa($this->headerdata["disc"]); $header['nds'] = H::fa($this->headerdata["nds"]); $header['rate'] = $this->headerdata["rate"]; - if($header['rate']==0 || $header['rate']==1) $header['isval']=false; - $val = H::getValList(); - $header['val'] = $val[$this->headerdata['val']]; + if ($header['rate'] == 0 || $header['rate'] == 1) { + $header['isval'] = false; + } + $val = H::getValList(); + $header['val'] = $val[$this->headerdata['val']]; $report = new \App\Report('doc/goodsreceipt.tpl'); @@ -108,17 +110,15 @@ public function Execute() { $sc->save(); - + //запоминаем курс - if(strlen($this->headerdata['val'])>1 && $this->headerdata['rate']!=0 && $this->headerdata['rate'] !=1 ){ + if (strlen($this->headerdata['val']) > 1 && $this->headerdata['rate'] != 0 && $this->headerdata['rate'] != 1) { $it = Item::load($item->item_id); - $it->val=$this->headerdata['val']; - $it->rate=$this->headerdata['rate']; + $it->val = $this->headerdata['val']; + $it->rate = $this->headerdata['rate']; $it->save(); } - - - + } diff --git a/www/app/entity/doc/incomeitem.php b/www/app/entity/doc/incomeitem.php index 2e0d98a09..ef33180a5 100644 --- a/www/app/entity/doc/incomeitem.php +++ b/www/app/entity/doc/incomeitem.php @@ -51,7 +51,7 @@ public function generateReport() { $header = array( "_detail" => $detail, - 'date' => H::fd( $this->document_date), + 'date' => H::fd($this->document_date), "total" => H::fa($this->amount), "to" => $this->headerdata["storename"], "notes" => $this->notes, diff --git a/www/app/entity/doc/incomemoney.php b/www/app/entity/doc/incomemoney.php index 30aa1d40d..c1731fb74 100644 --- a/www/app/entity/doc/incomemoney.php +++ b/www/app/entity/doc/incomemoney.php @@ -27,7 +27,7 @@ public function generateReport() { $header = array( 'amount' => H::fa($this->amount), - 'date' => H::fd( $this->document_date), + 'date' => H::fd($this->document_date), "notes" => $this->notes, "type" => $pt[$this->headerdata["type"]], "to" => $this->headerdata["paymentname"], diff --git a/www/app/entity/doc/inventory.php b/www/app/entity/doc/inventory.php index 45313f566..0b586ed21 100644 --- a/www/app/entity/doc/inventory.php +++ b/www/app/entity/doc/inventory.php @@ -14,29 +14,31 @@ class Inventory extends Document { public function Execute() { - + $conn = \ZDB\DB::getConnect(); - + foreach ($this->unpackDetails('detaildata') as $item) { if ($item->quantity == $item->qfact) { continue; } - + //оприходуем if ($item->quantity < $item->qfact) { $qty = $item->qfact - $item->quantity; $where = "store_id=" . $this->headerdata['store'] . " and item_id=" . $item->item_id; - $price=0; + $price = 0; $stp = Stock::getFirst($where, "stock_id desc"); //последняя цена - if($stp->partion>0) $price = $stp->partion; - $stock = Stock::getStock($this->headerdata['store'],$item->item_id,$price,$item->snumber,time(),true); //последняя цена + if ($stp->partion > 0) { + $price = $stp->partion; + } + $stock = Stock::getStock($this->headerdata['store'], $item->item_id, $price, $item->snumber, time(), true); //последняя цена + - $sc = new Entry($this->document_id, $qty * $stock->partion, $qty); $sc->setStock($stock->stock_id); $sc->save(); - } - + } + //списываем со склада if ($item->quantity > $item->qfact) { $item->quantity = $item->quantity - $item->qfact; @@ -46,10 +48,10 @@ public function Execute() { $sc->setStock($st->stock_id); $sc->save(); } - } - + } + } - + return true; } @@ -75,7 +77,7 @@ public function generateReport() { $header = array( "_detail" => $detail, - 'date' => H::fd( $this->document_date), + 'date' => H::fd($this->document_date), "store" => $this->headerdata["storename"], "document_number" => $this->document_number ); diff --git a/www/app/entity/doc/invoice.php b/www/app/entity/doc/invoice.php index b327991a2..62a81bbc3 100644 --- a/www/app/entity/doc/invoice.php +++ b/www/app/entity/doc/invoice.php @@ -13,8 +13,8 @@ class Invoice extends \App\Entity\Doc\Document public function generateReport() { - $firm = H::getFirmData($this->branch_id,$this->headerdata["firm_id"]); - + $firm = H::getFirmData($this->branch_id, $this->headerdata["firm_id"]); + $i = 1; $detail = array(); @@ -37,22 +37,22 @@ public function generateReport() { $totalstr = H::sumstr($this->amount); - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "customer_name" => $this->customer_name, "firm_name" => $firm['firm_name'], - "logo" => _BASEURL.$firm['logo'], - "islogo" => strlen($firm['logo'])>0, - "stamp" => _BASEURL.$firm['stamp'], - "isstamp" => strlen($firm['stamp'])>0, - "sign" => _BASEURL.$firm['sign'], - "issign" => strlen($firm['sign'])>0, + "logo" => _BASEURL . $firm['logo'], + "islogo" => strlen($firm['logo']) > 0, + "stamp" => _BASEURL . $firm['stamp'], + "isstamp" => strlen($firm['stamp']) > 0, + "sign" => _BASEURL . $firm['sign'], + "issign" => strlen($firm['sign']) > 0, "isfirm" => strlen($firm["firm_name"]) > 0, "iscontract" => $this->headerdata["contract_id"] > 0, "phone" => $this->headerdata["phone"], "bank" => $firm["bank"], "bankacc" => $firm["bankacc"], - "isbank" => (strlen($firm["bankacc"])>0 && strlen($firm["bank"])>0), + "isbank" => (strlen($firm["bankacc"]) > 0 && strlen($firm["bank"]) > 0), "email" => $this->headerdata["email"], "notes" => $this->notes, "document_number" => $this->document_number, @@ -63,9 +63,9 @@ public function generateReport() { "paydisc" => H::fa($this->headerdata["paydisc"]) ); if ($this->headerdata["contract_id"] > 0) { - $contract=\App\Entity\Contract::load($this->headerdata["contract_id"]); - $header['contract'] = $contract->contract_number ; - $header['createdon'] = H::fd($contract->createdon) ; + $contract = \App\Entity\Contract::load($this->headerdata["contract_id"]); + $header['contract'] = $contract->contract_number; + $header['createdon'] = H::fd($contract->createdon); } @@ -106,13 +106,28 @@ public function getRelationBased() { return $list; } - - protected function getEmailBody(){ - return ""; + + protected function getEmailBody() { + $firm = H::getFirmData($this->branch_id, $this->headerdata["firm_id"]); + + + $header = array(); + $header['customer_name'] = $this->customer_name; + $header['firm_name'] = $firm["firm_name"]; + $header['number'] = $this->document_number; + $header['date'] = H::fd($this->document_date); + $header['amount'] = H::fa($this->amount); + + + $report = new \App\Report('emails/invoice.tpl'); + + $html = $report->generate($header); + + return $html; } - - protected function getEmailSubject(){ - return H::l('emailinvsub',$this->document_number); - } - + + protected function getEmailSubject() { + return H::l('emailinvsub', $this->document_number); + } + } diff --git a/www/app/entity/doc/invoicecust.php b/www/app/entity/doc/invoicecust.php index 457b3b2f9..fa57fd1a3 100644 --- a/www/app/entity/doc/invoicecust.php +++ b/www/app/entity/doc/invoicecust.php @@ -12,7 +12,7 @@ class InvoiceCust extends Document { public function generateReport() { - $firm = H::getFirmData($this->branch_id,$this->headerdata["firm_id"]); + $firm = H::getFirmData($this->branch_id, $this->headerdata["firm_id"]); $i = 1; @@ -28,21 +28,21 @@ public function generateReport() { ); } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "customer_name" => $this->customer_name, "document_number" => $this->document_number, "firm_name" => $firm['firm_name'], - "isfirm" => strlen($firm["firm_name"]) > 0, + "isfirm" => strlen($firm["firm_name"]) > 0, "iscontract" => $this->headerdata["contract_id"] > 0, - "total" => H::fa($this->amount), + "total" => H::fa($this->amount), "payed" => H::fa($this->payed), "payamount" => H::fa($this->payamount) ); if ($this->headerdata["contract_id"] > 0) { - $contract=\App\Entity\Contract::load($this->headerdata["contract_id"]); - $header['contract'] = $contract->contract_number ; - $header['createdon'] = H::fd($contract->createdon) ; + $contract = \App\Entity\Contract::load($this->headerdata["contract_id"]); + $header['contract'] = $contract->contract_number; + $header['createdon'] = H::fd($contract->createdon); } $header['isdisc'] = $this->headerdata["disc"] > 0; diff --git a/www/app/entity/doc/order.php b/www/app/entity/doc/order.php index fb1ab7436..645005ec5 100644 --- a/www/app/entity/doc/order.php +++ b/www/app/entity/doc/order.php @@ -44,7 +44,7 @@ public function generateReport() { } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "customer_name" => $this->customer_name, "phone" => $this->headerdata["phone"], diff --git a/www/app/entity/doc/ordercust.php b/www/app/entity/doc/ordercust.php index 9cc393566..1cfe413fb 100644 --- a/www/app/entity/doc/ordercust.php +++ b/www/app/entity/doc/ordercust.php @@ -28,7 +28,7 @@ public function generateReport() { ); } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "customer_name" => $this->customer_name, "document_number" => $this->document_number, diff --git a/www/app/entity/doc/outcomeitem.php b/www/app/entity/doc/outcomeitem.php index 42cb9be65..6e04209db 100644 --- a/www/app/entity/doc/outcomeitem.php +++ b/www/app/entity/doc/outcomeitem.php @@ -54,7 +54,7 @@ public function generateReport() { $header = array( "_detail" => $detail, - 'date' => H::fd( $this->document_date), + 'date' => H::fd($this->document_date), "from" => $this->headerdata["storename"], "notes" => $this->notes, "document_number" => $this->document_number diff --git a/www/app/entity/doc/outcomemoney.php b/www/app/entity/doc/outcomemoney.php index 1dc692cfd..48a9e9860 100644 --- a/www/app/entity/doc/outcomemoney.php +++ b/www/app/entity/doc/outcomemoney.php @@ -27,7 +27,7 @@ public function generateReport() { $header = array( 'amount' => H::fa($this->amount), - 'date' => H::fd( $this->document_date), + 'date' => H::fd($this->document_date), "notes" => $this->notes, "from" => $this->headerdata["paymentname"], "type" => $pt[$this->headerdata["type"]], diff --git a/www/app/entity/doc/outsalary.php b/www/app/entity/doc/outsalary.php index a6af54cdc..228a74625 100644 --- a/www/app/entity/doc/outsalary.php +++ b/www/app/entity/doc/outsalary.php @@ -35,7 +35,7 @@ public function generateReport() { $header = array( "_detail" => $detail, 'total' => H::fa($this->amount), - 'date' => H::fd( $this->document_date), + 'date' => H::fd($this->document_date), "notes" => $this->notes, "month" => $this->headerdata["monthname"], "year" => $this->headerdata["year"], diff --git a/www/app/entity/doc/poscheck.php b/www/app/entity/doc/poscheck.php index 45d8ff8ca..488366470 100644 --- a/www/app/entity/doc/poscheck.php +++ b/www/app/entity/doc/poscheck.php @@ -23,7 +23,7 @@ public function generateReport() { $name = $item->itemname; if (strlen($item->snumber) > 0) { - $name .= ' (' . $item->snumber . ',' . H::fd( $item->sdate) . ')'; + $name .= ' (' . $item->snumber . ',' . H::fd($item->sdate) . ')'; } @@ -48,9 +48,9 @@ public function generateReport() { } - $firm = H::getFirmData($this->branch_id,$this->headerdata["firm_id"]); + $firm = H::getFirmData($this->branch_id, $this->headerdata["firm_id"]); - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "firm_name" => $firm["firm_name"], "shopname" => $firm["shopname"], @@ -59,7 +59,7 @@ public function generateReport() { "customer_name" => strlen($this->customer_name) > 0 ? $this->customer_name : false, "exchange" => $this->headerdata["exchange"], "pos_name" => $this->headerdata["pos_name"], - "time" => H::fdt( $this->headerdata["time"]), + "time" => H::fdt($this->headerdata["time"]), "document_number" => $this->document_number, "total" => H::fa($this->amount), "payed" => H::fa($this->payed), @@ -91,7 +91,7 @@ public function generatePosReport() { "amount" => H::fa($item->quantity * $item->price) ); } - $i=1; + $i = 1; foreach ($this->unpackDetails('services') as $ser) { $detail[] = array("no" => $i++, "tovar_name" => $ser->service_name, @@ -100,9 +100,9 @@ public function generatePosReport() { ); } - $firm = H::getFirmData($this->branch_id,$this->headerdata["firm_id"]); + $firm = H::getFirmData($this->branch_id, $this->headerdata["firm_id"]); - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "firm_name" => $firm["firm_name"], "shopname" => strlen($firm["shopname"]) > 0 ? $firm["shopname"] : false, @@ -112,7 +112,7 @@ public function generatePosReport() { "customer_name" => strlen($this->headerdata["customer_name"]) > 0 ? $this->headerdata["customer_name"] : false, "exchange" => $this->headerdata["exchange"], "pos_name" => $this->headerdata["pos_name"], - "time" => H::fdt( $this->headerdata["time"]), + "time" => H::fdt($this->headerdata["time"]), "document_number" => $this->document_number, "total" => H::fa($this->amount), "payed" => H::fa($this->payed), diff --git a/www/app/entity/doc/prodissue.php b/www/app/entity/doc/prodissue.php index a8d485ecf..fe5051cdf 100644 --- a/www/app/entity/doc/prodissue.php +++ b/www/app/entity/doc/prodissue.php @@ -25,7 +25,7 @@ public function generateReport() { } else { $name = $item->itemname; if (strlen($item->snumber) > 0) { - $name .= ' (' . $item->snumber . ',' . H::fd( $item->sdate) . ')'; + $name .= ' (' . $item->snumber . ',' . H::fd($item->sdate) . ')'; } @@ -41,7 +41,7 @@ public function generateReport() { } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "pareaname" => $this->headerdata["pareaname"], "document_number" => $this->document_number, diff --git a/www/app/entity/doc/prodreceipt.php b/www/app/entity/doc/prodreceipt.php index 6f722f1ca..73f76dcf2 100644 --- a/www/app/entity/doc/prodreceipt.php +++ b/www/app/entity/doc/prodreceipt.php @@ -22,7 +22,7 @@ public function generateReport() { $name = $item->itemname; if (strlen($item->snumber) > 0) { - $name .= ' (' . $item->snumber . ',' . H::fd( $item->sdate) . ')'; + $name .= ' (' . $item->snumber . ',' . H::fd($item->sdate) . ')'; } @@ -36,7 +36,7 @@ public function generateReport() { ); } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "document_number" => $this->document_number, "pareaname" => $this->headerdata["pareaname"], @@ -58,10 +58,10 @@ public function Execute() { //аналитика foreach ($this->unpackDetails('detaildata') as $item) { - $listst = \App\Entity\Stock::pickup($this->headerdata['store'], $item ); + $listst = \App\Entity\Stock::pickup($this->headerdata['store'], $item); foreach ($listst as $st) { - $sc = new Entry($this->document_id, $st->quantity * $item->price, $st->quantity); + $sc = new Entry($this->document_id, $st->quantity * $item->price, $st->quantity); $sc->setStock($st->stock_id); $sc->save(); } @@ -80,7 +80,7 @@ protected function getNumberTemplate() { public function getRelationBased() { $list = array(); $list['ProdReceipt'] = self::getDesc('ProdReceipt'); - $list['ProdIssue'] = self::getDesc('ProdIssue'); + $list['ProdIssue'] = self::getDesc('ProdIssue'); return $list; } diff --git a/www/app/entity/doc/retcustissue.php b/www/app/entity/doc/retcustissue.php index 093664a90..bbd227c7c 100644 --- a/www/app/entity/doc/retcustissue.php +++ b/www/app/entity/doc/retcustissue.php @@ -25,7 +25,7 @@ public function generateReport() { } else { $name = $item->itemname; if (strlen($item->snumber) > 0) { - $name .= ' (' . $item->snumber . ',' . H::fd( $item->sdate) . ')'; + $name .= ' (' . $item->snumber . ',' . H::fd($item->sdate) . ')'; } $detail[] = array("no" => $i++, @@ -42,7 +42,7 @@ public function generateReport() { $customer = \App\Entity\Customer::load($this->customer_id); - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "firm_name" => $this->headerdata["firm_name"], "customer_name" => $this->customer_name, diff --git a/www/app/entity/doc/returnissue.php b/www/app/entity/doc/returnissue.php index af4452451..c76632feb 100644 --- a/www/app/entity/doc/returnissue.php +++ b/www/app/entity/doc/returnissue.php @@ -25,7 +25,7 @@ public function generateReport() { } else { $name = $item->itemname; if (strlen($item->snumber) > 0) { - $name .= ' (' . $item->snumber . ',' . H::fd( $item->sdate) . ')'; + $name .= ' (' . $item->snumber . ',' . H::fd($item->sdate) . ')'; } $detail[] = array("no" => $i++, @@ -39,7 +39,7 @@ public function generateReport() { } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "firm_name" => $this->headerdata["firm_name"], "customer_name" => $this->customer_name, diff --git a/www/app/entity/doc/serviceact.php b/www/app/entity/doc/serviceact.php index 3492fa12b..2385fcc58 100644 --- a/www/app/entity/doc/serviceact.php +++ b/www/app/entity/doc/serviceact.php @@ -14,7 +14,7 @@ class ServiceAct extends Document { public function generateReport() { - $firm = H::getFirmData($this->branch_id,$this->headerdata["firm_id"]); + $firm = H::getFirmData($this->branch_id, $this->headerdata["firm_id"]); $i = 1; @@ -27,7 +27,7 @@ public function generateReport() { ); } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "customer_name" => $this->customer_name, "firm_name" => $firm['firm_name'], @@ -43,12 +43,12 @@ public function generateReport() { "total" => H::fa($this->amount) ); if ($this->headerdata["contract_id"] > 0) { - $contract=\App\Entity\Contract::load($this->headerdata["contract_id"]); - $header['contract'] = $contract->contract_number ; - $header['createdon'] = H::fd($contract->createdon) ; + $contract = \App\Entity\Contract::load($this->headerdata["contract_id"]); + $header['contract'] = $contract->contract_number; + $header['createdon'] = H::fd($contract->createdon); } - - + + $report = new \App\Report('doc/serviceact.tpl'); $html = $report->generate($header); @@ -86,13 +86,13 @@ protected function getNumberTemplate() { public function generatePosReport() { $printer = \App\System::getOptions('printer'); - $firm = H::getFirmData($this->branch_id,$this->headerdata["firm_id"]); + $firm = H::getFirmData($this->branch_id, $this->headerdata["firm_id"]); $wp = 'style="width:40mm"'; if (strlen($printer['pwidth']) > 0) { $wp = 'style="width:' . $printer['pwidth'] . 'mm"'; } - $header = array('printw' => $wp, 'date' => H::fd( time()), + $header = array('printw' => $wp, 'date' => H::fd(time()), "document_number" => $this->document_number, "firm_name" => $firm['firm_name'], "shopname" => strlen($firm['shopname']) > 0 ? $firm['shopname'] : false, @@ -104,7 +104,7 @@ public function generatePosReport() { "total" => H::fa($this->amount) ); if (strlen($this->headerdata['gar']) > 0) { - $header['gar'] = H::l('garant'). ': ' . $this->headerdata['gar']; + $header['gar'] = H::l('garant') . ': ' . $this->headerdata['gar']; } $detail = array(); $i = 1; @@ -120,7 +120,7 @@ public function generatePosReport() { if (count($pays) > 0) { $header['plist'] = array(); foreach ($pays as $pay) { - $header['plist'][] = array('pdate' => H::fd( $pay->paydate), 'ppay' => H::fa($pay->amount)); + $header['plist'][] = array('pdate' => H::fd($pay->paydate), 'ppay' => H::fa($pay->amount)); } } $header['ispay'] = count($pays) > 0; diff --git a/www/app/entity/doc/task.php b/www/app/entity/doc/task.php index 2520e91b0..00f1abf8c 100644 --- a/www/app/entity/doc/task.php +++ b/www/app/entity/doc/task.php @@ -45,9 +45,9 @@ public function generateReport() { ); } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "pareaname" => strlen($this->headerdata["pareaname"]) > 0 ? $this->headerdata["pareaname"] : false, - "document_date" => H::fd( $this->document_date), + "document_date" => H::fd($this->document_date), "document_number" => $this->document_number, "notes" => $this->notes, "baseddoc" => strlen($this->headerdata["parent_number"]) > 0 ? $this->headerdata["parent_number"] : false, diff --git a/www/app/entity/doc/transitem.php b/www/app/entity/doc/transitem.php index 0d2a8a1d9..784828df0 100644 --- a/www/app/entity/doc/transitem.php +++ b/www/app/entity/doc/transitem.php @@ -57,7 +57,7 @@ public function generateReport() { } $header = array( - 'date' => H::fd( $this->document_date), + 'date' => H::fd($this->document_date), "from" => Store::load($this->headerdata["store"])->storename, "fromitemname" => $fi->itemname . ', ' . $this->headerdata["fromquantity"] . $fi->msr, "toitemname" => $ti->itemname . ', ' . $this->headerdata["toquantity"] . $ti->msr, diff --git a/www/app/entity/doc/warranty.php b/www/app/entity/doc/warranty.php index 2cae0d179..846d42d0d 100644 --- a/www/app/entity/doc/warranty.php +++ b/www/app/entity/doc/warranty.php @@ -29,7 +29,7 @@ public function generateReport() { } - $header = array('date' => H::fd( $this->document_date), + $header = array('date' => H::fd($this->document_date), "_detail" => $detail, "firm_name" => $this->headerdata["firm_name"], "customer_name" => $this->customer_name, diff --git a/www/app/entity/employee.php b/www/app/entity/employee.php index b41087273..8fd2c0755 100644 --- a/www/app/entity/employee.php +++ b/www/app/entity/employee.php @@ -29,7 +29,7 @@ protected function beforeSave() { $this->detail .= "{$this->email}"; $this->detail .= "{$this->phone}"; $this->detail .= "comment}]]>"; - + $this->detail .= ""; return true; diff --git a/www/app/entity/firm.php b/www/app/entity/firm.php index 21042b768..b6f9c80c4 100644 --- a/www/app/entity/firm.php +++ b/www/app/entity/firm.php @@ -3,7 +3,7 @@ namespace App\Entity; /** - * Класс-сущность компания + * Класс-сущность компания * * @table=firms * @keyfield=firm_id @@ -20,9 +20,14 @@ protected function afterLoad() { $xml = @simplexml_load_string($this->details); $this->address = (string)($xml->address[0]); - $this->inn = (string)($xml->inn[0]); + $this->inn = (string)($xml->inn[0]); $this->phone = (string)($xml->phone[0]); $this->shopname = (string)($xml->shopname[0]); + $this->bank = (string)($xml->bank[0]); + $this->bankacc = (string)($xml->bankacc[0]); + $this->logo = (string)($xml->logo[0]); + $this->stamp = (string)($xml->stamp[0]); + $this->sign = (string)($xml->sign[0]); parent::afterLoad(); } @@ -30,9 +35,14 @@ protected function afterLoad() { protected function beforeSave() { parent::beforeSave(); - $this->details = "
"; + $this->details = "
"; $this->details .= "
address}]]>
"; $this->details .= "shopname}]]>"; + $this->details .= "bank}]]>"; + $this->details .= "bankacc}]]>"; + $this->details .= "logo}]]>"; + $this->details .= "stamp}]]>"; + $this->details .= "sign}]]>"; $this->details .= "{$this->inn}"; $this->details .= "{$this->phone}"; $this->details .= "
"; @@ -47,11 +57,11 @@ protected function beforeDelete() { $cntc = $conn->GetOne($sql); $sql = " select count(*) from documents where content like '%{$this->firm_id}%' "; $cntd = $conn->GetOne($sql); - return ($cntc > 0 || $cntd>0 ) ? \App\Helper::l('nodelfirm') : ""; + return ($cntc > 0 || $cntd > 0) ? \App\Helper::l('nodelfirm') : ""; } public static function getList() { return Firm::findArray("firm_name", "disabled <> 1", "firm_name"); - } - + } + } diff --git a/www/app/entity/item.php b/www/app/entity/item.php index 238225201..003fe5268 100644 --- a/www/app/entity/item.php +++ b/www/app/entity/item.php @@ -33,9 +33,9 @@ protected function afterLoad() { $this->price3 = (string)($xml->price3[0]); $this->price4 = (string)($xml->price4[0]); $this->price5 = (string)($xml->price5[0]); - $this->rate = (string)($xml->rate[0]); - $this->val = (string)($xml->val[0]); - + $this->rate = (string)($xml->rate[0]); + $this->val = (string)($xml->val[0]); + $this->pricelist = (int)$xml->pricelist[0]; $this->useserial = (int)$xml->useserial[0]; $this->image_id = (int)$xml->image_id[0]; @@ -172,15 +172,12 @@ public function getPrice($_price_, $store = 0, $partion = 0) { $price = $partion + (int)$partion / 100 * $ret; //курсовая разница $opv = \App\System::getOptions("val"); - if(strlen($this->val)>1 && $opv['valprice']==1){ - $k = $opv[$this->val] / $this->rate; - $price = $price*$k; + if (strlen($this->val) > 1 && $opv['valprice'] == 1) { + $k = $opv[$this->val] / $this->rate; + $price = $price * $k; } - - - - - + + } } else { if ($_price > 0) { @@ -210,14 +207,14 @@ public function getPrice($_price_, $store = 0, $partion = 0) { if ($_price_ == 'price5' && $cat->price5 > 0) { $price = $partion + (int)$partion / 100 * $cat->price5; } - - //курсовая разница + + //курсовая разница $opv = \App\System::getOptions("val"); - if(strlen($this->val)>1 && $opv['valprice']==1){ - $k = $opv[$this->val] / $this->rate; - $price = $price*$k; + if (strlen($this->val) > 1 && $opv['valprice'] == 1) { + $k = $opv[$this->val] / $this->rate; + $price = $price * $k; } - + } } @@ -230,17 +227,15 @@ public function getPrice($_price_, $store = 0, $partion = 0) { $partion = $this->getLastPartion($store); } - $price = $partion + (int)$partion / 100 * $common['defprice']; - //курсовая разница - $opv = \App\System::getOptions("val"); - if(strlen($this->val)>1 && $opv['valprice']==1){ - $k = $opv[$this->val] / $this->rate; - $price = $price*$k; - } - - } + $price = $partion + (int)$partion / 100 * $common['defprice']; + //курсовая разница + $opv = \App\System::getOptions("val"); + if (strlen($this->val) > 1 && $opv['valprice'] == 1) { + $k = $opv[$this->val] / $this->rate; + $price = $price * $k; + } - + } return \App\Helper::fa($price); @@ -368,8 +363,8 @@ public static function findArrayAC($partname, $store = 0) { foreach ($itemlist as $key => $value) { $list[$key] = $value->itemname; - if(strlen($value->manufacturer)>0) { - $list[$key] = $value->itemname . ' ('.$value->manufacturer.')'; + if (strlen($value->manufacturer) > 0) { + $list[$key] = $value->itemname . ' (' . $value->manufacturer . ')'; } } @@ -389,19 +384,21 @@ public static function getNextArticle() { return "ID" . sprintf("%04d", ++$id); } - + public static function getManufacturers() { - + $conn = \ZDB\DB::getConnect(); - + $sql = " select distinct manufacturer from items order by manufacturer"; - $res = $conn->Execute($sql); + $res = $conn->Execute($sql); $list = array(); - foreach($res as $v) { - if(strlen($v['manufacturer'])>0) $list[]= $v['manufacturer']; + foreach ($res as $v) { + if (strlen($v['manufacturer']) > 0) { + $list[] = $v['manufacturer']; + } } - return $list; - - } - + return $list; + + } + } diff --git a/www/app/entity/message.php b/www/app/entity/message.php index c88f90615..57a0673e6 100644 --- a/www/app/entity/message.php +++ b/www/app/entity/message.php @@ -12,12 +12,12 @@ class Message extends \ZCL\DB\Entity { - const TYPE_DOC = 1; - const TYPE_CUST = 2; - const TYPE_EQ = 3; - const TYPE_NOTE = 4; - const TYPE_ISSUE = 5; - const TYPE_PROJECT = 6; + const TYPE_DOC = 1; + const TYPE_CUST = 2; + const TYPE_EQ = 3; + const TYPE_NOTE = 4; + const TYPE_ISSUE = 5; + const TYPE_PROJECT = 6; const TYPE_CONTRACT = 7; protected function afterLoad() { @@ -31,8 +31,8 @@ protected function afterLoad() { * @param mixed $item_d * @param mixed $sort */ - public static function getMessages($type, $item_id ) { - return \App\Entity\Message::find("item_type ={$type} and item_id={$item_id}", "message_id " ); + public static function getMessages($type, $item_id) { + return \App\Entity\Message::find("item_type ={$type} and item_id={$item_id}", "message_id "); } /** diff --git a/www/app/entity/stock.php b/www/app/entity/stock.php index f96b5efe5..fe91b66d3 100644 --- a/www/app/entity/stock.php +++ b/www/app/entity/stock.php @@ -45,7 +45,7 @@ public static function findArrayAC($store, $partname = "") { $list = array(); foreach ($entitylist as $key => $value) { if (strlen($value->snumber) > 0) { - $value->itemname .= ' (' . $value->snumber . ',' . \App\Helper::fd( $value->sdate) . ')'; + $value->itemname .= ' (' . $value->snumber . ',' . \App\Helper::fd($value->sdate) . ')'; } if ($partiontype == "1") { //отдельно по входным ценам @@ -92,9 +92,9 @@ public static function getStock($store_id, $item_id, $price, $snumber = "", $sda $stock->item_id = $item_id; $stock->partion = $price; $stock->snumber = $snumber; - $stock->sdate = $sdate; - - \App\Helper::log(serialize($stock)) ; + $stock->sdate = $sdate; + + \App\Helper::log(serialize($stock)); $stock->save(); } if ($partiontype == '1') { //учет по последней цене @@ -167,8 +167,8 @@ public static function pickup($store_id, $item) { $last->item_id = $item->item_id; $last->partion = $item->price; $last->snumber = $item->snumber; - $last->sdate = $item->sdate; - + $last->sdate = $item->sdate; + } else { $last->partion = $item->price; diff --git a/www/app/entity/user.php b/www/app/entity/user.php index a7e2e5941..9be9f7f1a 100644 --- a/www/app/entity/user.php +++ b/www/app/entity/user.php @@ -49,28 +49,32 @@ protected function afterLoad() { $this->createdon = strtotime($this->createdon); $acl = @unserialize($this->roleacl); - if(!is_array($acl))$acl = @unserialize($this->acl); //для обратно совместимости - if(!is_array($acl))$acl = array(); - - - $this->aclview = $acl['aclview']; - $this->acledit = $acl['acledit']; - $this->aclexe = $acl['aclexe']; - $this->aclcancel = $acl['aclcancel']; - - $this->widgets = $acl['widgets']; - $this->modules = $acl['modules']; - $this->smartmenu = $acl['smartmenu']; - - - $this->aclbranch = $acl['aclbranch']; - $this->onlymy = $acl['onlymy']; - + if (!is_array($acl)) { + $acl = @unserialize($this->acl); + } //для обратно совместимости + if (!is_array($acl)) { + $acl = array(); + } + + + $this->aclview = $acl['aclview']; + $this->acledit = $acl['acledit']; + $this->aclexe = $acl['aclexe']; + $this->aclcancel = $acl['aclcancel']; + + $this->widgets = $acl['widgets']; + $this->modules = $acl['modules']; + $this->smartmenu = $acl['smartmenu']; + + + $this->aclbranch = $acl['aclbranch']; + $this->onlymy = $acl['onlymy']; + $options = @unserialize($this->options); if (!is_array($options)) { $options = array(); } - + $this->defstore = (int)$options['defstore']; $this->defmf = (int)$options['defmf']; $this->pagesize = (int)$options['pagesize']; @@ -89,19 +93,19 @@ protected function beforeSave() { parent::beforeSave(); $acl = array(); - - $acl['aclbranch'] = $this->aclbranch ; - $acl['onlymy'] = $this->onlymy ; - - $this->acl = serialize($acl); + + $acl['aclbranch'] = $this->aclbranch; + $acl['onlymy'] = $this->onlymy; + + $this->acl = serialize($acl); $options = array(); - - $options['defstore']= $this->defstore; - - $options['defmf']= $this->defmf; - $options['pagesize']= $this->pagesize; - + + $options['defstore'] = $this->defstore; + + $options['defmf'] = $this->defmf; + $options['pagesize'] = $this->pagesize; + $this->options = serialize($options); return true; diff --git a/www/app/entity/userrole.php b/www/app/entity/userrole.php index 7a254f0b0..6ce0fab43 100644 --- a/www/app/entity/userrole.php +++ b/www/app/entity/userrole.php @@ -9,20 +9,20 @@ * @table=roles * @view=roles_view * @keyfield=role_id - */ -class UserRole extends Entity { - +class UserRole extends Entity +{ + /** * @see Entity * */ protected function init() { - + $this->role_id = 0; - + } - + /** * @see Entity @@ -30,19 +30,21 @@ protected function init() { */ protected function afterLoad() { $this->createdon = strtotime($this->createdon); - + $acl = @unserialize($this->acl); - if(!is_array($acl))$acl = array(); - - $this->aclview = $acl['aclview']; - $this->acledit = $acl['acledit']; - $this->aclexe = $acl['aclexe']; - $this->aclcancel = $acl['aclcancel']; - - $this->widgets = $acl['widgets']; - $this->modules = $acl['modules']; - $this->smartmenu = $acl['smartmenu']; - + if (!is_array($acl)) { + $acl = array(); + } + + $this->aclview = $acl['aclview']; + $this->acledit = $acl['acledit']; + $this->aclexe = $acl['aclexe']; + $this->aclcancel = $acl['aclcancel']; + + $this->widgets = $acl['widgets']; + $this->modules = $acl['modules']; + $this->smartmenu = $acl['smartmenu']; + parent::afterLoad(); } @@ -53,24 +55,22 @@ protected function afterLoad() { */ protected function beforeSave() { parent::beforeSave(); - + $acl = array(); - - $acl['aclview'] = $this->aclview ; - $acl['acledit'] = $this->acledit ; - $acl['aclexe'] = $this->aclexe ; - $acl['aclcancel'] = $this->aclcancel ; - - $acl['widgets'] = $this->widgets ; - $acl['modules'] = $this->modules ; - $acl['smartmenu'] = $this->smartmenu ; - $this->acl = serialize($acl); - - + + $acl['aclview'] = $this->aclview; + $acl['acledit'] = $this->acledit; + $acl['aclexe'] = $this->aclexe; + $acl['aclcancel'] = $this->aclcancel; + + $acl['widgets'] = $this->widgets; + $acl['modules'] = $this->modules; + $acl['smartmenu'] = $this->smartmenu; + $this->acl = serialize($acl); + return true; } - } diff --git a/www/app/helper.php b/www/app/helper.php index 1c6fc8258..fbefcebcf 100644 --- a/www/app/helper.php +++ b/www/app/helper.php @@ -175,17 +175,17 @@ public static function loadEmail($template, $keys = array()) { $logger->error($templatepath . " is wrong"); return ""; } - + $template = @file_get_contents($templatepath); $m = new \Mustache_Engine(); $template = $m->render($template, $keys); - + return $template; } public static function sendLetter($template, $emailfrom, $emailto, $subject = "") { - + $mail = new \PHPMailer\PHPMailer\PHPMailer(); $mail->setFrom($emailfrom); $mail->addAddress($emailto); @@ -193,7 +193,7 @@ public static function sendLetter($template, $emailfrom, $emailto, $subject = "" $mail->msgHTML($template); $mail->CharSet = "UTF-8"; $mail->IsHTML(true); - // $mail->AddAttachment($_SERVER['DOCUMENT_ROOT'].'/facturen/test.pdf', $name = 'test', $encoding = 'base64', $type = 'application/pdf'); + // $mail->AddAttachment($_SERVER['DOCUMENT_ROOT'].'/facturen/test.pdf', $name = 'test', $encoding = 'base64', $type = 'application/pdf'); $mail->send(); /* @@ -417,50 +417,57 @@ public static function fa($am) { * @param timestamp $date * @return mixed */ - public static function fd($date ) { + public static function fd($date) { if ($date > 0) { - $dateformat = System::getOption("common",'dateformat'); - if(strlen($dateformat)==0) $dateformat = 'd.m.Y'; - if($time) $dateformat .= ' H:i'; - return date($dateformat,$date) ; + $dateformat = System::getOption("common", 'dateformat'); + if (strlen($dateformat) == 0) { + $dateformat = 'd.m.Y'; + } + if ($time) { + $dateformat .= ' H:i'; + } + return date($dateformat, $date); } - return ''; - } - + return ''; + } + /** - * форматирование даты и времени - * - * @param mixed $date - * @return mixed - */ - public static function fdt($date ) { + * форматирование даты и времени + * + * @param mixed $date + * @return mixed + */ + public static function fdt($date) { if ($date > 0) { - $dateformat = System::getOption("common",'dateformat'); - if(strlen($dateformat)==0) $dateformat = 'd.m.Y'; - - return date($dateformat . ' H:i',$date) ; + $dateformat = System::getOption("common", 'dateformat'); + if (strlen($dateformat) == 0) { + $dateformat = 'd.m.Y'; + } + + return date($dateformat . ' H:i', $date); } - return ''; - } - + return ''; + } + /** * возвращает данные фирмы. Учитывает филиал если задан */ - public static function getFirmData($branch_id = 0,$firm_id=0) { - $usefirms = System::getOption('common','usefirms'); - if($firm_id>0) { - $firm = \App\Entity\Firm::load($firm_id); - $data = $firm->getData(); - } - else { - if($usefirms==true ) return array(); - - $data = \App\System::getOptions("firm"); - } - - + public static function getFirmData($branch_id = 0, $firm_id = 0) { + $usefirms = System::getOption('common', 'usefirms'); + if ($firm_id > 0) { + $firm = \App\Entity\Firm::load($firm_id); + $data = $firm->getData(); + } else { + if ($usefirms == true) { + return array(); + } + + $data = \App\System::getOptions("firm"); + } + + if ($branch_id > 0) { $branch = \App\Entity\Branch::load($branch_id); if (strlen($branch->shopname) > 0) { @@ -563,17 +570,25 @@ public static function sumstr($amount) { return $totalstr; } - - public static function getValList(){ - $val = \App\System::getOptions("val" ); - $list = array(); - if($val['valuan']>0 && $val['valuan']!=1) $list['valuan'] = 'Гривна'; - if($val['valusd']>0 && $val['valusd']!=1) $list['valusd'] = 'Доллар'; - if($val['valeuro']>0 && $val['valeuro']!=1) $list['valeuro'] = 'Евро'; - if($val['valrub']>0 && $val['valrub']!=1) $list['valrub'] = 'Рубль'; - - return $list; + + public static function getValList() { + $val = \App\System::getOptions("val"); + $list = array(); + if ($val['valuan'] > 0 && $val['valuan'] != 1) { + $list['valuan'] = 'Гривна'; + } + if ($val['valusd'] > 0 && $val['valusd'] != 1) { + $list['valusd'] = 'Доллар'; + } + if ($val['valeuro'] > 0 && $val['valeuro'] != 1) { + $list['valeuro'] = 'Евро'; + } + if ($val['valrub'] > 0 && $val['valrub'] != 1) { + $list['valrub'] = 'Рубль'; + } + + return $list; } - - + + } diff --git a/www/app/modules/issue/entity/issue.php b/www/app/modules/issue/entity/issue.php index 7072fce51..b92f8fd8a 100644 --- a/www/app/modules/issue/entity/issue.php +++ b/www/app/modules/issue/entity/issue.php @@ -35,8 +35,8 @@ protected function init() { $this->createdon = time(); $this->lastupdate = time(); - $this->notes = '' ; - + $this->notes = ''; + } /** @@ -109,7 +109,7 @@ public function addStatusLog($desc) { $user = \App\System::getUser(); $conn = \ZCL\DB\DB::getConnect(); $createdon = $conn->DBDate(time()); - $desc = Issue::qstr($desc) ; + $desc = Issue::qstr($desc); $sql = "insert into issue_history (issue_id,createdon,user_id ,description ) values ({$this->issue_id},{$createdon},{$user->user_id} ,{$desc}) "; $conn->Execute($sql); } diff --git a/www/app/modules/issue/entity/project.php b/www/app/modules/issue/entity/project.php index d8e990291..3bda0b8ad 100644 --- a/www/app/modules/issue/entity/project.php +++ b/www/app/modules/issue/entity/project.php @@ -19,8 +19,7 @@ class Project extends \ZCL\DB\Entity const STATUS_WAITPAIMENT = 6; const STATUS_CLOSED = 12; - - + protected function init() { $this->project_id = 0; $this->status = 1; @@ -58,35 +57,35 @@ protected function beforeSave() { protected function afterLoad() { - + //распаковываем данные из $xml = simplexml_load_string($this->details); $this->desc = (string)($xml->desc[0]); - $this->creator = (string) ($xml->creator[0]); - $this->createddate = (int) ($xml->createddate[0]); - $this->creator_id = (int) ($xml->creator_id[0]); + $this->creator = (string)($xml->creator[0]); + $this->createddate = (int)($xml->createddate[0]); + $this->creator_id = (int)($xml->creator_id[0]); parent::afterLoad(); } - public function getUsers() { + public function getUsers() { $list = array(); $conn = \ZDB\DB::getConnect(); - $res = $conn->Execute("select user_id from issue_projectacc where project_id={$this->project_id} " ); - foreach($res as $r){ - $list[] = $r['user_id'] ; + $res = $conn->Execute("select user_id from issue_projectacc where project_id={$this->project_id} "); + foreach ($res as $r) { + $list[] = $r['user_id']; } - return $list; + return $list; } - public function setUsers($users) { + public function setUsers($users) { $conn = \ZDB\DB::getConnect(); $conn->Execute("delete from issue_projectacc where project_id=" . $this->project_id); - foreach($users as $u){ - $conn->Execute("insert into issue_projectacc (project_id,user_id) value ({$this->project_id},{$u}) " ); + foreach ($users as $u) { + $conn->Execute("insert into issue_projectacc (project_id,user_id) value ({$this->project_id},{$u}) "); } } - + public static function getStatusList() { $list = array(); $list[self::STATUS_NEW] = \App\Helper::l('pr_new'); diff --git a/www/app/modules/issue/pages/calendar.php b/www/app/modules/issue/pages/calendar.php index 27cf9e867..5d2ee30ff 100644 --- a/www/app/modules/issue/pages/calendar.php +++ b/www/app/modules/issue/pages/calendar.php @@ -51,7 +51,7 @@ public function __construct() { public function OnTimeRow($row) { $item = $row->getDataItem(); - $row->add(new Label('date', \App\Helper::fd( $item->createdon))); + $row->add(new Label('date', \App\Helper::fd($item->createdon))); $row->add(new Label('time', $item->duration)); $row->add(new Label('issue', '#' . $item->issue_id . ' ' . $item->issue_name)); $row->add(new Label('project', $item->project_name)); diff --git a/www/app/modules/issue/pages/issuelist.php b/www/app/modules/issue/pages/issuelist.php index 07c909756..54393b7e7 100644 --- a/www/app/modules/issue/pages/issuelist.php +++ b/www/app/modules/issue/pages/issuelist.php @@ -33,7 +33,7 @@ class IssueList extends \App\Pages\Base public $_msglist = array(); public $_fileslist = array(); - public function __construct($id = 0, $project_id = 0,$new=false) { + public function __construct($id = 0, $project_id = 0, $new = false) { parent::__construct(); $this->_user = System::getUser(); @@ -76,7 +76,7 @@ public function __construct($id = 0, $project_id = 0,$new=false) { $this->filter->add(new DropDownChoice('searchemp', $users, $user_id)); $stlist = Issue::getStatusList(); - $stlist[0] = H::l('mopen') ; + $stlist[0] = H::l('mopen'); $stlist[100] = H::l('mall'); $this->filter->add(new DropDownChoice('searchstatus', $stlist, 0)); @@ -101,7 +101,7 @@ public function __construct($id = 0, $project_id = 0,$new=false) { $msgpan->add(new Form('addmsgform'))->onSubmit($this, 'onAddMsg'); $msgpan->addmsgform->add(new TextArea('msgdata')); - $msgpan->addmsgform->add(new \Zippy\Html\Form\CheckBoxList('userlist','
') ); + $msgpan->addmsgform->add(new \Zippy\Html\Form\CheckBoxList('userlist', '
')); $msgpan->add(new DataView('msglist', new ArrayDataSource($this, '_msglist'), $this, 'msgListOnRow')); $msgpan->msglist->setPageSize(15); $msgpan->add(new Paginator('pagmsg', $msgpan->msglist)); @@ -137,12 +137,11 @@ public function __construct($id = 0, $project_id = 0,$new=false) { if ($issue instanceof Issue) { $this->openIssue($issue); } - if($new==true) { + if ($new == true) { $this->onNew(null); - } + } } - - + public function onNew($sender) { $this->editpan->editform->clean(); @@ -169,8 +168,8 @@ public function onFilter($sender) { public function listOnRow($row) { $issue = $row->getDataItem(); - $row->add(new RedirectLink('issue_number', "\\App\\Modules\\Issue\\Pages\\IssueList", array($issue->issue_id) ))->setValue('#' . $issue->issue_id); - + $row->add(new RedirectLink('issue_number', "\\App\\Modules\\Issue\\Pages\\IssueList", array($issue->issue_id)))->setValue('#' . $issue->issue_id); + $row->issue_number->setAttribute('class', 'badge badge-success'); if ($issue->priority == Issue::PRIORITY_HIGH) { $row->issue_number->setAttribute('class', 'badge badge-danger'); @@ -179,8 +178,8 @@ public function listOnRow($row) { $row->issue_number->setAttribute('class', 'badge badge-warning'); } - $row->add(new ClickLink('title', $this , 'OnIssue' ))->setValue($issue->issue_name); - + $row->add(new ClickLink('title', $this, 'OnIssue'))->setValue($issue->issue_name); + $row->add(new Label('emp', \App\Util::getLabelName($issue->username))); $row->emp->setAttribute('title', $issue->username); if ($this->_issue->issue_id == $issue) { @@ -275,15 +274,15 @@ public function openIssue($issue) { $this->updateMessages(); $this->listpan->list->Reload(false); - $user_id= System::getUser()->user_id; - $project = Project::load( $this->_issue->project_id); - $this->listpan->msgpan->mcreate->setText('Автор ' . $this->_issue->createdbyname . ' ' . \App\Helper::fd( $this->_issue->createdon) . ' Проект ' . $project->project_name . ' ', true); + $user_id = System::getUser()->user_id; + $project = Project::load($this->_issue->project_id); + $this->listpan->msgpan->mcreate->setText('Автор ' . $this->_issue->createdbyname . ' ' . \App\Helper::fd($this->_issue->createdon) . ' Проект ' . $project->project_name . ' ', true); - $users = \App\Entity\User::findArray('username',"user_id <> {$user_id} and user_id in (select user_id from issue_projectacc where project_id={$project->project_id} )",'username') ; - foreach($users as $k=>$v ){ - $this->listpan->msgpan->addmsgform->userlist->AddCheckBox($k,false,$v ); - } - } + $users = \App\Entity\User::findArray('username', "user_id <> {$user_id} and user_id in (select user_id from issue_projectacc where project_id={$project->project_id} )", 'username'); + foreach ($users as $k => $v) { + $this->listpan->msgpan->addmsgform->userlist->AddCheckBox($k, false, $v); + } + } public function deleteOnClick($sender) { @@ -324,16 +323,20 @@ public function onAddMsg($sender) { $this->listpan->msgpan->addmsgform->msgdata->setText(''); $this->updateMessages(); - + $recievers = $this->listpan->msgpan->addmsgform->userlist->getCheckedList(); - if(!in_array($this->_issue->user_id,$recievers)) $recievers[]= $this->_issue->user_id; - + if (!in_array($this->_issue->user_id, $recievers)) { + $recievers[] = $this->_issue->user_id; + } + foreach ($recievers as $u) { - if($u== System::getUser()->userid) continue; + if ($u == System::getUser()->userid) { + continue; + } $n = new \App\Entity\Notify(); $n->user_id = $u; - $n->message = H::l('msgtask') . " #{$this->_issue->issue_id} {$this->_issue->issue_name} "; - $n->message .= "
_issue->issue_id}/{$this->_issue->project_id}/#msgankor\">". H::l('msgreply')." "; + $n->message = H::l('msgtask') . " #{$this->_issue->issue_id} {$this->_issue->issue_name} "; + $n->message .= "
_issue->issue_id}/{$this->_issue->project_id}/#msgankor\">" . H::l('msgreply') . " "; $n->sender_name = System::getUser()->getUserName(); $n->save(); } @@ -343,7 +346,7 @@ public function onAddMsg($sender) { //список комментариев private function updateMessages() { - $this->_msglist = \App\Entity\Message::find('item_type = ' . \App\Entity\Message::TYPE_ISSUE . ' and item_id=' . $this->_issue->issue_id,'message_id'); + $this->_msglist = \App\Entity\Message::find('item_type = ' . \App\Entity\Message::TYPE_ISSUE . ' and item_id=' . $this->_issue->issue_id, 'message_id'); $this->listpan->msgpan->msglist->Reload(); $ocnt = $this->listpan->msgpan->msglist->getPageCount(); $this->listpan->msgpan->msglist->setCurrentPage($ocnt); @@ -354,9 +357,9 @@ private function updateMessages() { public function msgListOnRow($row) { $item = $row->getDataItem(); - $row->add(new Label('msgdate', \App\Helper::fdt( $item->created))); + $row->add(new Label('msgdate', \App\Helper::fdt($item->created))); $row->add(new Label('msguser', $item->username)); - $row->add(new Label('msgdata', nl2br($item->message),true)); + $row->add(new Label('msgdata', nl2br($item->message), true)); $row->add(new ClickLink('delmsg'))->onClick($this, 'deleteMmsOnClick'); if ($this->_user->rolename == 'admins' || $this->_user->user_id == $item->user_id) { $row->delmsg->setVisible(true); @@ -416,31 +419,31 @@ public function onStatus($sender) { $oldstatus = $this->_issue->status; $oldpriority = $this->_issue->priority; - $this->_issue->status = $sender->ststatus->getValue(); - $this->_issue->user_id = $sender->stuser->getValue(); + $this->_issue->status = $sender->ststatus->getValue(); + $this->_issue->user_id = $sender->stuser->getValue(); $this->_issue->priority = $sender->stpr->getValue(); $this->_issue->lastupdate = time(); $this->_issue->save(); if ($oldstatus != $this->_issue->status) { - $this->_issue->addStatusLog(H::l("isstchanged") . " ".$sender->ststatus->getValueName().""); + $this->_issue->addStatusLog(H::l("isstchanged") . " " . $sender->ststatus->getValueName() . ""); } - + if ($oldpriority != $this->_issue->priority) { - $this->_issue->addStatusLog(H::l("isprchanged") . " ".$sender->stpr->getValueName().""); + $this->_issue->addStatusLog(H::l("isprchanged") . " " . $sender->stpr->getValueName() . ""); } $this->updateStList(); $this->listpan->list->Reload(false); - if ($olduser != $this->_issue->user_id) { - - $this->_issue->addStatusLog(H::l("isuserchanged") . " ".$sender->stuser->getValueName().""); - + if ($olduser != $this->_issue->user_id) { + + $this->_issue->addStatusLog(H::l("isuserchanged") . " " . $sender->stuser->getValueName() . ""); + $n = new \App\Entity\Notify(); $n->user_id = $this->_issue->user_id; $n->message = " #{$this->_issue->issue_id} {$this->_issue->issue_name} "; - $n->message .=H::l("isassigned") . "#{$this->_issue->issue_id}
_issue->issue_id}/{$this->_issue->project_id}\">". H::l("msgopen") ." "; + $n->message .= H::l("isassigned") . "#{$this->_issue->issue_id}
_issue->issue_id}/{$this->_issue->project_id}\">" . H::l("msgopen") . " "; $n->sender_name = System::getUser()->username; $n->save(); } @@ -448,9 +451,9 @@ public function onStatus($sender) { public function stlistOnRow($row) { $item = $row->getDataItem(); - $row->add(new Label('sttime', \App\Helper::fd( $item->createdon))); + $row->add(new Label('sttime', \App\Helper::fd($item->createdon))); $row->add(new Label('stuser', $item->username)); - $row->add(new Label('stdesc', $item->description,true)); + $row->add(new Label('stdesc', $item->description, true)); } public function updateStList() { @@ -458,7 +461,7 @@ public function updateStList() { $this->listpan->msgpan->stlist->Reload(); } - + } class IssueDS implements \Zippy\Interfaces\DataSource @@ -472,7 +475,7 @@ public function __construct($page) { private function getWhere() { $status = $this->page->filter->searchstatus->getValue(); - // $number = trim($this->page->filter->searchnumber->getText()); + // $number = trim($this->page->filter->searchnumber->getText()); $emp = $this->page->filter->searchemp->getValue(); $project = $this->page->filter->searchproject->getValue(); diff --git a/www/app/modules/issue/pages/projectlist.php b/www/app/modules/issue/pages/projectlist.php index f4214b416..e58761e6e 100644 --- a/www/app/modules/issue/pages/projectlist.php +++ b/www/app/modules/issue/pages/projectlist.php @@ -61,8 +61,8 @@ public function __construct($id = 0) { $this->projectform->add(new TextArea('editdesc')); $this->projectform->add(new SubmitButton('save'))->onClick($this, 'saveOnClick'); $this->projectform->add(new Button('cancel'))->onClick($this, 'cancelOnClick'); - $this->projectform->add(new \Zippy\Html\Form\CheckBoxList('userlist','
') ); - + $this->projectform->add(new \Zippy\Html\Form\CheckBoxList('userlist', '
')); + $this->add(new Panel("showpan"))->setVisible(false); $this->showpan->add(new ClickLink('back', $this, 'cancelOnClick')); $this->showpan->add(new ClickLink('toilist', $this, 'toilistOnClick')); @@ -101,18 +101,18 @@ public function listOnRow($row) { $row->add(new ClickLink('preview'))->onClick($this, 'previewOnClick'); - $user = System::getUser() ; - - + $user = System::getUser(); + + $row->add(new ClickLink('edit'))->onClick($this, 'editOnClick'); $row->add(new ClickLink('delete'))->onClick($this, 'deleteOnClick'); - if($user->rolename !='admins' && $user->user_id != $pr->creator_id ) { - $row->edit->setVisible(false) ; - $row->delete->setVisible(false) ; - } - - + if ($user->rolename != 'admins' && $user->user_id != $pr->creator_id) { + $row->edit->setVisible(false); + $row->delete->setVisible(false); + } + + if ($pr->status == Project::STATUS_CLOSED) { $row->edit->setVisible(false); $row->delete->setVisible(false); @@ -121,18 +121,18 @@ public function listOnRow($row) { public function editOnClick($sender) { $this->_project = $sender->owner->getDataItem(); - - $user = System::getUser() ; - - + + $user = System::getUser(); + + $this->projectpanel->setVisible(false); $this->projectform->setVisible(true); $this->projectform->editname->setText($this->_project->project_name); $this->projectform->editdesc->setText($this->_project->desc); - $this->projectform->editcust->setKey($this->_project->customer_id) ; - $this->projectform->editcust->setText($this->_project->customer_name) ; + $this->projectform->editcust->setKey($this->_project->customer_id); + $this->projectform->editcust->setText($this->_project->customer_name); $this->updateUsers(); - + } public function deleteOnClick($sender) { @@ -157,17 +157,17 @@ public function addOnClick($sender) { $this->projectform->editname->setText(''); $this->projectform->editdesc->setText(''); $this->_project = new Project(); - $user = System::getUser() ; + $user = System::getUser(); $this->_project->creator_id = $user->user_id; $this->_project->creator = $user->username; - - + + $this->updateUsers(); - + } public function saveOnClick($sender) { - + $this->_project->project_name = $this->projectform->editname->getText(); $this->_project->customer_id = $this->projectform->editcust->getKey(); @@ -178,13 +178,13 @@ public function saveOnClick($sender) { return; } $users = $this->projectform->userlist->getCheckedList(); - - if(in_array($this->_project->creator_id,$users)==false) { - $users[]=$this->_project->creator_id; + + if (in_array($this->_project->creator_id, $users) == false) { + $users[] = $this->_project->creator_id; } - $this->_project->setUsers($users) ; - - + $this->_project->setUsers($users); + + $this->_project->Save(); $this->projectform->setVisible(false); $this->projectpanel->setVisible(true); @@ -248,7 +248,7 @@ public function onAddMsg($sender) { } private function updateMessages() { - $this->_msglist = \App\Entity\Message::find('item_type = 6 and item_id=' . $this->_project->project_id,'message_id'); + $this->_msglist = \App\Entity\Message::find('item_type = 6 and item_id=' . $this->_project->project_id, 'message_id'); $this->showpan->msglist->Reload(); $ocnt = $this->showpan->msglist->getPageCount(); $this->showpan->msglist->setCurrentPage($ocnt); @@ -259,9 +259,9 @@ private function updateMessages() { public function msgListOnRow($row) { $item = $row->getDataItem(); - $row->add(new Label('msgdate', \App\Helper::fdt( $item->created))); + $row->add(new Label('msgdate', \App\Helper::fdt($item->created))); $row->add(new Label('msguser', $item->username)); - $row->add(new Label('msgdata', nl2br($item->message),true)); + $row->add(new Label('msgdata', nl2br($item->message), true)); $row->add(new ClickLink('delmsg'))->onClick($this, 'deleteMmsOnClick'); if ($this->_user->rolename == 'admins' || $this->_user->user_id == $item->user_id) { $row->delmsg->setVisible(true); @@ -318,24 +318,24 @@ public function onStatus($sender) { $this->projectpanel->projectlist->Reload(); } - public function updateUsers(){ - $user = System::getUser() ; + public function updateUsers() { + $user = System::getUser(); $this->projectform->userlist->clean(); - - $pusers = $this->_project->getUsers() ; - $users = \App\Entity\User::find( " user_id <>".$user->user_id ,'username'); - foreach($users as $k=>$v ){ - if($v->rolename != 'admins' && strpos($v->modules, 'issue') === false) { + + $pusers = $this->_project->getUsers(); + $users = \App\Entity\User::find(" user_id <>" . $user->user_id, 'username'); + foreach ($users as $k => $v) { + if ($v->rolename != 'admins' && strpos($v->modules, 'issue') === false) { continue; } - $inlist = in_array($k, $pusers ); - $this->projectform->userlist->AddCheckBox($k,$inlist,$v->username); - } - } - + $inlist = in_array($k, $pusers); + $this->projectform->userlist->AddCheckBox($k, $inlist, $v->username); + } + } + public function newissueOnClick($sender) { - App::Redirect("\\App\\Modules\\Issue\\Pages\\IssueList",0,$this->_project->project_id,true); - + App::Redirect("\\App\\Modules\\Issue\\Pages\\IssueList", 0, $this->_project->project_id, true); + } } @@ -368,10 +368,10 @@ private function getWhere() { } $user = System::getUser(); - if($user->rolename != 'admins') { - $where .= " and project_id in (select project_id from issue_projectacc where user_id = {$user->user_id} ) " ; + if ($user->rolename != 'admins') { + $where .= " and project_id in (select project_id from issue_projectacc where user_id = {$user->user_id} ) "; } - + if (strlen($number) > 0) { $s = Project::qstr('%' . $number . '%'); diff --git a/www/app/modules/issue/pages/stat.php b/www/app/modules/issue/pages/stat.php index adfd306ba..62f1e482f 100644 --- a/www/app/modules/issue/pages/stat.php +++ b/www/app/modules/issue/pages/stat.php @@ -31,7 +31,7 @@ public function __construct() { $allow = (strpos($user->modules, 'issue') !== false || $user->rolename == 'admins'); if (!$allow) { - $this->setError( H::l('noaccesstopage')); + $this->setError(H::l('noaccesstopage')); App::RedirectHome(); return; } diff --git a/www/app/modules/note/entity/topic.php b/www/app/modules/note/entity/topic.php index 75cbf1309..37fe8d841 100644 --- a/www/app/modules/note/entity/topic.php +++ b/www/app/modules/note/entity/topic.php @@ -12,7 +12,7 @@ class Topic extends \ZCL\DB\Entity protected function init() { $this->topic_id = 0; - $this->acctype = 0; + $this->acctype = 0; } protected function beforeSave() { @@ -20,7 +20,7 @@ protected function beforeSave() { //упаковываем данные в detail $this->content = ""; $this->content .= "{$this->isout}"; - $this->content .= "detail}]]>"; + $this->content .= "detail}]]>"; $this->content .= ""; return true; @@ -30,24 +30,24 @@ protected function afterLoad() { //распаковываем данные из detail $xml = @simplexml_load_string($this->content); - + $this->isout = (int)($xml->isout[0]); - + $this->detail = (string)($xml->detail[0]); parent::afterLoad(); } - + /** * список топиков для узла * * @param mixed $node_id */ public static function findByNode($node_id) { - $user_id = \App\System::getUser()->user_id; - - return self::find(" (user_id={$user_id} or acctype>0) and topic_id in (select topic_id from note_topicnode where node_id={$node_id})"); + $user_id = \App\System::getUser()->user_id; + + return self::find(" (user_id={$user_id} or acctype>0) and topic_id in (select topic_id from note_topicnode where node_id={$node_id})"); } /** diff --git a/www/app/modules/note/entity/topicnode.php b/www/app/modules/note/entity/topicnode.php index a68fb72f6..e9310b2f5 100644 --- a/www/app/modules/note/entity/topicnode.php +++ b/www/app/modules/note/entity/topicnode.php @@ -73,7 +73,7 @@ public static function searchByTag($tag) { // поиск избранных public static function searchFav() { - $sql = " select * from note_topicnodeview where topic_id in (select topic_id from note_fav where user_id = ".\App\System::getUser()->user_id.") " ; + $sql = " select * from note_topicnodeview where topic_id in (select topic_id from note_fav where user_id = " . \App\System::getUser()->user_id . ") "; $list = TopicNode::findBySql($sql); diff --git a/www/app/modules/note/pages/main.php b/www/app/modules/note/pages/main.php index 26f052319..a123d47cd 100644 --- a/www/app/modules/note/pages/main.php +++ b/www/app/modules/note/pages/main.php @@ -34,7 +34,7 @@ class Main extends \App\Pages\Base public $_sarr = array(); public $_farr = array(); public $_favorites = array(); - + public function __construct() { parent::__construct(); @@ -84,7 +84,7 @@ public function __construct() { $this->editform->add(new TextArea("editdetail")); $this->editform->add(new CheckBox("editisout")); $this->editform->add(new ClickLink("editcancel", $this, "onTopicCancel")); - $this->editform->add(new DropDownChoice("editacctype",array(0=>'Приватный',1=>'Публичный',2=>'С общим редактированием'),0)); + $this->editform->add(new DropDownChoice("editacctype", array(0 => 'Приватный', 1 => 'Публичный', 2 => 'С общим редактированием'), 0)); $this->editform->add(new SubmitLink("editsave"))->onClick($this, "onTopicSave"); @@ -150,33 +150,33 @@ public function onTopicEdit($sender) { //сохраниение топика public function onTopicSave($sender) { - - if($this->_edited > 0) { - $topic = Topic::load($this->_edited) ; - } else { - $topic = new Topic() ; - $topic->user_id = System::getUser()->user_id; + + if ($this->_edited > 0) { + $topic = Topic::load($this->_edited); + } else { + $topic = new Topic(); + $topic->user_id = System::getUser()->user_id; } $topic->title = $this->editform->edittitle->getText(); $topic->detail = $this->editform->editdetail->getText(); $topic->acctype = $this->editform->editacctype->getValue(); - $topic->isout = $this->editform->editisout->isChecked() ? 1:0; + $topic->isout = $this->editform->editisout->isChecked() ? 1 : 0; if (strlen($topic->title) == 0) { $this->setError('notitle'); return; } - + $nodeid = $this->tree->selectedNodeId(); if ($this->_edited == 0) { $node = Node::load($nodeid); - if($topic->acctype == 0 && $node->ispublic != 1){ - $this->setError('Нельзя добавить публичный топик к приватному узлу'); + if ($topic->acctype == 0 && $node->ispublic != 1) { + $this->setError('Нельзя добавить публичный топик к приватному узлу'); - return; + return; } - } - + } + $topic->save(); $tags = $this->editform->edittags->getTags(); $topic->saveTags($tags); @@ -248,25 +248,25 @@ public function OnNodeTitle($form) { $node->pid = $id; $node->user_id = System::getUser()->user_id; $node->title = $form->editnodetitle->getText(); - $node->ispublic = $form->editnodepublic->isChecked() ?1:0; - if($parent->ispublic==0 && $node->ispublic==1) { + $node->ispublic = $form->editnodepublic->isChecked() ? 1 : 0; + if ($parent->ispublic == 0 && $node->ispublic == 1) { $this->setError('Нельзя добавлять публичный узел на приватный'); return; } - $form->editnodepublic->setChecked(false); + $form->editnodepublic->setChecked(false); $node->save(); $this->ReloadTopic($node->node_id); } if ($op == 'edit') { $node = Node::load($id); $node->title = $form->editnodetitle->getText(); - $node->ispublic = $form->editnodepublic->isChecked() ?1:0; + $node->ispublic = $form->editnodepublic->isChecked() ? 1 : 0; $parent = Node::load($node->pid); - if($parent->ispublic==0 && $node->ispublic==1) { + if ($parent->ispublic == 0 && $node->ispublic == 1) { $this->setError('Нельзя добавлять публичный узел на приватный'); return; } - + $node->save(); } // $form->editnodetitle->setText(''); @@ -296,7 +296,7 @@ public function ReloadTree() { $nodelist = array(); foreach ($itemlist as $item) { $node = new \ZCL\BT\TreeNode($item->title, $item->node_id); - // $node->tags = $item->tcnt; //количество топиков в ветке + // $node->tags = $item->tcnt; //количество топиков в ветке $parentnode = @$nodelist[$item->pid]; $this->tree->addNode($node, $parentnode); @@ -333,7 +333,7 @@ public function onRow($row) { $row->add(new Label('title', $topic->title)); //$row->add(new ClickLink('title', $this,'onTopic')); $fav = $row->add(new Label('fav')); - $fav->setVisible(in_array($topic->topic_id,$this->_favorites)); + $fav->setVisible(in_array($topic->topic_id, $this->_favorites)); } //клик по топику @@ -349,27 +349,27 @@ public function onTopic($row) { //избранное public function onFav($sender) { $topic = Topic::load($this->topiclist->getSelectedRow()->getDataItem()->topic_id); - + $conn = \ZCL\DB\DB::getConnect(); - if(in_array($topic->topic_id,$this->_favorites)){ - $conn->Execute("delete from note_fav where topic_id={$topic->topic_id} and user_id= ".System::getUser()->user_id ) ; + if (in_array($topic->topic_id, $this->_favorites)) { + $conn->Execute("delete from note_fav where topic_id={$topic->topic_id} and user_id= " . System::getUser()->user_id); } else { - $conn->Execute("insert into note_fav (topic_id,user_id) values ({$topic->topic_id},".System::getUser()->user_id.") " ) ; + $conn->Execute("insert into note_fav (topic_id,user_id) values ({$topic->topic_id}," . System::getUser()->user_id . ") "); } $this->reloadfav(); $this->ReloadTopic(); } - private function reloadfav(){ + private function reloadfav() { $conn = \ZCL\DB\DB::getConnect(); - $res = $conn->Execute("select topic_id from note_fav where user_id= ".System::getUser()->user_id); + $res = $conn->Execute("select topic_id from note_fav where user_id= " . System::getUser()->user_id); $this->_favorites = array(); - foreach($res as $r){ - $this->_favorites[] = $r['topic_id']; + foreach ($res as $r) { + $this->_favorites[] = $r['topic_id']; } } - + //вырезать топик в клипборд public function onTopicCut($sender) { $this->clipboard[0] = $this->topiclist->getSelectedRow()->getDataItem()->topic_id; @@ -580,11 +580,11 @@ public function beforeRender() { $this->treecut->setVisible(true); $this->treeedit->setVisible(true); $this->treedelete->setVisible(true); - } else { - $this->treecut->setVisible(false); - $this->treeedit->setVisible(false); - $this->treedelete->setVisible(false); - + } else { + $this->treecut->setVisible(false); + $this->treeedit->setVisible(false); + $this->treedelete->setVisible(false); + } } diff --git a/www/app/modules/note/pages/showtopic.php b/www/app/modules/note/pages/showtopic.php index 40b27f56c..661c1bc35 100644 --- a/www/app/modules/note/pages/showtopic.php +++ b/www/app/modules/note/pages/showtopic.php @@ -26,15 +26,15 @@ public function __construct($topic_id) { return; } - if ($this->_topic->acctype ==0) { //приватный + if ($this->_topic->acctype == 0) { //приватный App::Redirect404(); return; } if ($this->_topic->isout == 0) { $user_id = System::getUser()->user_id; - if($user_id ==0) { //незалогиненый - App::Redirect404(); - return; + if ($user_id == 0) { //незалогиненый + App::Redirect404(); + return; } } diff --git a/www/app/modules/ocstore/helper.php b/www/app/modules/ocstore/helper.php index dadd20a39..73eb012df 100644 --- a/www/app/modules/ocstore/helper.php +++ b/www/app/modules/ocstore/helper.php @@ -20,7 +20,7 @@ public static function do_curl_request($url, $params = array()) { curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, _ROOT . 'upload/apicookie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, _ROOT . 'upload/apicookie.txt'); - // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $params_string = ''; if (is_array($params) && count($params)) { diff --git a/www/app/modules/ocstore/options.php b/www/app/modules/ocstore/options.php index 5f140b360..2e5f54d37 100644 --- a/www/app/modules/ocstore/options.php +++ b/www/app/modules/ocstore/options.php @@ -4,7 +4,7 @@ use App\System; use Zippy\Html\Form\DropDownChoice; -use Zippy\Html\Form\CheckBox ; +use Zippy\Html\Form\CheckBox; use Zippy\Html\Form\Form; use Zippy\Html\Form\SubmitButton; use Zippy\Html\Form\TextArea; @@ -120,8 +120,8 @@ public function saveOnClick($sender) { $key = $this->cform->key->getText(); $customer_id = $this->cform->defcust->getValue(); $pricetype = $this->cform->defpricetype->getValue(); - $outcome = $this->cform->outcome->isChecked() ?1:0; - $insertcust = $this->cform->insertcust->isChecked()?1:0; + $outcome = $this->cform->outcome->isChecked() ? 1 : 0; + $insertcust = $this->cform->insertcust->isChecked() ? 1 : 0; if ($customer_id == 0) { $this->setError('noselcust'); diff --git a/www/app/modules/ocstore/orders.php b/www/app/modules/ocstore/orders.php index 49f81f6b1..eee2dca1a 100644 --- a/www/app/modules/ocstore/orders.php +++ b/www/app/modules/ocstore/orders.php @@ -44,12 +44,11 @@ public function __construct() { $this->add(new Form('filter2'))->onSubmit($this, 'onOutcome'); $this->filter2->add(new DropDownChoice('store', \App\Entity\Store::getList(), 0)); $this->filter2->add(new DropDownChoice('kassa', \App\Entity\MoneyFund::getList(), \App\Helper::getDefMF())); - $this->filter2->setVisible($modules['ocoutcome']==1); + $this->filter2->setVisible($modules['ocoutcome'] == 1); $this->add(new DataView('neworderslist', new ArrayDataSource(new Prop($this, '_neworders')), $this, 'noOnRow')); - $this->add(new ClickLink('importbtn',$this, 'onImport'))->setVisible($modules['ocoutcome']!=1); - + $this->add(new ClickLink('importbtn', $this, 'onImport'))->setVisible($modules['ocoutcome'] != 1); $this->add(new ClickLink('refreshbtn'))->onClick($this, 'onRefresh'); @@ -83,7 +82,6 @@ public function filterOnSubmit($sender) { foreach ($data['orders'] as $ocorder) { - $isorder = Document::findCnt(" (meta_name='Order' or meta_name='GoodsIssue') and content like '%{$ocorder['order_id']}%'"); if ($isorder > 0) { //уже импортирован @@ -117,7 +115,7 @@ public function noOnRow($row) { $row->add(new Label('customer', $order->firstname . ' ' . $order->lastname)); $row->add(new Label('amount', round($order->total))); $row->add(new Label('comment', $order->comment)); - $row->add(new Label('date', \App\Helper::fdt( strtotime($order->date_modified)))); + $row->add(new Label('date', \App\Helper::fdt(strtotime($order->date_modified)))); } public function onImport($sender) { @@ -159,31 +157,31 @@ public function onImport($sender) { $neworder->amount = round($shoporder->total); $neworder->headerdata['ocorder'] = $shoporder->order_id; $neworder->headerdata['ocorderback'] = 0; - + $neworder->notes = "OC номер:{$shoporder->order_id};"; - + $neworder->headerdata['occlient'] = $shoporder->firstname . ' ' . $shoporder->lastname; $neworder->notes .= " Клиент:" . $shoporder->firstname . ' ' . $shoporder->lastname . ";"; - - if($shoporder->customer_id>0 && $modules['ocinsertcust'] == 1){ - $cust = Customer::getFirst("detail like '%{$shoporder->customer_id}%'") ; - if($cust == null) { + + if ($shoporder->customer_id > 0 && $modules['ocinsertcust'] == 1) { + $cust = Customer::getFirst("detail like '%{$shoporder->customer_id}%'"); + if ($cust == null) { $cust = new Customer(); $cust->shopcust_id = $shoporder->customer_id; - $cust->customer_name = $shoporder->firstname . ' ' . $shoporder->lastname; - $cust->address = $shoporder->shipping_city . ' ' . $shoporder->shipping_address_1 ; - $cust->type = Customer::TYPE_BAYER ; - $cust->phone = $shoporder->telephone ; - $cust->email = $shoporder->email ; - $cust->comment = "Клиент ИМ" ; + $cust->customer_name = $shoporder->firstname . ' ' . $shoporder->lastname; + $cust->address = $shoporder->shipping_city . ' ' . $shoporder->shipping_address_1; + $cust->type = Customer::TYPE_BAYER; + $cust->phone = $shoporder->telephone; + $cust->email = $shoporder->email; + $cust->comment = "Клиент ИМ"; $cust->save(); - + } $neworder->customer_id = $cust->customer_id; } - - + + if (strlen($shoporder->email) > 0) { $neworder->notes .= " Email:" . $shoporder->email . ";"; } @@ -205,46 +203,45 @@ public function onImport($sender) { } public function onOutcome($sender) { - $modules = System::getOptions("modules"); + $modules = System::getOptions("modules"); $store = $this->filter2->store->getValue(); $kassa = $this->filter2->kassa->getValue(); - if($store==0){ + if ($store == 0) { $this->setError("noselstore"); return; } $allowminus = \App\System::getOption("common", "allowminus"); - + if ($allowminus != 1) { - foreach ($this->_neworders as $shoporder) { - - foreach ($shoporder->_products_ as $product) { - //ищем по артикулу - if (strlen($product['sku']) == 0) { - continue; - } - $code = Item::qstr($product['sku']); + foreach ($this->_neworders as $shoporder) { + + foreach ($shoporder->_products_ as $product) { + //ищем по артикулу + if (strlen($product['sku']) == 0) { + continue; + } + $code = Item::qstr($product['sku']); + + $tovar = Item::getFirst('item_code=' . $code); + if ($tovar == null) { + + $this->setWarn("nofoundarticle_inorder", $product['name'], $shoporder['order_id']); + continue; + } + $tovar->quantity = $product['quantity']; + + $qty = $tovar->getQuantity($store); + if ($qty < $tovar->quantity) { + $this->setError("nominus", \App\Helper::fqty($qty), $tovar->item_name); + return; + } - $tovar = Item::getFirst('item_code=' . $code); - if ($tovar == null) { - $this->setWarn("nofoundarticle_inorder", $product['name'], $shoporder['order_id']); - continue; } - $tovar->quantity = $product['quantity']; - - $qty = $tovar->getQuantity($store); - if ($qty < $tovar->quantity) { - $this->setError("nominus", \App\Helper::fqty($qty), $tovar->item_name); - return; - } - - - } - } + } } - - - + + foreach ($this->_neworders as $shoporder) { @@ -253,9 +250,9 @@ public function onOutcome($sender) { if (strlen($neworder->document_number) == 0) { $neworder->document_number = 'РН-00001'; } - + //товары - $totalpr=0; + $totalpr = 0; $tlist = array(); foreach ($shoporder->_products_ as $product) { //ищем по артикулу @@ -272,7 +269,7 @@ public function onOutcome($sender) { } $tovar->quantity = $product['quantity']; $tovar->price = round($product['price']); - $totalpr += ($tovar->quantity *$tovar->price); + $totalpr += ($tovar->quantity * $tovar->price); $tlist[] = $tovar; } @@ -283,14 +280,14 @@ public function onOutcome($sender) { $neworder->headerdata['ocorder'] = $shoporder->order_id; $neworder->headerdata['payment'] = $kassa; $neworder->customer_id = $modules['occustomer_id']; - + $neworder->amount = round($totalpr); - - if($shoporder->total > $totalpr) { - $neworder->headerdata['delivery_cost'] = $shoporder->total - $totalpr; - $neworder->headerdata['delivery'] = 2; - } - + + if ($shoporder->total > $totalpr) { + $neworder->headerdata['delivery_cost'] = $shoporder->total - $totalpr; + $neworder->headerdata['delivery'] = 2; + } + $neworder->payamount = round($shoporder->total); $neworder->payed = round($shoporder->total); $neworder->notes = "OC номер:{$shoporder->order_id};"; @@ -309,12 +306,12 @@ public function onOutcome($sender) { $i++; } - - + + $this->setInfo('imported_orders', $i); $this->_neworders = array(); - $this->neworderslist->Reload(); + $this->neworderslist->Reload(); } public function onRefresh($sender) { @@ -328,7 +325,7 @@ public function expRow($row) { $row->add(new CheckBox('ch', new Prop($order, 'ch'))); $row->add(new Label('number2', $order->document_number)); $row->add(new Label('number3', $order->headerdata['ocorder'])); - $row->add(new Label('date2', \App\Helper::fd( $order->document_date))); + $row->add(new Label('date2', \App\Helper::fd($order->document_date))); $row->add(new Label('amount2', $order->amount)); $row->add(new Label('customer2', $order->headerdata['occlient'])); $row->add(new Label('state', Document::getStateName($order->state))); diff --git a/www/app/modules/shop/entity/product.php b/www/app/modules/shop/entity/product.php index be75bc2e1..db69531b0 100644 --- a/www/app/modules/shop/entity/product.php +++ b/www/app/modules/shop/entity/product.php @@ -154,23 +154,23 @@ public static function loadSEF($sef) { return self::findFirst("product_id={$sef} or sef='{$sef}'"); } - + /** * возвращает количество на складе * * @param mixed $item_id * @param mixed $store_id - */ - public function getQuantity($store_id = 0 ) { + */ + public function getQuantity($store_id = 0) { $conn = \ZDB\DB::getConnect(); $sql = " select coalesce(sum(qty),0) as qty from store_stock where item_id = {$this->item_id} "; if ($store_id > 0) { $sql .= " and store_id = " . $store_id; } - + $cnt = $conn->GetOne($sql); return $cnt; - } - + } + } diff --git a/www/app/modules/shop/entity/productgroup.php b/www/app/modules/shop/entity/productgroup.php index f0f9dd0bb..09a507499 100644 --- a/www/app/modules/shop/entity/productgroup.php +++ b/www/app/modules/shop/entity/productgroup.php @@ -24,7 +24,7 @@ protected function beforeDelete() { $conn = \ZDB\DB::getConnect(); $sql = " select count(*) from shop_products where group_id = {$this->group_id}"; $cnt = $conn->GetOne($sql); - return ($cnt > 0) ? \App\Helper::l('nodelusedfroup') : ""; + return ($cnt > 0) ? \App\Helper::l('nodelusedfroup') : ""; } protected function afterDelete() { diff --git a/www/app/modules/shop/pages/base.php b/www/app/modules/shop/pages/base.php index 92a24434b..ca927a515 100644 --- a/www/app/modules/shop/pages/base.php +++ b/www/app/modules/shop/pages/base.php @@ -18,16 +18,16 @@ public function __construct($params = null) { $shop = array(); } $user = System::getUser(); - if($shop["uselogin"]==1) { - if($user->user_id==0) { - App::Redirect("\\App\\Modules\\Shop\\Pages\\Userlogin"); - return; - - } + if ($shop["uselogin"] == 1) { + if ($user->user_id == 0) { + App::Redirect("\\App\\Modules\\Shop\\Pages\\Userlogin"); + return; + + } } - - // $this->_tvars["islogined"] = $user->user_id > 0; + + // $this->_tvars["islogined"] = $user->user_id > 0; $this->_tvars["currencyname"] = $shop["currencyname"]; $this->_tvars["notcnt"] = false; @@ -49,7 +49,7 @@ public function setError($msg, $p1 = "", $p2 = "") { public function setSuccess($msg, $p1 = "", $p2 = "") { $msg = Helper::l($msg, $p1, $p2); - System::setSuccesMsg($msg); + System::setSuccessMsg($msg); } public function setWarn($msg, $p1 = "", $p2 = "") { diff --git a/www/app/modules/shop/pages/catalog.php b/www/app/modules/shop/pages/catalog.php index c8d798cd9..cff14caba 100644 --- a/www/app/modules/shop/pages/catalog.php +++ b/www/app/modules/shop/pages/catalog.php @@ -93,13 +93,13 @@ public function plistOnRow($row) { $row->add(new Label("sprice", $item->price)); $row->add(new TextInput('srated'))->setText($item->rating); $row->add(new ClickLink('sbuy', $this, 'OnBuy')); - - $op = \App\System::getOptions("shop"); - + + $op = \App\System::getOptions("shop"); + if ($item->getQuantity($op['defstore']) > 0) { - $row->sbuy->setValue( \App\Helper::l('tobay') ); + $row->sbuy->setValue(\App\Helper::l('tobay')); } else { - $row->sbuy->setValue(\App\Helper::l('toorder') ); + $row->sbuy->setValue(\App\Helper::l('toorder')); } $row->add(new Label('arrowup'))->setVisible($item->chprice == 'up'); $row->add(new Label('arrowdown'))->setVisible($item->chprice == 'down'); diff --git a/www/app/modules/shop/pages/grouplist.php b/www/app/modules/shop/pages/grouplist.php index c2bff6b28..2650c95d4 100644 --- a/www/app/modules/shop/pages/grouplist.php +++ b/www/app/modules/shop/pages/grouplist.php @@ -30,7 +30,7 @@ public function __construct() { parent::__construct(); if (strpos(System::getUser()->modules, 'shop') === false && System::getUser()->rolename != 'admins') { - System::setErrorMsg('noaccesstopage'); + System::setErrorMsg('noaccesstopage'); App::RedirectHome(); return; } @@ -128,9 +128,9 @@ public function onTree($sender, $id) { } $this->UpdateAttrList(); //у верхнего уровня нет картинок - $this->groupform->group_image->setVisible($this->group->parent_id>0); - $this->groupform->photo->setVisible($this->group->parent_id>0); - $this->groupform->savegroup->setVisible($this->group->parent_id>0); + $this->groupform->group_image->setVisible($this->group->parent_id > 0); + $this->groupform->photo->setVisible($this->group->parent_id > 0); + $this->groupform->savegroup->setVisible($this->group->parent_id > 0); } public function OnNewGroup($sender) { diff --git a/www/app/modules/shop/pages/manufacturers.php b/www/app/modules/shop/pages/manufacturers.php index da0ec09d1..15aaf9b24 100644 --- a/www/app/modules/shop/pages/manufacturers.php +++ b/www/app/modules/shop/pages/manufacturers.php @@ -17,7 +17,7 @@ class Manufacturers extends \App\Pages\Base public function __construct() { parent::__construct(); if (strpos(System::getUser()->modules, 'shop') === false && System::getUser()->rolename != 'admins') { - System::setErrorMsg('noaccesstopage'); + System::setErrorMsg('noaccesstopage'); App::RedirectHome(); return; } diff --git a/www/app/modules/shop/pages/options.php b/www/app/modules/shop/pages/options.php index 31c5d5f47..1b7444594 100644 --- a/www/app/modules/shop/pages/options.php +++ b/www/app/modules/shop/pages/options.php @@ -20,7 +20,7 @@ class Options extends \App\Pages\Base public function __construct() { parent::__construct(); if (strpos(System::getUser()->modules, 'shop') === false && System::getUser()->rolename != 'admins') { - System::setErrorMsg('noaccesstopage'); + System::setErrorMsg('noaccesstopage'); App::RedirectHome(); return; } @@ -74,8 +74,8 @@ public function saveShopOnClick($sender) { $shop['defpricetype'] = $this->shop->shopdefpricetype->getValue(); $shop['email'] = $this->shop->email->getText(); $shop['currencyname'] = $this->shop->currencyname->getText(); - $shop['uselogin'] = $this->shop->uselogin->isChecked() ? 1:0; - + $shop['uselogin'] = $this->shop->uselogin->isChecked() ? 1 : 0; + $file = $sender->logo->getFile(); if (strlen($file["tmp_name"]) > 0) { diff --git a/www/app/modules/shop/pages/productlist.php b/www/app/modules/shop/pages/productlist.php index 31418e70e..f7e950754 100644 --- a/www/app/modules/shop/pages/productlist.php +++ b/www/app/modules/shop/pages/productlist.php @@ -7,7 +7,7 @@ use App\Modules\Shop\Entity\Product; use App\Modules\Shop\Entity\ProductGroup; use App\Modules\Shop\Entity\Manufacturer; - + use App\System; use ZCL\BT\Tree; use Zippy\Binding\PropertyBinding as PB; @@ -34,7 +34,7 @@ class ProductList extends \App\Pages\Base public function __construct() { parent::__construct(); if (strpos(System::getUser()->modules, 'shop') === false && System::getUser()->rolename != 'admins') { - System::setErrorMsg('noaccesstopage'); + System::setErrorMsg('noaccesstopage'); App::RedirectHome(); return; } @@ -55,7 +55,7 @@ public function __construct() { $this->listpanel->add(new Form('searchform'))->onSubmit($this, 'searchformOnSubmit'); $this->listpanel->searchform->add(new TextInput('skeyword')); $this->listpanel->searchform->add(new CheckBox('sstatus')); - $this->listpanel->searchform->add(new DropDownChoice('smanuf', Manufacturer::findArray('manufacturername', '', 'manufacturername'))); + $this->listpanel->searchform->add(new DropDownChoice('smanuf', Manufacturer::findArray('manufacturername', '', 'manufacturername'))); $this->listpanel->searchform->add(new ClickLink('sclear'))->onClick($this, 'onSClear'); $this->listpanel->add(new Form('sortform')); $this->listpanel->sortform->add(new DropDownChoice('sorting'))->onChange($this, 'sortingOnChange'); @@ -77,8 +77,8 @@ public function __construct() { $editform->add(new TextArea('edescshort')); $editform->add(new TextArea('edescdet')); - $editform->add(new DropDownChoice('emanuf', Manufacturer::findArray('manufacturername', '', 'manufacturername'))); - $editform->add(new DropDownChoice('egroup', ProductGroup::findArray('groupname', 'group_id not in (select parent_id from shop_productgroups)', 'groupname'))); + $editform->add(new DropDownChoice('emanuf', Manufacturer::findArray('manufacturername', '', 'manufacturername'))); + $editform->add(new DropDownChoice('egroup', ProductGroup::findArray('groupname', 'group_id not in (select parent_id from shop_productgroups)', 'groupname'))); $editform->add(new DataView('attrlist', new ArrayDataSource(new PB($this, 'attrlist')), $this, 'attrlistOnRow')); @@ -187,24 +187,24 @@ public function addnewOnClick($sender) { //выбран товар public function onChangeItem($sender) { - + $item = Item::load($sender->getKey()); $this->product->productname = $item->itemname; $this->product->item_code = $item->item_code; - + $this->editpanel->editform->ename->setText($this->product->productname); $this->editpanel->editform->ecode->setText($this->product->item_code); $this->editpanel->editform->eprice->setText($item->getPrice($this->op['defpricetype'], $this->op['defstore'])); - + //подтягиваем бренд если совпадает имя - if(strlen($item->manufacturer)>0){ - $m = Manufacturer::getFirst('manufacturername ='.Manufacturer::qstr($item->manufacturer) ) ; - if($m instanceof Manufacturer) { + if (strlen($item->manufacturer) > 0) { + $m = Manufacturer::getFirst('manufacturername =' . Manufacturer::qstr($item->manufacturer)); + if ($m instanceof Manufacturer) { $this->editpanel->editform->emanuf->setValue($m->manufacturer_id); } } - - + + } public function OnAutoItem($sender) { diff --git a/www/app/modules/shop/pages/productview.php b/www/app/modules/shop/pages/productview.php index 3bf23d28a..9fc5756e4 100644 --- a/www/app/modules/shop/pages/productview.php +++ b/www/app/modules/shop/pages/productview.php @@ -73,13 +73,13 @@ public function __construct($product_id = 0) { $this->commentlist->Reload(); if ($product->deleted == 1) { - $this->onstore = \App\Helper::l('cancelsell') ; + $this->onstore = \App\Helper::l('cancelsell'); $this->buy->setVisible(false); } else { - $op = \App\System::getOptions("shop"); + $op = \App\System::getOptions("shop"); if ($product->getQuantity($op['defstore']) > 0) { $this->onstore->setText(\App\Helper::l('isonstore')); - $this->buy->setValue(\App\Helper::l('tobay') ); + $this->buy->setValue(\App\Helper::l('tobay')); } else { $this->onstore->setText(\App\Helper::l('fororder')); $this->buy->setValue(\App\Helper::l('toorder')); @@ -187,7 +187,7 @@ public function OnAddCommentRow(\Zippy\Html\DataList\DataRow $datarow) { } $datarow->add(new Label("nick", $item->author)); $datarow->add(new Label("comment", $item->comment)); - $datarow->add(new Label("created", \App\Helper::fdt( $item->created))); + $datarow->add(new Label("created", \App\Helper::fdt($item->created))); $datarow->add(new TextInput("rate"))->setText($item->rating); $datarow->add(new ClickLink('deletecomment', $this, 'OnDeleteComment'))->SetVisible(System::getUser()->userlogin == 'admin' && $item->moderated != 1); } diff --git a/www/app/modules/shop/pages/userlogin.php b/www/app/modules/shop/pages/userlogin.php index 995472399..011ac5a7e 100644 --- a/www/app/modules/shop/pages/userlogin.php +++ b/www/app/modules/shop/pages/userlogin.php @@ -39,23 +39,23 @@ public function onsubmit($sender) { $this->setError('enterpassword'); } } - - + + if (strlen($login) > 0 && strlen($password) > 0) { $user = Helper::login($login, $password); if ($user instanceof User) { - + if (strpos($user->modules, 'shop') === false && $user->rolename != 'admins') { - System::setErrorMsg('invalidlogin'); + System::setErrorMsg('invalidlogin'); App::RedirectHome(); return; - } - + } + $user->lastlogin = time(); $user->save(); - + System::setUser($user); $_SESSION['user_id'] = $user->user_id; //для использования вне Application $_SESSION['userlogin'] = $user->userlogin; //для использования вне Application @@ -64,10 +64,10 @@ public function onsubmit($sender) { setcookie("remember", $user->user_id . '_' . md5($user->user_id . $_config['common']['salt']), time() + 60 * 60 * 24 * 30); } - + App::RedirectHome(); - - + + } else { $this->setError('invalidlogin'); @@ -91,6 +91,5 @@ public function setError($msg) { $this->_tvars['alerterror'] = $msg; } - } diff --git a/www/app/modules/wc/orders.php b/www/app/modules/wc/orders.php index 2a35d3493..8b7791403 100644 --- a/www/app/modules/wc/orders.php +++ b/www/app/modules/wc/orders.php @@ -133,7 +133,7 @@ public function noOnRow($row) { $row->add(new Label('customer', $order->headerdata['wcclient'])); $row->add(new Label('amount', round($order->amount))); $row->add(new Label('comment', $order->notes)); - $row->add(new Label('date', \App\Helper::fdt( strtotime($order->document_date)))); + $row->add(new Label('date', \App\Helper::fdt(strtotime($order->document_date)))); } public function onImport($sender) { @@ -164,7 +164,7 @@ public function expRow($row) { $row->add(new CheckBox('ch', new Prop($order, 'ch'))); $row->add(new Label('number2', $order->document_number)); $row->add(new Label('number3', $order->headerdata['wcorder'])); - $row->add(new Label('date2', \App\Helper::fdt( $order->document_date))); + $row->add(new Label('date2', \App\Helper::fdt($order->document_date))); $row->add(new Label('amount2', $order->amount)); $row->add(new Label('customer2', $order->headerdata['wcclient'])); $row->add(new Label('state', Document::getStateName($order->state))); diff --git a/www/app/pages/base.php b/www/app/pages/base.php index e924344dc..d3cf035b9 100644 --- a/www/app/pages/base.php +++ b/www/app/pages/base.php @@ -32,7 +32,7 @@ public function __construct($params = null) { $blist = \App\Entity\Branch::getList(System::getUser()->user_id); if (count($blist) == 1) { //если одна $this->branch_id = array_pop(array_keys($blist)); - System::setBranch($this->branch_id) ; + System::setBranch($this->branch_id); } //форма филиалов $this->add(new \Zippy\Html\Form\Form('nbform')); @@ -60,13 +60,13 @@ public function __construct($params = null) { $this->_tvars["usebranch"] = $options['usebranch'] == 1; $this->_tvars["useval"] = $options['useval'] == 1; $this->_tvars["usefirms"] = $options['usefirms'] == 1; - + if ($this->_tvars["usebranch"] == false) { $this->branch_id = 0; - System::setBranch( 0) ; + System::setBranch(0); } $this->_tvars["smart"] = Helper::generateSmartMenu(); - + $this->_tvars["shopmenu"] = $_config['modules']['shop'] == 1; $this->_tvars["shop"] = $_config['modules']['shop'] == 1; $this->_tvars["ocstore"] = $_config['modules']['ocstore'] == 1; @@ -89,7 +89,7 @@ public function __construct($params = null) { if (strpos(System::getUser()->modules, 'woocomerce') === false && System::getUser()->rolename != 'admins') { $this->_tvars["woocomerce"] = false; } - + //скрыть боковое меню $this->_tvars["hidesidebar"] = $user->hidesidebar == 1 ? 'hold-transition sidebar-collapse' : 'hold-transition sidebar-mini sidebar-collapse'; //для скрытия блока разметки в шаблоне страниц @@ -110,8 +110,8 @@ public function LogoutClick($sender) { public function onnbFirm($sender) { $branch_id = $sender->getValue(); - System::setBranch($branch_id) ; - + System::setBranch($branch_id); + $page = get_class($this); App::Redirect($page); } @@ -124,7 +124,7 @@ public function setError($msg, $p1 = "", $p2 = "") { public function setSuccess($msg, $p1 = "", $p2 = "") { $msg = Helper::l($msg, $p1, $p2); - System::setSuccesMsg($msg); + System::setSuccessMsg($msg); } public function setWarn($msg, $p1 = "", $p2 = "") { @@ -200,8 +200,8 @@ protected final function resetURL() { \App\Application::$app->setReloadPage(); } - public function tm($p,$post) { - return "Привет" ; + public function tm($p, $post) { + return "Привет"; } diff --git a/www/app/pages/doc/goodsissue.php b/www/app/pages/doc/goodsissue.php index f24e54478..f8b6476e6 100644 --- a/www/app/pages/doc/goodsissue.php +++ b/www/app/pages/doc/goodsissue.php @@ -80,8 +80,8 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->add(new AutocompleteTextInput('customer'))->onText($this, 'OnAutoCustomer'); $this->docform->customer->onChange($this, 'OnChangeCustomer'); - $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this,'OnCustomerFirm' ); - $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false); ; + $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this, 'OnCustomerFirm'); + $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false);; $this->docform->add(new DropDownChoice('pricetype', Item::getPriceTypeList())); @@ -195,7 +195,7 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->order->setText($basedoc->document_number); $this->docform->ship_address->setText($basedoc->headerdata['address']); $this->docform->delivery->setValue($basedoc->headerdata['delivery']); - + $this->docform->sent_date->setDate($basedoc->headerdata['sent_date']); $this->docform->delivery_date->setDate($basedoc->headerdata['delivery']); @@ -213,7 +213,7 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->total->setText($order->amount); $this->OnChangeCustomer($this->docform->customer); - + $this->_itemlist = $basedoc->unpackDetails('detaildata'); $this->calcTotal(); @@ -239,10 +239,10 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->total->setText($invoice->amount); $this->docform->firm->setValue($basedoc->headerdata['firm_id']); - + $this->OnChangeCustomer($this->docform->customer); $this->docform->contract->setValue($basedoc->headerdata['contract_id']); - + $this->_itemlist = $basedoc->unpackDetails('detaildata'); $this->calcTotal(); @@ -251,8 +251,8 @@ public function __construct($docid = 0, $basedocid = 0) { if ($invoice->payamount > 0) { $this->docform->payment->setValue(MoneyFund::PREPAID);// предоплата } - - + + } @@ -269,7 +269,7 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->delivery->setValue($basedoc->headerdata['delivery']); $this->docform->firm->setValue($basedoc->headerdata['firm_id']); - + $this->OnChangeCustomer($this->docform->customer); $this->docform->contract->setValue($basedoc->headerdata['contract_id']); @@ -295,12 +295,12 @@ public function __construct($docid = 0, $basedocid = 0) { if (false == \App\ACL::checkShowDoc($this->_doc)) { return; } - + $this->_tvars['manlist'] = array(); - - foreach(Item::getManufacturers() as $man){ - $this->_tvars['manlist'][] = array('mitem'=>$man) ; - } + + foreach (Item::getManufacturers() as $man) { + $this->_tvars['manlist'][] = array('mitem' => $man); + } $this->OnDelivery($this->docform->delivery); } @@ -477,10 +477,10 @@ public function savedocOnClick($sender) { } $this->_doc->headerdata['contract_id'] = $this->docform->contract->getValue(); $this->_doc->headerdata['firm_id'] = $this->docform->firm->getValue(); - if($this->_doc->headerdata['firm_id']>0){ - $this->_doc->headerdata['firm_name'] = $this->docform->firm->getValueName(); + if ($this->_doc->headerdata['firm_id'] > 0) { + $this->_doc->headerdata['firm_name'] = $this->docform->firm->getValueName(); } - + $this->_doc->payamount = $this->docform->payamount->getText(); $this->_doc->payed = $this->docform->payed->getText(); @@ -601,13 +601,14 @@ public function onPayAmount($sender) { $this->docform->payamount->setText($this->docform->editpayamount->getText()); $this->goAnkor("tankor"); } + public function onDelivery_cost($sender) { $this->docform->delivery_cost->setText($this->docform->editdelivery_cost->getText()); $this->goAnkor("tankor"); $this->calcPay(); } - public function onPayed($sender) { + public function onPayed($sender) { $this->docform->payed->setText(H::fa($this->docform->editpayed->getText())); $payed = $this->docform->payed->getText(); $payamount = $this->docform->payamount->getText(); @@ -675,12 +676,16 @@ private function calcPay() { $total = $this->docform->total->getText(); $disc = $this->docform->paydisc->getText(); $delivery_cost = $this->docform->delivery_cost->getText(); - if($disc>0)$total -= $disc; - if($delivery_cost>0)$total += $delivery_cost; - $this->docform->editpayamount->setText(H::fa($total )); - $this->docform->payamount->setText(H::fa($total )); - $this->docform->editpayed->setText(H::fa($total )); - $this->docform->payed->setText(H::fa($total )); + if ($disc > 0) { + $total -= $disc; + } + if ($delivery_cost > 0) { + $total += $delivery_cost; + } + $this->docform->editpayamount->setText(H::fa($total)); + $this->docform->payamount->setText(H::fa($total)); + $this->docform->editpayed->setText(H::fa($total)); + $this->docform->payed->setText(H::fa($total)); } public function OnPayment($sender) { @@ -974,24 +979,24 @@ public function onSelectItem($item_id, $itemname) { $this->editdetail->edittovar->setText($itemname); $this->OnChangeItem($this->editdetail->edittovar); } - + public function OnCustomerFirm($sender) { - $c=$this->docform->customer->getKey(); - $f=$this->docform->firm->getValue(); - - $ar = \App\Entity\Contract::getList($c,$f) ; - + $c = $this->docform->customer->getKey(); + $f = $this->docform->firm->getValue(); + + $ar = \App\Entity\Contract::getList($c, $f); + $this->docform->contract->setOptionList($ar); - if(count($ar)>0){ - $this->docform->contract->setVisible(true); - } else { - $this->docform->contract->setVisible(false); - $this->docform->contract->setValue(0); + if (count($ar) > 0) { + $this->docform->contract->setVisible(true); + } else { + $this->docform->contract->setVisible(false); + $this->docform->contract->setValue(0); } - + } - - + + } diff --git a/www/app/pages/doc/goodsreceipt.php b/www/app/pages/doc/goodsreceipt.php index b21e51b4a..7b0214f53 100644 --- a/www/app/pages/doc/goodsreceipt.php +++ b/www/app/pages/doc/goodsreceipt.php @@ -32,7 +32,7 @@ class GoodsReceipt extends \App\Pages\Base private $_doc; private $_basedocid = 0; private $_rowid = 0; - + public function __construct($docid = 0, $basedocid = 0) { parent::__construct(); @@ -45,9 +45,9 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->add(new TextInput('document_number')); $this->docform->add(new Date('document_date'))->setDate(time()); $this->docform->add(new AutocompleteTextInput('customer'))->onText($this, 'OnAutoCustomer'); - $this->docform->customer->onChange($this,'OnCustomerFirm') ; - $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this,'OnCustomerFirm' ); - $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false); ; + $this->docform->customer->onChange($this, 'OnCustomerFirm'); + $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this, 'OnCustomerFirm'); + $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false);; $this->docform->add(new DropDownChoice('store', Store::getList(), H::getDefStore())); $this->docform->add(new TextInput('notes')); @@ -57,9 +57,9 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->add(new SubmitLink('addcode'))->onClick($this, 'addcodeOnClick'); $this->docform->add(new DropDownChoice('payment', MoneyFund::getList(true, true), H::getDefMF()))->onChange($this, 'OnPayment'); - - - $this->docform->add(new DropDownChoice('val',H::getValList() , '0'))->onChange($this, 'OnVal'); + + + $this->docform->add(new DropDownChoice('val', H::getValList(), '0'))->onChange($this, 'OnVal'); $this->docform->add(new SubmitLink('addcust'))->onClick($this, 'addcustOnClick'); @@ -199,7 +199,6 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->contract->setValue($invoice->headerdata['contract_id']); - $this->_itemlist = $basedoc->unpackDetails('detaildata'); $this->CalcTotal(); $this->CalcPay(); @@ -233,19 +232,19 @@ public function __construct($docid = 0, $basedocid = 0) { if (false == \App\ACL::checkShowDoc($this->_doc)) { return; } - + $this->_tvars['manlist'] = array(); - - foreach(Item::getManufacturers() as $man){ - $this->_tvars['manlist'][] = array('mitem'=>$man) ; - } - + + foreach (Item::getManufacturers() as $man) { + $this->_tvars['manlist'][] = array('mitem' => $man); + } + } public function detailOnRow($row) { $item = $row->getDataItem(); - $row->add(new Label('num', $row->getAllNumber())); + $row->add(new Label('num', $row->getAllNumber())); $row->add(new Label('item', $item->itemname)); $row->add(new Label('code', $item->item_code)); @@ -253,7 +252,7 @@ public function detailOnRow($row) { $row->add(new Label('price', H::fa($item->price))); $row->add(new Label('msr', $item->msr)); $row->add(new Label('snumber', $item->snumber)); - $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd( $item->sdate) : '')); + $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd($item->sdate) : '')); $row->add(new Label('amount', H::fa($item->quantity * $item->price))); $row->add(new ClickLink('edit'))->onClick($this, 'editOnClick'); @@ -275,8 +274,12 @@ public function editOnClick($sender) { $this->editdetail->edititem->setKey($item->item_id); $this->editdetail->edititem->setText($item->itemname); - if($item->rowid>0) ; //для совместимости - else $item->rowid = $item->item_id ; + if ($item->rowid > 0) { + ; + } //для совместимости + else { + $item->rowid = $item->item_id; + } $this->_rowid = $item->rowid; } @@ -287,12 +290,16 @@ public function deleteOnClick($sender) { } $item = $sender->owner->getDataItem(); - if($item->rowid>0) ; //для совместимости - else $item->rowid = $item->item_id ; - + if ($item->rowid > 0) { + ; + } //для совместимости + else { + $item->rowid = $item->item_id; + } + $this->_itemlist = array_diff_key($this->_itemlist, array($item->rowid => $this->_itemlist[$item->rowid])); - - + + $this->calcTotal(); $this->calcPay(); @@ -306,7 +313,7 @@ public function addcodeOnClick($sender) { return; } - foreach ($this->_itemlist as $ri=>$_item ) { + foreach ($this->_itemlist as $ri => $_item) { if ($_item->bar_code == $code) { $this->_itemlist[$ri]->quantity += 1; $this->docform->detail->Reload(); @@ -373,13 +380,13 @@ public function saverowOnClick($sender) { if ($item->sdate == false) { $item->sdate = ''; } - - if ($this->_rowid > 0) { + + if ($this->_rowid > 0) { $item->rowid = $this->_rowid; - }else { - $next = count($this->_itemlist) >0? max(array_keys($this->_itemlist)) : 0; - $item->rowid=$next+1 ; + } else { + $next = count($this->_itemlist) > 0 ? max(array_keys($this->_itemlist)) : 0; + $item->rowid = $next + 1; } $this->_itemlist[$item->rowid] = $item; @@ -430,10 +437,10 @@ public function savedocOnClick($sender) { } $this->_doc->headerdata['contract_id'] = $this->docform->contract->getValue(); $this->_doc->headerdata['firm_id'] = $this->docform->firm->getValue(); - if($this->_doc->headerdata['firm_id']>0){ - $this->_doc->headerdata['firm_name'] = $this->docform->firm->getValueName(); + if ($this->_doc->headerdata['firm_id'] > 0) { + $this->_doc->headerdata['firm_name'] = $this->docform->firm->getValueName(); } - + $this->_doc->payamount = $this->docform->payamount->getText(); $this->_doc->headerdata['store'] = $this->docform->store->getValue(); $this->_doc->headerdata['payment'] = $this->docform->payment->getValue(); @@ -501,18 +508,18 @@ public function savedocOnClick($sender) { } } } - + //обновляем курс - if(strlen($this->_doc->headerdata['val'])>1) { - $optval = \App\System::getOptions("val" ); - if(strlen($optval[$this->_doc->headerdata['val']])>0){ - $optval[$this->_doc->headerdata['val']] = $this->_doc->headerdata['rate'] ; - \App\System::setOptions("val", $optval); - } - + if (strlen($this->_doc->headerdata['val']) > 1) { + $optval = \App\System::getOptions("val"); + if (strlen($optval[$this->_doc->headerdata['val']]) > 0) { + $optval[$this->_doc->headerdata['val']] = $this->_doc->headerdata['rate']; + \App\System::setOptions("val", $optval); + } + } - - + + } else { $this->_doc->updateStatus($isEdited ? Document::STATE_EDITED : Document::STATE_NEW); @@ -592,13 +599,13 @@ public function onDisc($sender) { } public function onNds($sender) { - $this->docform->nds->setText( $this->docform->editnds->getText() ); + $this->docform->nds->setText($this->docform->editnds->getText()); $this->CalcPay(); $this->goAnkor("tankor"); } public function onRate($sender) { - $this->docform->rate->setText( $this->docform->editrate->getText() ); + $this->docform->rate->setText($this->docform->editrate->getText()); $this->CalcPay(); $this->goAnkor("tankor"); } @@ -677,18 +684,18 @@ public function OnAutoCustomer($sender) { $text = Customer::qstr('%' . $sender->getText() . '%'); return Customer::findArray("customer_name", "status=0 and (customer_name like {$text} or phone like {$text} ) and (detail like '%2%' or detail like '%0%' )"); } - + public function OnVal($sender) { $val = $sender->getValue(); - if(strlen($val)>1){ - $optval = \App\System::getOptions("val" ); - $rate = $optval[$val]; - } else { - $rate =1; - } - $this->docform->rate->setText($rate); - $this->docform->editrate->setText($rate); - $this->CalcPay(); + if (strlen($val) > 1) { + $optval = \App\System::getOptions("val"); + $rate = $optval[$val]; + } else { + $rate = 1; + } + $this->docform->rate->setText($rate); + $this->docform->editrate->setText($rate); + $this->CalcPay(); } //добавление нового товара @@ -702,8 +709,8 @@ public function addnewitemOnClick($sender) { if (System::getOption("common", "autoarticle") == 1) { $this->editnewitem->editnewitemcode->setText(Item::getNextArticle()); } - - + + } public function savenewitemOnClick($sender) { @@ -814,21 +821,21 @@ public function onSelectItem($item_id, $itemname) { } - public function OnCustomerFirm($sender) { - $c=$this->docform->customer->getKey(); - $f=$this->docform->firm->getValue(); - - $ar = \App\Entity\Contract::getList($c,$f) ; - + public function OnCustomerFirm($sender) { + $c = $this->docform->customer->getKey(); + $f = $this->docform->firm->getValue(); + + $ar = \App\Entity\Contract::getList($c, $f); + $this->docform->contract->setOptionList($ar); - if(count($ar)>0){ - $this->docform->contract->setVisible(true); - } else { - $this->docform->contract->setVisible(false); - $this->docform->contract->setValue(0); + if (count($ar) > 0) { + $this->docform->contract->setVisible(true); + } else { + $this->docform->contract->setVisible(false); + $this->docform->contract->setValue(0); } - + } - - + + } diff --git a/www/app/pages/doc/incomeitem.php b/www/app/pages/doc/incomeitem.php index 5a7f5615f..4fa2a8b5e 100644 --- a/www/app/pages/doc/incomeitem.php +++ b/www/app/pages/doc/incomeitem.php @@ -82,18 +82,17 @@ public function __construct($docid = 0, $basedocid = 0) { if ($basedoc->meta_name == 'OutcomeItem') { - - foreach($basedoc->unpackDetails('detaildata') as $it){ - - //последняя партия - $stock = \App\Entity\Stock::getFirst("item_id = {$it->item_id} and store_id={$basedoc->headerdata['store'] }",'stock_id desc') ; - $it->price = $stock->partion; - - - $this->_itemlist[] = $it; - } - - + foreach ($basedoc->unpackDetails('detaildata') as $it) { + + //последняя партия + $stock = \App\Entity\Stock::getFirst("item_id = {$it->item_id} and store_id={$basedoc->headerdata['store'] }", 'stock_id desc'); + $it->price = $stock->partion; + + + $this->_itemlist[] = $it; + } + + } } } @@ -114,7 +113,7 @@ public function detailOnRow($row) { $row->add(new Label('item', $item->itemname)); $row->add(new Label('msr', $item->msr)); $row->add(new Label('snumber', $item->snumber)); - $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd( $item->sdate) : '')); + $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd($item->sdate) : '')); $row->add(new Label('price', H::fa($item->price))); diff --git a/www/app/pages/doc/inventory.php b/www/app/pages/doc/inventory.php index 5b9508daf..6764976db 100644 --- a/www/app/pages/doc/inventory.php +++ b/www/app/pages/doc/inventory.php @@ -87,7 +87,7 @@ public function detailOnRow($row) { $row->add(new Label('item', $item->itemname)); $row->add(new Label('snumber', $item->snumber)); - $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd( $item->sdate) : '')); + $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd($item->sdate) : '')); // $row->add(new Label('quantity', H::fqty($item->quantity))); $row->add(new Label('qfact', H::fqty($item->qfact))); @@ -175,8 +175,8 @@ public function saverowOnClick($sender) { $tarr[$item->item_id] = $item; } $this->_itemlist = $tarr; - $this->_rowid = 0; - + $this->_rowid = 0; + $this->editdetail->setVisible(false); $this->docform->setVisible(true); $this->docform->detail->Reload(); diff --git a/www/app/pages/doc/invoice.php b/www/app/pages/doc/invoice.php index 4d64c7b24..1c012e076 100644 --- a/www/app/pages/doc/invoice.php +++ b/www/app/pages/doc/invoice.php @@ -45,8 +45,8 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->add(new AutocompleteTextInput('customer'))->onText($this, 'OnAutoCustomer'); $this->docform->customer->onChange($this, 'OnChangeCustomer'); - $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this,'OnCustomerFirm' ); - $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false); ; + $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this, 'OnCustomerFirm'); + $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false);; $this->docform->add(new TextArea('notes')); @@ -130,7 +130,7 @@ public function __construct($docid = 0, $basedocid = 0) { $this->OnChangeCustomer($this->docform->customer); $this->docform->contract->setValue($this->_doc->headerdata['contract_id']); - + } else { $this->_doc = Document::create('Invoice'); $this->docform->document_number->setText($this->_doc->nextNumber()); @@ -314,9 +314,6 @@ public function savedocOnClick($sender) { $this->_doc->headerdata['store'] = $this->docform->store->getValue(); $this->_doc->headerdata['contract_id'] = $this->docform->contract->getValue(); $this->_doc->headerdata['firm_id'] = $this->docform->firm->getValue(); - if($this->_doc->headerdata['firm_id']>0){ - $this->_doc->headerdata['firm_name'] = $this->docform->firm->getValueName(); - } $this->_doc->packDetails('detaildata', $this->_tovarlist); @@ -586,19 +583,19 @@ public function OnChangePriceType($sender) { } public function OnCustomerFirm($sender) { - $c=$this->docform->customer->getKey(); - $f=$this->docform->firm->getValue(); - - $ar = \App\Entity\Contract::getList($c,$f) ; - + $c = $this->docform->customer->getKey(); + $f = $this->docform->firm->getValue(); + + $ar = \App\Entity\Contract::getList($c, $f); + $this->docform->contract->setOptionList($ar); - if(count($ar)>0){ - $this->docform->contract->setVisible(true); - } else { - $this->docform->contract->setVisible(false); - $this->docform->contract->setValue(0); + if (count($ar) > 0) { + $this->docform->contract->setVisible(true); + } else { + $this->docform->contract->setVisible(false); + $this->docform->contract->setValue(0); } - + } - + } diff --git a/www/app/pages/doc/invoicecust.php b/www/app/pages/doc/invoicecust.php index 109f33346..a8296cb7e 100644 --- a/www/app/pages/doc/invoicecust.php +++ b/www/app/pages/doc/invoicecust.php @@ -40,14 +40,14 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->add(new TextInput('document_number')); $this->docform->add(new Date('document_date'))->setDate(time()); $this->docform->add(new AutocompleteTextInput('customer'))->onText($this, 'OnAutoCustomer'); - $this->docform->customer->onChange($this,'OnCustomerFirm') ; - $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this,'OnCustomerFirm' ); - $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false); ; - + $this->docform->customer->onChange($this, 'OnCustomerFirm'); + $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this, 'OnCustomerFirm'); + $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false);; + $this->docform->add(new TextInput('notes')); - $this->docform->add(new DropDownChoice('val',H::getValList() , '0'))->onChange($this, 'OnVal'); + $this->docform->add(new DropDownChoice('val', H::getValList(), '0'))->onChange($this, 'OnVal'); + - $this->docform->add(new SubmitLink('addrow'))->onClick($this, 'addrowOnClick'); $this->docform->add(new Button('backtolist'))->onClick($this, 'backtolistOnClick'); $this->docform->add(new SubmitButton('savedoc'))->onClick($this, 'savedocOnClick'); @@ -118,7 +118,7 @@ public function __construct($docid = 0, $basedocid = 0) { $this->OnCustomerFirm($this->docform->customer); $this->docform->contract->setValue($this->_doc->headerdata['contract_id']); - + $this->docform->total->setText($this->_doc->amount); $this->_itemlist = $this->_doc->unpackDetails('detaildata'); @@ -287,10 +287,10 @@ public function savedocOnClick($sender) { } $this->_doc->headerdata['contract_id'] = $this->docform->contract->getValue(); $this->_doc->headerdata['firm_id'] = $this->docform->firm->getValue(); - if($this->_doc->headerdata['firm_id']>0){ - $this->_doc->headerdata['firm_name'] = $this->docform->firm->getValueName(); + if ($this->_doc->headerdata['firm_id'] > 0) { + $this->_doc->headerdata['firm_name'] = $this->docform->firm->getValueName(); } - + $this->_doc->headerdata['payment'] = $this->docform->payment->getValue(); if ($this->checkForm() == false) { @@ -328,19 +328,19 @@ public function savedocOnClick($sender) { } $this->_doc->updateStatus(Document::STATE_EXECUTED); - - + + //обновляем курс - if(strlen($this->_doc->headerdata['val'])>1) { - $optval = \App\System::getOptions("val" ); - if(strlen($optval[$this->_doc->headerdata['val']])>0){ - $optval[$this->_doc->headerdata['val']] = $this->_doc->headerdata['rate'] ; - \App\System::setOptions("val", $optval); - } - + if (strlen($this->_doc->headerdata['val']) > 1) { + $optval = \App\System::getOptions("val"); + if (strlen($optval[$this->_doc->headerdata['val']]) > 0) { + $optval[$this->_doc->headerdata['val']] = $this->_doc->headerdata['rate']; + \App\System::setOptions("val", $optval); + } + } - - + + } else { $this->_doc->updateStatus($isEdited ? Document::STATE_EDITED : Document::STATE_NEW); } @@ -433,17 +433,17 @@ public function onRate($sender) { public function OnVal($sender) { $val = $sender->getValue(); - if(strlen($val)>1){ - $optval = \App\System::getOptions("val" ); - $rate = $optval[$val]; - } else { - $rate =1; + if (strlen($val) > 1) { + $optval = \App\System::getOptions("val"); + $rate = $optval[$val]; + } else { + $rate = 1; } - $this->docform->rate->setText($rate); - $this->docform->editrate->setText($rate); - $this->CalcPay(); + $this->docform->rate->setText($rate); + $this->docform->editrate->setText($rate); + $this->CalcPay(); } - + /** * Валидация формы @@ -518,19 +518,19 @@ public function cancelnewitemOnClick($sender) { } public function OnCustomerFirm($sender) { - $c=$this->docform->customer->getKey(); - $f=$this->docform->firm->getValue(); - - $ar = \App\Entity\Contract::getList($c,$f) ; - + $c = $this->docform->customer->getKey(); + $f = $this->docform->firm->getValue(); + + $ar = \App\Entity\Contract::getList($c, $f); + $this->docform->contract->setOptionList($ar); - if(count($ar)>0){ - $this->docform->contract->setVisible(true); - } else { - $this->docform->contract->setVisible(false); - $this->docform->contract->setValue(0); + if (count($ar) > 0) { + $this->docform->contract->setVisible(true); + } else { + $this->docform->contract->setVisible(false); + $this->docform->contract->setValue(0); } - + } - + } diff --git a/www/app/pages/doc/outcomeitem.php b/www/app/pages/doc/outcomeitem.php index d41dcc33e..6b39384de 100644 --- a/www/app/pages/doc/outcomeitem.php +++ b/www/app/pages/doc/outcomeitem.php @@ -41,23 +41,23 @@ public function __construct($docid = 0) { $tostore = array(); $conn = \ZDB\DB::getConnect(); - if($this->_tvars["usebranch"]) { + if ($this->_tvars["usebranch"]) { $rs = $conn->Execute("select s.store_id,s.`storename`,b.branch_id ,b.`branch_name` from stores s join branches b on s.`branch_id` = b.`branch_id` where b.`disabled` <> 1 order by branch_name, storename"); - foreach($rs as $it){ - $tostore[$it['store_id'] ] = $it['branch_name'] .", ". $it['storename'] ; + foreach ($rs as $it) { + $tostore[$it['store_id']] = $it['branch_name'] . ", " . $it['storename']; } } else { $rs = $conn->Execute("select store_id, storename from stores order by storename"); - foreach($rs as $it){ - $tostore[$it['store_id'] ] = $it['storename'] ; + foreach ($rs as $it) { + $tostore[$it['store_id']] = $it['storename']; } - + } - - - $this->docform->add(new DropDownChoice('tostore', $tostore, 0)) ; - - + + + $this->docform->add(new DropDownChoice('tostore', $tostore, 0)); + + $this->docform->add(new TextInput('notes')); $this->docform->add(new TextInput('barcode')); $this->docform->add(new SubmitLink('addcode'))->onClick($this, 'addcodeOnClick'); @@ -170,7 +170,7 @@ public function saverowOnClick($sender) { $this->setError("noselitem"); return; } - + $item = Item::load($id); $item->snumber = trim($this->editdetail->editsnumber->getText()); $item->quantity = $this->editdetail->editquantity->getText(); @@ -276,58 +276,58 @@ public function savedocOnClick($sender) { } } $this->_doc->updateStatus(Document::STATE_EXECUTED); - - + + $tostore = $this->docform->tostore->getValue(); if ($sender->id == 'execdoc' && $tostore > 0) { - $ch = $this->_doc->getChildren('IncomeItem'); - if(count($ch) > 0) { + $ch = $this->_doc->getChildren('IncomeItem'); + if (count($ch) > 0) { $this->setWarn('Уже существует приходный документ'); - } else { - if($this->_doc->headerdata['store'] == $tostore) { - $this->setWarn('Выбран тот же склад'); - } - $indoc = Document::create('IncomeItem'); - - $indoc->headerdata['store'] = $tostore; - $indoc->headerdata['storename'] = $this->docform->tostore->getValueName(); - $indoc->branch_id = 0; - if($this->_tvars["usebranch"]) { - $st = Store::load($tostore) ; - $indoc->branch_id = $st->branch_id; - } - $indoc->document_number = $indoc->nextNumber($indoc->branch_id); - $indoc->user_id = 0; - $indoc->notes = "Списано с '".$this->_doc->headerdata['storename']."'на основании '". $this->_doc->document_number."'"; - - - $items=array(); - - foreach($this->_itemlist as $it){ - - //последняя партия - $stock = \App\Entity\Stock::getFirst("item_id = {$it->item_id} and store_id={$this->_doc->headerdata['store'] }",'stock_id desc') ; - $it->price = $stock->partion; - - - $items[] = $it; - } - $indoc->packDetails('detaildata', $items); - - - $indoc->save(); - $indoc->updateStatus(Document::STATE_NEW); - - if($indoc->branch_id == 0) { - $indoc->user_id = \App\System::getUser()->user_id; - $indoc->updateStatus(Document::STATE_EXECUTED); - } - if($indoc->document_id > 0){ - $this->setSuccess('Создан документ'); - } - - } - } + } else { + if ($this->_doc->headerdata['store'] == $tostore) { + $this->setWarn('Выбран тот же склад'); + } + $indoc = Document::create('IncomeItem'); + + $indoc->headerdata['store'] = $tostore; + $indoc->headerdata['storename'] = $this->docform->tostore->getValueName(); + $indoc->branch_id = 0; + if ($this->_tvars["usebranch"]) { + $st = Store::load($tostore); + $indoc->branch_id = $st->branch_id; + } + $indoc->document_number = $indoc->nextNumber($indoc->branch_id); + $indoc->user_id = 0; + $indoc->notes = "Списано с '" . $this->_doc->headerdata['storename'] . "'на основании '" . $this->_doc->document_number . "'"; + + + $items = array(); + + foreach ($this->_itemlist as $it) { + + //последняя партия + $stock = \App\Entity\Stock::getFirst("item_id = {$it->item_id} and store_id={$this->_doc->headerdata['store'] }", 'stock_id desc'); + $it->price = $stock->partion; + + + $items[] = $it; + } + $indoc->packDetails('detaildata', $items); + + + $indoc->save(); + $indoc->updateStatus(Document::STATE_NEW); + + if ($indoc->branch_id == 0) { + $indoc->user_id = \App\System::getUser()->user_id; + $indoc->updateStatus(Document::STATE_EXECUTED); + } + if ($indoc->document_id > 0) { + $this->setSuccess('Создан документ'); + } + + } + } } else { $this->_doc->updateStatus($isEdited ? Document::STATE_EDITED : Document::STATE_NEW); diff --git a/www/app/pages/doc/poscheck.php b/www/app/pages/doc/poscheck.php index d08536a20..719914c2f 100644 --- a/www/app/pages/doc/poscheck.php +++ b/www/app/pages/doc/poscheck.php @@ -246,7 +246,7 @@ public function detailOnRow($row) { $row->add(new Label('code', $item->item_code)); $row->add(new Label('msr', $item->msr)); $row->add(new Label('snumber', $item->snumber)); - $row->add(new Label('sdate', $item->sdate > 0 ? date\App\Helper::fd( $item->sdate) : '')); + $row->add(new Label('sdate', $item->sdate > 0 ? date\App\Helper::fd($item->sdate) : '')); $row->add(new Label('quantity', H::fqty($item->quantity))); $row->add(new Label('price', H::fa($item->price))); diff --git a/www/app/pages/doc/prodissue.php b/www/app/pages/doc/prodissue.php index d0a8a8311..902be98b2 100644 --- a/www/app/pages/doc/prodissue.php +++ b/www/app/pages/doc/prodissue.php @@ -104,30 +104,29 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->parea->setValue($basedoc->headerdata['parea']); $parts = array(); - foreach($basedoc->unpackDetails('detaildata') as $tovar){ - $plist = \App\Entity\ItemSet::find('pitem_id='.$tovar->item_id) ; - foreach($plist as $p) { - if(isset($parts[$p->item_id]) ) { - $parts[$p->item_id]->qty += ($tovar->quantity* $p->qty); - } else { - $parts[$p->item_id] = Item::load($p->item_id); - $parts[$p->item_id]->qty = ($tovar->quantity* $p->qty); - } + foreach ($basedoc->unpackDetails('detaildata') as $tovar) { + $plist = \App\Entity\ItemSet::find('pitem_id=' . $tovar->item_id); + foreach ($plist as $p) { + if (isset($parts[$p->item_id])) { + $parts[$p->item_id]->qty += ($tovar->quantity * $p->qty); + } else { + $parts[$p->item_id] = Item::load($p->item_id); + $parts[$p->item_id]->qty = ($tovar->quantity * $p->qty); + } } - + } - foreach($parts as $p) { - $it = Item::load($p->item_id); - $it->quantity = $p->qty; - - - $this->_itemlist[$it->item_id]= $it; + foreach ($parts as $p) { + $it = Item::load($p->item_id); + $it->quantity = $p->qty; + + + $this->_itemlist[$it->item_id] = $it; } } - - - + + } } } @@ -148,7 +147,7 @@ public function detailOnRow($row) { $row->add(new Label('quantity', H::fqty($item->quantity))); $row->add(new Label('snumber', $item->snumber)); - $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd( $item->sdate) : '')); + $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd($item->sdate) : '')); $row->add(new ClickLink('delete'))->onClick($this, 'deleteOnClick'); diff --git a/www/app/pages/doc/prodreceipt.php b/www/app/pages/doc/prodreceipt.php index b7f7a48b5..87ef03352 100644 --- a/www/app/pages/doc/prodreceipt.php +++ b/www/app/pages/doc/prodreceipt.php @@ -95,7 +95,7 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->notes->setText('Наряд ' . $basedoc->document_number); $this->docform->parea->setValue($basedoc->headerdata['parea']); } - + } } @@ -116,7 +116,7 @@ public function detailOnRow($row) { $row->add(new Label('quantity', H::fqty($item->quantity))); $row->add(new Label('price', H::fa($item->price))); $row->add(new Label('snumber', $item->snumber)); - $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd( $item->sdate) : '')); + $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd($item->sdate) : '')); $row->add(new Label('amount', H::fa($item->quantity * $item->price))); $row->add(new ClickLink('edit'))->onClick($this, 'editOnClick'); diff --git a/www/app/pages/doc/retcustissue.php b/www/app/pages/doc/retcustissue.php index 8768239ff..da1941e43 100644 --- a/www/app/pages/doc/retcustissue.php +++ b/www/app/pages/doc/retcustissue.php @@ -131,7 +131,7 @@ public function detailOnRow($row) { $row->add(new Label('code', $item->item_code)); $row->add(new Label('msr', $item->msr)); $row->add(new Label('snumber', $item->snumber)); - $row->add(new Label('sdate', $item->sdate > 0 ? date\App\Helper::fd( $item->sdate) : '')); + $row->add(new Label('sdate', $item->sdate > 0 ? date\App\Helper::fd($item->sdate) : '')); $row->add(new Label('quantity', H::fqty($item->quantity))); $row->add(new Label('price', H::fa($item->price))); diff --git a/www/app/pages/doc/returnissue.php b/www/app/pages/doc/returnissue.php index 07d1fe88e..81aacc9b5 100644 --- a/www/app/pages/doc/returnissue.php +++ b/www/app/pages/doc/returnissue.php @@ -126,7 +126,7 @@ public function detailOnRow($row) { $row->add(new Label('tovar', $item->itemname)); $row->add(new Label('msr', $item->msr)); $row->add(new Label('snumber', $item->snumber)); - $row->add(new Label('sdate', $item->snumber > 0 ? ($item->sdate > 0 ? date\App\Helper::fd( $item->sdate) : '') : '')); + $row->add(new Label('sdate', $item->snumber > 0 ? ($item->sdate > 0 ? date\App\Helper::fd($item->sdate) : '') : '')); $row->add(new Label('quantity', H::fqty($item->quantity))); diff --git a/www/app/pages/doc/serviceact.php b/www/app/pages/doc/serviceact.php index 3b1b632f3..f62a1ad41 100644 --- a/www/app/pages/doc/serviceact.php +++ b/www/app/pages/doc/serviceact.php @@ -39,11 +39,11 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->add(new TextInput('document_number')); $this->docform->add(new Date('document_date'))->setDate(time()); $this->docform->add(new AutocompleteTextInput('customer'))->onText($this, 'OnAutoCustomer'); - $this->docform->customer->onChange($this,'OnCustomerFirm') ; + $this->docform->customer->onChange($this, 'OnCustomerFirm'); + + $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this, 'OnCustomerFirm'); + $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false);; - $this->docform->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0))->onChange($this,'OnCustomerFirm' ); - $this->docform->add(new DropDownChoice('contract', array(), 0))->setVisible(false); ; - $this->docform->add(new TextInput('notes')); $this->docform->add(new TextInput('gar')); $this->docform->add(new TextInput('device')); @@ -125,15 +125,15 @@ public function __construct($docid = 0, $basedocid = 0) { $this->docform->document_number->setText($this->_doc->nextNumber()); if ($basedocid > 0) { //создание на основании $basedoc = Document::load($basedocid); - + if ($basedoc->meta_name == 'Task') { $this->docform->notes->setText('Наряд ' . $basedoc->document_number); $this->_servicelist = $basedoc->unpackDetails('detaildata'); - + } - - } + + } } $this->docform->add(new DataView('detail', new \Zippy\Html\DataList\ArrayDataSource(new \Zippy\Binding\PropertyBinding($this, '_servicelist')), $this, 'detailOnRow'))->Reload(); @@ -241,10 +241,10 @@ public function savedocOnClick($sender) { $this->_doc->headerdata['devsn'] = $this->docform->devsn->getText(); $this->_doc->headerdata['contract_id'] = $this->docform->contract->getValue(); $this->_doc->headerdata['firm_id'] = $this->docform->firm->getValue(); - if($this->_doc->headerdata['firm_id']>0){ - $this->_doc->headerdata['firm_name'] = $this->docform->firm->getValueName(); + if ($this->_doc->headerdata['firm_id'] > 0) { + $this->_doc->headerdata['firm_name'] = $this->docform->firm->getValueName(); } - + $this->calcTotal(); @@ -438,21 +438,21 @@ public function OnChangeServive($sender) { } public function OnCustomerFirm($sender) { - $c=$this->docform->customer->getKey(); - $f=$this->docform->firm->getValue(); - - $ar = \App\Entity\Contract::getList($c,$f) ; - + $c = $this->docform->customer->getKey(); + $f = $this->docform->firm->getValue(); + + $ar = \App\Entity\Contract::getList($c, $f); + $this->docform->contract->setOptionList($ar); - if(count($ar)>0){ - $this->docform->contract->setVisible(true); - } else { - $this->docform->contract->setVisible(false); - $this->docform->contract->setValue(0); + if (count($ar) > 0) { + $this->docform->contract->setVisible(true); + } else { + $this->docform->contract->setVisible(false); + $this->docform->contract->setValue(0); } - + } - + //добавление нового контрагента public function addcustOnClick($sender) { $this->editcust->setVisible(true); @@ -488,7 +488,7 @@ public function savecustOnClick($sender) { $cust->save(); $this->docform->customer->setText($cust->customer_name); $this->docform->customer->setKey($cust->customer_id); - $this->OnCustomerFirm(null) ; + $this->OnCustomerFirm(null); $this->editcust->setVisible(false); $this->docform->setVisible(true); } diff --git a/www/app/pages/doc/task.php b/www/app/pages/doc/task.php index 55bd29733..11604be8d 100644 --- a/www/app/pages/doc/task.php +++ b/www/app/pages/doc/task.php @@ -80,7 +80,7 @@ public function __construct($docid = 0, $basedocid = 0, $date = null) { $this->docform->notes->setText($this->_doc->notes); $this->docform->taskhours->setText($this->_doc->headerdata['taskhours']); - + $this->docform->document_date->setDate($this->_doc->document_date); $this->docform->parea->setValue($this->_doc->headerdata['parea']); diff --git a/www/app/pages/firmlist.php b/www/app/pages/firmlist.php index 4145fc8dd..2cb6066d4 100644 --- a/www/app/pages/firmlist.php +++ b/www/app/pages/firmlist.php @@ -5,7 +5,7 @@ use App\Entity\Firm; use App\Helper as H; use Zippy\Html\DataList\DataView; - + use Zippy\Html\Form\Button; use Zippy\Html\Form\CheckBox; use Zippy\Html\Form\Form; @@ -25,7 +25,7 @@ public function __construct() { if (false == \App\ACL::checkShowRef('FirmList')) { return; } - + $this->add(new Panel('firmtable'))->setVisible(true); $this->firmtable->add(new DataView('firmlist', new \ZCL\DB\EntityDataSource('\App\Entity\Firm', '', 'disabled,firm_name'), $this, 'firmlistOnRow'))->Reload(); $this->firmtable->add(new ClickLink('addnew'))->onClick($this, 'addOnClick'); @@ -37,7 +37,11 @@ public function __construct() { $this->firmdetail->add(new TextInput('editphone')); $this->firmdetail->add(new TextInput('editshopname')); $this->firmdetail->add(new CheckBox('editdisabled')); - + $this->firmdetail->add(new TextInput('editbank')); + $this->firmdetail->add(new TextInput('editbankacc')); + $this->firmdetail->add(new TextInput('editlogo')); + $this->firmdetail->add(new TextInput('editstamp')); + $this->firmdetail->add(new TextInput('editsign')); $this->firmdetail->add(new SubmitButton('save'))->onClick($this, 'saveOnClick'); $this->firmdetail->add(new Button('cancel'))->onClick($this, 'cancelOnClick'); } @@ -46,7 +50,7 @@ public function firmlistOnRow($row) { $item = $row->getDataItem(); $row->add(new Label('firm_name', $item->firm_name)); - + $row->add(new ClickLink('edit'))->onClick($this, 'editOnClick'); $row->add(new ClickLink('delete'))->onClick($this, 'deleteOnClick'); } @@ -75,6 +79,13 @@ public function editOnClick($sender) { $this->firmdetail->editaddress->setText($this->_firm->address); $this->firmdetail->editphone->setText($this->_firm->phone); $this->firmdetail->editshopname->setText($this->_firm->shopname); + $this->firmdetail->editbank->setText($this->_firm->bank); + $this->firmdetail->editbankacc->setText($this->_firm->bankacc); + $this->firmdetail->editlogo->setText($this->_firm->logo); + $this->firmdetail->editstamp->setText($this->_firm->stamp); + $this->firmdetail->editsign->setText($this->_firm->sign); + + $this->firmdetail->editdisabled->setChecked($this->_firm->disabled); } @@ -97,12 +108,17 @@ public function saveOnClick($sender) { $this->_firm->address = $this->firmdetail->editaddress->getText(); $this->_firm->phone = $this->firmdetail->editphone->getText(); $this->_firm->shopname = $this->firmdetail->editshopname->getText(); - + $this->_firm->bank = $this->firmdetail->editbank->getText(); + $this->_firm->bankacc = $this->firmdetail->editbankacc->getText(); + $this->_firm->logo = $this->firmdetail->editlogo->getText(); + $this->_firm->stamp = $this->firmdetail->editstamp->getText(); + $this->_firm->sign = $this->firmdetail->editsign->getText(); + if ($this->_firm->firm_name == '') { $this->setError("entername"); return; } - + $this->_firm->disabled = $this->firmdetail->editdisabled->isChecked() ? 1 : 0; $this->_firm->Save(); @@ -116,7 +132,7 @@ public function cancelOnClick($sender) { $this->firmdetail->setVisible(false); } - + } diff --git a/www/app/pages/notifylist.php b/www/app/pages/notifylist.php index 579639809..69b764018 100644 --- a/www/app/pages/notifylist.php +++ b/www/app/pages/notifylist.php @@ -44,7 +44,7 @@ public function OnRow($row) { $row->add(new Label("sender"))->setText($notify->sender_name); $row->add(new Label("msg"))->setText($notify->message, true); - $row->add(new Label("ndate", \App\Helper::fdt( $notify->dateshow))); + $row->add(new Label("ndate", \App\Helper::fdt($notify->dateshow))); $row->add(new Label("newn"))->setVisible($notify->checked == 0); } diff --git a/www/app/pages/options.php b/www/app/pages/options.php index 7a98aa35e..51d4deee9 100644 --- a/www/app/pages/options.php +++ b/www/app/pages/options.php @@ -24,7 +24,7 @@ class Options extends \App\Pages\Base public function __construct() { parent::__construct(); if (System::getUser()->userlogin != 'admin') { - System::setErrorMsg( H::l('onlyadminpage') ); + System::setErrorMsg(H::l('onlyadminpage')); App::RedirectHome(); return false; } @@ -39,7 +39,7 @@ public function __construct() { "2" => H::l('opt_partion') ); $this->common->add(new DropDownChoice('partiontype', $pt, "1")); - + $this->common->add(new CheckBox('autoarticle')); $this->common->add(new CheckBox('usesnumber')); $this->common->add(new CheckBox('useset')); @@ -57,7 +57,7 @@ public function __construct() { $this->common->add(new TextInput('price4')); $this->common->add(new TextInput('price5')); $this->common->add(new TextInput('defprice')); - + $common = System::getOptions("common"); if (!is_array($common)) { $common = array(); @@ -68,14 +68,14 @@ public function __construct() { $this->common->dateformat->setValue($common['dateformat']); $this->common->partiontype->setValue($common['partiontype']); $this->common->curr->setValue($common['curr']); - + $this->common->price1->setText($common['price1']); $this->common->price2->setText($common['price2']); $this->common->price3->setText($common['price3']); $this->common->price4->setText($common['price4']); $this->common->price5->setText($common['price5']); $this->common->defprice->setText($common['defprice']); - + $this->common->autoarticle->setChecked($common['autoarticle']); $this->common->useset->setChecked($common['useset']); @@ -88,7 +88,7 @@ public function __construct() { $this->common->allowminus->setChecked($common['allowminus']); $this->common->capcha->setChecked($common['capcha']); $this->common->useval->setChecked($common['useval']); - + $this->add(new Form('firm'))->onSubmit($this, 'saveFirmOnClick'); $this->firm->add(new TextInput('firmname')); $this->firm->add(new TextInput('shopname')); @@ -117,24 +117,24 @@ public function __construct() { $this->firm->logo->setText($firm['logo']); $this->firm->stamp->setText($firm['stamp']); $this->firm->sign->setText($firm['sign']); - + $this->add(new Form('valform'))->onSubmit($this, 'saveValOnClick'); $this->valform->add(new TextInput('valuan')); $this->valform->add(new TextInput('valusd')); $this->valform->add(new TextInput('valeuro')); $this->valform->add(new TextInput('valrub')); - $this->valform->add(new CheckBox('valprice')); - + $this->valform->add(new CheckBox('valprice')); + $val = System::getOptions("val"); if (!is_array($val)) { $val = array(); - } + } $this->valform->valuan->setText($val['valuan']); $this->valform->valusd->setText($val['valusd']); $this->valform->valeuro->setText($val['valeuro']); $this->valform->valrub->setText($val['valrub']); $this->valform->valprice->setChecked($val['valprice']); - + $this->add(new Form('printer'))->onSubmit($this, 'savePrinterOnClick'); $this->printer->add(new TextInput('pwidth')); $this->printer->add(new DropDownChoice('pricetype', \App\Entity\Item::getPriceTypeList())); @@ -143,7 +143,7 @@ public function __construct() { $this->printer->add(new CheckBox('pcode')); $this->printer->add(new CheckBox('pbarcode')); $this->printer->add(new CheckBox('pprice')); - + $printer = System::getOptions("printer"); if (!is_array($printer)) { $printer = array(); @@ -178,7 +178,7 @@ public function __construct() { $this->editpan->editform->add(new TextInput('edit_menugroup')); $this->editpan->editform->add(new CheckBox('edit_disabled')); - + $this->editpan->editform->add(new DropDownChoice('edit_meta_type', \App\Entity\MetaData::getNames())); $this->editpan->add(new ClickLink('mcancel'))->onClick($this, 'mcancelOnClick'); } @@ -214,9 +214,9 @@ public function saveCommonOnClick($sender) { System::setOptions("common", $common); - + $this->_tvars["useval"] = $common['useval'] == 1; - + $this->setSuccess('saved'); System::setCache('labels', null); } @@ -238,15 +238,15 @@ public function saveFirmOnClick($sender) { System::setOptions("firm", $firm); $this->setSuccess('saved'); } - + public function saveValOnClick($sender) { $val = array(); - $val['valuan'] = $this->valform->valuan->getText(); - $val['valusd'] = $this->valform->valusd->getText(); - $val['valeuro'] = $this->valform->valeuro->getText(); - $val['valrub'] = $this->valform->valrub->getText(); - $val['valprice'] = $this->valform->valprice->isChecked() ?1:0; - + $val['valuan'] = $this->valform->valuan->getText(); + $val['valusd'] = $this->valform->valusd->getText(); + $val['valeuro'] = $this->valform->valeuro->getText(); + $val['valrub'] = $this->valform->valrub->getText(); + $val['valprice'] = $this->valform->valprice->isChecked() ? 1 : 0; + System::setOptions("val", $val); $this->setSuccess('saved'); } diff --git a/www/app/pages/reference/contractlist.php b/www/app/pages/reference/contractlist.php index afaec84f4..7678e96e4 100644 --- a/www/app/pages/reference/contractlist.php +++ b/www/app/pages/reference/contractlist.php @@ -34,7 +34,7 @@ public function __construct() { $this->filter->add(new CheckBox('showdis')); $this->filter->add(new TextInput('searchkey')); $this->filter->add(new AutocompleteTextInput('searchcust'))->onText($this, 'OnAutoCustomer'); - $this->filter->add(new DropDownChoice('searchcomp',Firm::findArray('firm_name','disabled<>1','firm_name'),0)); + $this->filter->add(new DropDownChoice('searchcomp', Firm::findArray('firm_name', 'disabled<>1', 'firm_name'), 0)); $this->add(new Panel('contracttable'))->setVisible(true); $this->contracttable->add(new DataView('contractlist', new ContractDataSource($this), $this, 'contractlistOnRow'))->Reload(); @@ -43,14 +43,14 @@ public function __construct() { $this->contracttable->add(new \Zippy\Html\DataList\Paginator('pag', $this->contracttable->contractlist)); $this->add(new Form('contractdetail'))->setVisible(false); - $this->contractdetail->add(new Date('editcreatedon',time())); + $this->contractdetail->add(new Date('editcreatedon', time())); $this->contractdetail->add(new TextInput('editshortdesc')); $this->contractdetail->add(new TextInput('editcontract_number')); $this->contractdetail->add(new AutocompleteTextInput('editcust'))->onText($this, 'OnAutoCustomer'); - $this->contractdetail->add(new DropDownChoice('editcomp',Firm::findArray('firm_name','disabled<>1','firm_name'),0)); - $this->contractdetail->add(new DropDownChoice('editpay',Contract::PayList() ,0)); + $this->contractdetail->add(new DropDownChoice('editcomp', Firm::findArray('firm_name', 'disabled<>1', 'firm_name'), 0)); + $this->contractdetail->add(new DropDownChoice('editpay', Contract::PayList(), 0)); $this->contractdetail->add(new \Zippy\Html\Form\File('scan')); - + $this->contractdetail->add(new CheckBox('editdisabled')); $this->contractdetail->add(new SubmitButton('save'))->onClick($this, 'saveOnClick'); @@ -66,14 +66,14 @@ public function contractlistOnRow($row) { $row->add(new Label('customer', $item->customer_name)); $row->add(new Label('firm', $item->firm_name)); $row->add(new Label('payname', $item->payname)); - + $row->add(new \Zippy\Html\Link\BookmarkableLink('scanlink'))->setVisible(false); - if($item->file_id>0) { + if ($item->file_id > 0) { $row->scanlink->setVisible(true); $row->scanlink->setLink(_BASEURL . 'loadfile.php?id=' . $item->file_id); - + } - + $row->add(new ClickLink('edit'))->onClick($this, 'editOnClick'); $row->add(new ClickLink('delete'))->onClick($this, 'deleteOnClick'); } @@ -105,7 +105,7 @@ public function editOnClick($sender) { $this->contractdetail->editcust->setText($this->_contract->customer_name); $this->contractdetail->editcomp->setValue($this->_contract->firm_id); $this->contractdetail->editpay->setValue($this->_contract->pay); - + } public function addOnClick($sender) { @@ -122,7 +122,7 @@ public function saveOnClick($sender) { if (false == \App\ACL::checkEditRef('ContractList')) { return; } - + $this->_contract->contract_number = $this->contractdetail->editcontract_number->getText(); if ($this->_contract->contract_number == '') { $this->setError("notnumber"); @@ -133,23 +133,23 @@ public function saveOnClick($sender) { $this->setError("noselcust"); return; } - - $this->_contract->createdon = $this->contractdetail->editcreatedon->getDate(); - $this->_contract->shortdesc = $this->contractdetail->editshortdesc->getText(); + + $this->_contract->createdon = $this->contractdetail->editcreatedon->getDate(); + $this->_contract->shortdesc = $this->contractdetail->editshortdesc->getText(); $this->_contract->firm_id = $this->contractdetail->editcomp->getValue(); $this->_contract->pay = $this->contractdetail->editpay->getValue(); $this->_contract->payname = $this->contractdetail->editpay->getValueName(); $this->_contract->disabled = $this->contractdetail->editdisabled->isChecked() ? 1 : 0; $this->_contract->save(); - + $file = $this->contractdetail->scan->getFile(); if ($file['size'] > 0) { $this->_contract->file_id = H::addFile($file, $this->_contract->contract_id, 'Скан ', \App\Entity\Message::TYPE_CONTRACT); $this->_contract->save(); } - - + + $this->contractdetail->setVisible(false); $this->contracttable->setVisible(true); $this->contracttable->contractlist->Reload(false); @@ -163,7 +163,7 @@ public function cancelOnClick($sender) { public function OnFilter($sender) { $this->contracttable->contractlist->Reload(); } - + public function OnAutoCustomer($sender) { $text = Customer::qstr('%' . $sender->getText() . '%'); return Customer::findArray("customer_name", "status=0 and (customer_name like {$text} or phone like {$text} )"); @@ -190,12 +190,12 @@ private function getWhere() { if ($cust > 0) { - $where = $where . " and customer_id = ". $cust; + $where = $where . " and customer_id = " . $cust; } $comp = $form->searchcomp->getValue(); if ($comp > 0) { - $where = $where . " and firm_id = ". $comp; + $where = $where . " and firm_id = " . $comp; } if ($showdis > 0) { diff --git a/www/app/pages/reference/customerlist.php b/www/app/pages/reference/customerlist.php index 9745be291..2c8df9de3 100644 --- a/www/app/pages/reference/customerlist.php +++ b/www/app/pages/reference/customerlist.php @@ -180,7 +180,7 @@ public function addOnClick($sender) { $this->customerdetail->clean(); $this->_customer = new Customer(); - $this->contentview->setVisible(false); + $this->contentview->setVisible(false); } public function saveOnClick($sender) { @@ -314,7 +314,7 @@ public function OnMsgSubmit($sender) { //список комментариев private function updateMessages() { - $this->_msglist = \App\Entity\Message::find('item_type = 2 and item_id=' . $this->_customer->customer_id,'message_id'); + $this->_msglist = \App\Entity\Message::find('item_type = 2 and item_id=' . $this->_customer->customer_id, 'message_id'); $this->contentview->dw_msglist->Reload(); } @@ -322,8 +322,8 @@ private function updateMessages() { public function msgListOnRow($row) { $item = $row->getDataItem(); - $row->add(new Label("msgdata",nl2br($item->message))); - $row->add(new Label("msgdate", \App\Helper::fdt( $item->created))); + $row->add(new Label("msgdata", nl2br($item->message))); + $row->add(new Label("msgdate", \App\Helper::fdt($item->created))); $row->add(new Label("msguser", $item->username)); $row->add(new ClickLink('delmsg'))->onClick($this, 'deleteMsgOnClick'); @@ -381,7 +381,7 @@ public function eventListOnRow($row) { $row->add(new Label('eventtitle', $event->title)); $row->add(new Label("eventdesc"))->setText($event->description); - $row->add(new Label("eventdate", \App\Helper::fdt( $event->eventdate))); + $row->add(new Label("eventdate", \App\Helper::fdt($event->eventdate))); $row->add(new ClickLink('delevent'))->onClick($this, 'deleteEventOnClick'); } @@ -394,7 +394,5 @@ public function deleteEventOnClick($sender) { $this->customertable->customerlist->Reload(false); } - - - + } diff --git a/www/app/pages/reference/employeelist.php b/www/app/pages/reference/employeelist.php index c5bd7ceb0..3577b3187 100644 --- a/www/app/pages/reference/employeelist.php +++ b/www/app/pages/reference/employeelist.php @@ -112,7 +112,7 @@ public function saveOnClick($sender) { $login = trim($this->employeedetail->editlogin->getText()); if (strlen($login) > 0) { - + $_emp = Employee::getFirst("login = '{$login}'"); if ($_emp != null && $_emp->employee_id != $this->_employee->employee_id) { $this->setError('assignedlogin', $_emp->emp_name()); diff --git a/www/app/pages/reference/itemlist.php b/www/app/pages/reference/itemlist.php index c85672b97..e2096c08d 100644 --- a/www/app/pages/reference/itemlist.php +++ b/www/app/pages/reference/itemlist.php @@ -150,19 +150,19 @@ public function itemlistOnRow($row) { $plist[] = H::fa($item->price5); } $row->add(new Label('price', implode(', ', $plist))); - $row->add(new Label('hasnotes'))->setVisible(strlen($item->description) > 0) ; + $row->add(new Label('hasnotes'))->setVisible(strlen($item->description) > 0); $row->hasnotes->setAttribute('title', htmlspecialchars_decode($item->description)); $row->setAttribute('style', $item->disabled == 1 ? 'color: #aaa' : null); - - + + $row->add(new Label('cell', $item->cell)); - $row->add(new Label('inprice' ))->setVisible($item->pricelist); - $row->add(new Label('inseria' ))->setVisible($item->useserial); + $row->add(new Label('inprice'))->setVisible($item->pricelist); + $row->add(new Label('inseria'))->setVisible($item->useserial); $row->add(new ClickLink('edit'))->onClick($this, 'editOnClick'); $row->add(new ClickLink('delete'))->onClick($this, 'deleteOnClick'); $row->add(new ClickLink('set'))->onClick($this, 'setOnClick'); - + $row->add(new ClickLink('print'))->onClick($this, 'printOnClick', true); $row->add(new \Zippy\Html\Link\BookmarkableLink('imagelistitem'))->setValue("/loadimage.php?id={$item->image_id}"); @@ -226,12 +226,12 @@ public function editOnClick($sender) { $this->itemdetail->editdelimage->setVisible(false); $this->itemdetail->editimage->setVisible(false); } - + $this->itemtable->itemlist->setSelectedRow($sender->getOwner()); $this->itemtable->itemlist->Reload(false); - - - $this->updateman() ; + + + $this->updateman(); } public function addOnClick($sender) { @@ -248,7 +248,7 @@ public function addOnClick($sender) { if (System::getOption("common", "autoarticle") == 1) { $this->itemdetail->editcode->setText(Item::getNextArticle()); } - $this->updateman() ; + $this->updateman(); } public function cancelOnClick($sender) { @@ -473,15 +473,15 @@ public function printOnClick($sender) { $this->updateAjax(array(), " $('#tag').html('{$html}') ; $('#pform').modal()"); } - public function updateman(){ + public function updateman() { $this->_tvars['manlist'] = array(); - - foreach(Item::getManufacturers() as $man){ - $this->_tvars['manlist'][] = array('mitem'=>$man) ; + + foreach (Item::getManufacturers() as $man) { + $this->_tvars['manlist'][] = array('mitem' => $man); } - - } - + + } + } class ItemDataSource implements \Zippy\Interfaces\DataSource @@ -538,6 +538,5 @@ public function getItem($id) { return Item::load($id); } - - + } diff --git a/www/app/pages/register/doclist.php b/www/app/pages/register/doclist.php index 59b2587e6..8b26b5bf0 100644 --- a/www/app/pages/register/doclist.php +++ b/www/app/pages/register/doclist.php @@ -147,7 +147,7 @@ public function doclistOnRow($row) { $row->add(new Label('cust', $doc->customer_name)); $row->add(new Label('branch', $doc->branch_name)); - $row->add(new Label('date', H::fd( $doc->document_date))); + $row->add(new Label('date', H::fd($doc->document_date))); $row->add(new Label('amount', H::fa(($doc->payamount > 0) ? $doc->payamount : ($doc->amount > 0 ? $doc->amount : "")))); $row->add(new Label('state', Document::getStateName($doc->state))); @@ -161,7 +161,7 @@ public function doclistOnRow($row) { $row->add(new Label('hasnotes'))->setVisible(strlen($doc->notes) > 0 && $doc->notes == strip_tags($doc->notes)); $row->hasnotes->setAttribute('title', $doc->notes); - + $row->add(new ClickLink('parentdoc', $this, 'basedOnClick'))->setVisible($doc->parent_id > 0); $row->parentdoc->setValue($doc->headerdata['parent_number']); diff --git a/www/app/pages/register/gilist.php b/www/app/pages/register/gilist.php index ef94eef2e..9f259cf45 100644 --- a/www/app/pages/register/gilist.php +++ b/www/app/pages/register/gilist.php @@ -44,7 +44,7 @@ public function __construct() { $this->filter->add(new TextInput('searchnumber')); $this->filter->add(new TextInput('searchtext')); $this->filter->add(new DropDownChoice('status', array(0 => 'Открытые', 1 => 'Новые', 2 => 'Отправленые', 4 => 'Неоплаченные', 3 => 'Все'), 0)); - $this->filter->add(new DropDownChoice('searchcomp',Firm::findArray('firm_name','disabled<>1','firm_name'),0)); + $this->filter->add(new DropDownChoice('searchcomp', Firm::findArray('firm_name', 'disabled<>1', 'firm_name'), 0)); $doclist = $this->add(new DataView('doclist', new GoodsIssueDataSource($this), $this, 'doclistOnRow')); @@ -112,7 +112,7 @@ public function statusOnSubmit($sender) { if ($sender->id == "bsend") { $dec = $this->statuspan->statusform->ship_number->getText(); - $this->_doc->headerdata['sentdate'] = H::fd( time()); + $this->_doc->headerdata['sentdate'] = H::fd(time()); if (strlen($dec) > 0) { $this->_doc->headerdata['ship_number'] = $dec; } @@ -267,7 +267,7 @@ public function oncsv($sender) { $csv = ""; foreach ($list as $d) { - $csv .= H::fd( $d->document_date) . ';'; + $csv .= H::fd($d->document_date) . ';'; $csv .= $d->document_number . ';'; $csv .= $d->headerdata['order'] . ';'; $csv .= $d->customer_name . ';'; @@ -325,7 +325,7 @@ private function getWhere() { } $comp = $this->page->filter->searchcomp->getValue(); if ($comp > 0) { - $where = $where . " and firm_id = ". $comp; + $where = $where . " and firm_id = " . $comp; } diff --git a/www/app/pages/register/grlist.php b/www/app/pages/register/grlist.php index 98f73a1ce..96b459199 100644 --- a/www/app/pages/register/grlist.php +++ b/www/app/pages/register/grlist.php @@ -44,7 +44,7 @@ public function __construct() { $this->filter->add(new TextInput('searchnumber')); $this->filter->add(new TextInput('searchtext')); $this->filter->add(new DropDownChoice('status', array(0 => 'Все', 1 => 'Не проведенные', 2 => 'Неоплаченые'), 0)); - $this->filter->add(new DropDownChoice('searchcomp',Firm::findArray('firm_name','disabled<>1','firm_name'),0)); + $this->filter->add(new DropDownChoice('searchcomp', Firm::findArray('firm_name', 'disabled<>1', 'firm_name'), 0)); $doclist = $this->add(new DataView('doclist', new GoodsReceiptDataSource($this), $this, 'doclistOnRow')); @@ -81,7 +81,7 @@ public function doclistOnRow($row) { $row->add(new Label('number', $doc->document_number)); - $row->add(new Label('date', H::fd( $doc->document_date))); + $row->add(new Label('date', H::fd($doc->document_date))); $row->add(new Label('onotes', $doc->notes)); $row->add(new Label('amount', H::fa(($doc->payamount > 0) ? $doc->payamount : ($doc->amount > 0 ? $doc->amount : "")))); @@ -179,7 +179,7 @@ public function oncsv($sender) { $csv = ""; foreach ($list as $d) { - $csv .= H::fd( $d->document_date) . ';'; + $csv .= H::fd($d->document_date) . ';'; $csv .= $d->document_number . ';'; $csv .= $d->customer_name . ';'; $csv .= $d->amount . ';'; @@ -232,7 +232,7 @@ private function getWhere() { $comp = $this->page->filter->searchcomp->getValue(); if ($comp > 0) { - $where = $where . " and firm_id = ". $comp; + $where = $where . " and firm_id = " . $comp; } $st = trim($this->page->filter->searchtext->getText()); diff --git a/www/app/pages/register/itemlist.php b/www/app/pages/register/itemlist.php index d11f47b82..8715e724c 100644 --- a/www/app/pages/register/itemlist.php +++ b/www/app/pages/register/itemlist.php @@ -27,7 +27,7 @@ public function __construct() { } $this->add(new Form('filter'))->onSubmit($this, 'OnFilter'); - $this->filter->add(new TextInput('searchkey')) ; + $this->filter->add(new TextInput('searchkey')); $this->filter->add(new DropDownChoice('searchcat', Category::findArray("cat_name", "", "cat_name"), 0)); $this->filter->add(new DropDownChoice('searchstore', Store::getList(), 0)); @@ -148,7 +148,7 @@ public function detailistOnRow($row) { if (strlen($stock->snumber) > 0 && strlen($stock->sdate) > 0) { - $row->sdate->setText(H::fd( $stock->sdate)); + $row->sdate->setText(H::fd($stock->sdate)); } $row->add(new Label('partion', H::fa($stock->partion))); @@ -254,7 +254,7 @@ public function OnMove($sender) { $doc->headerdata['storename'] = $store->storename; $doc->headerdata['fromquantity'] = $qty; $doc->headerdata['toquantity'] = $qty; - $doc->notes = H::l('partmove'); + $doc->notes = H::l('partmove'); $doc->save(); $doc->updateStatus(\App\Entity\Doc\Document::STATE_NEW); $doc->updateStatus(\App\Entity\Doc\Document::STATE_EXECUTED); diff --git a/www/app/pages/register/ordercustlist.php b/www/app/pages/register/ordercustlist.php index 8c9c4419d..72040a740 100644 --- a/www/app/pages/register/ordercustlist.php +++ b/www/app/pages/register/ordercustlist.php @@ -84,7 +84,7 @@ public function doclistOnRow($row) { $row->add(new Label('number', $doc->document_number)); - $row->add(new Label('date', H::fd( $doc->document_date))); + $row->add(new Label('date', H::fd($doc->document_date))); $row->add(new Label('onotes', $doc->notes)); $row->add(new Label('customer', $doc->customer_name)); $row->add(new Label('amount', H::fa($doc->amount))); @@ -257,7 +257,7 @@ public function oncsv($sender) { $csv = ""; foreach ($list as $d) { - $csv .= H::fd( $d->document_date) . ';'; + $csv .= H::fd($d->document_date) . ';'; $csv .= $d->document_number . ';'; $csv .= $d->customer_name . ';'; $csv .= $d->amount . ';'; diff --git a/www/app/pages/register/orderlist.php b/www/app/pages/register/orderlist.php index a05b16498..54892db56 100644 --- a/www/app/pages/register/orderlist.php +++ b/www/app/pages/register/orderlist.php @@ -78,7 +78,7 @@ public function doclistOnRow($row) { $row->add(new Label('number', $doc->document_number)); - $row->add(new Label('date', H::fd( $doc->document_date))); + $row->add(new Label('date', H::fd($doc->document_date))); $row->add(new Label('onotes', $doc->notes)); $row->add(new Label('customer', $doc->customer_name)); $row->add(new Label('amount', H::fa($doc->amount))); @@ -244,7 +244,7 @@ public function oncsv($sender) { $csv = ""; foreach ($list as $d) { - $csv .= H::fd( $d->document_date) . ';'; + $csv .= H::fd($d->document_date) . ';'; $csv .= $d->document_number . ';'; $csv .= $d->customer_name . ';'; $csv .= $d->amount . ';'; diff --git a/www/app/pages/register/paycustlist.php b/www/app/pages/register/paycustlist.php index a37411701..c82799b1b 100644 --- a/www/app/pages/register/paycustlist.php +++ b/www/app/pages/register/paycustlist.php @@ -137,7 +137,7 @@ public function doclistOnRow($row) { $row->add(new Label('name', $doc->meta_desc)); $row->add(new Label('number', $doc->document_number)); - $row->add(new Label('date', H::fd( $doc->document_date))); + $row->add(new Label('date', H::fd($doc->document_date))); $row->add(new Label('amount', H::fa(($doc->payamount > 0) ? $doc->payamount : ($doc->amount > 0 ? $doc->amount : "")))); @@ -200,7 +200,7 @@ public function payOnRow($row) { $pay = $row->getDataItem(); $row->add(new Label('plamount', H::fa($pay->amount))); $row->add(new Label('pluser', $pay->username)); - $row->add(new Label('pldate', H::fd( $pay->paydate))); + $row->add(new Label('pldate', H::fd($pay->paydate))); $row->add(new Label('plmft', $pay->mf_name)); $row->add(new Label('plcomment', $pay->notes)); } @@ -259,7 +259,7 @@ public function oncsv($sender) { foreach ($list as $d) { - $csv .= H::fd( $d->document_date) . ';'; + $csv .= H::fd($d->document_date) . ';'; $csv .= $d->document_number . ';'; $csv .= H::fa($d->amount) . ';'; diff --git a/www/app/pages/register/paylist.php b/www/app/pages/register/paylist.php index 1bdea316c..bc460ebb9 100644 --- a/www/app/pages/register/paylist.php +++ b/www/app/pages/register/paylist.php @@ -82,7 +82,7 @@ public function doclistOnRow($row) { $row->add(new Label('number', $doc->document_number)); - $row->add(new Label('date', H::fd( $doc->paydate))); + $row->add(new Label('date', H::fd($doc->paydate))); $row->add(new Label('notes', $doc->notes)); $row->add(new Label('amountp', H::fa($doc->amount > 0 ? $doc->amount : ""))); $row->add(new Label('amountm', H::fa($doc->amount < 0 ? 0 - $doc->amount : ""))); @@ -147,7 +147,7 @@ public function oncsv($sender) { foreach ($list as $doc) { - $csv .= H::fd( strtotime($doc->paydate)) . ';'; + $csv .= H::fd(strtotime($doc->paydate)) . ';'; $csv .= $doc->mf_name . ';'; $csv .= ($doc->amount > 0 ? $doc->amount : "") . ';'; $csv .= ($doc->amount < 0 ? 0 - $doc->amount : "") . ';'; diff --git a/www/app/pages/register/serlist.php b/www/app/pages/register/serlist.php index 41d481a37..200cf6f36 100644 --- a/www/app/pages/register/serlist.php +++ b/www/app/pages/register/serlist.php @@ -82,7 +82,7 @@ public function doclistOnRow($row) { $row->add(new Label('number', $doc->document_number)); - $row->add(new Label('date', H::fd( $doc->document_date))); + $row->add(new Label('date', H::fd($doc->document_date))); $row->add(new Label('onotes', $doc->notes)); $row->add(new Label('amount', H::fa($doc->amount))); @@ -216,7 +216,7 @@ public function oncsv($sender) { $csv = ""; foreach ($list as $d) { - $csv .= H::fd( $d->document_date) . ';'; + $csv .= H::fd($d->document_date) . ';'; $csv .= $d->document_number . ';'; $csv .= $d->customer_name . ';'; diff --git a/www/app/pages/register/stocklist.php b/www/app/pages/register/stocklist.php index ea61754ad..3b1d56529 100644 --- a/www/app/pages/register/stocklist.php +++ b/www/app/pages/register/stocklist.php @@ -65,7 +65,7 @@ public function doclistOnRow($row) { $doc = $row->getDataItem(); - $row->add(new Label('date', H::fd( $doc->document_date))); + $row->add(new Label('date', H::fd($doc->document_date))); $row->add(new Label('partion', H::fa($doc->partion))); $row->add(new Label('qty', H::fqty($doc->quantity))); diff --git a/www/app/pages/register/tasklist.php b/www/app/pages/register/tasklist.php index fe6ce0aed..48c9d6fb7 100644 --- a/www/app/pages/register/tasklist.php +++ b/www/app/pages/register/tasklist.php @@ -81,7 +81,7 @@ public function tasklistOnRow($row) { $row->add(new Label('tasknumber', $task->document_number)); $row->add(new Label('taskdesc', $task->notes)); - $row->add(new Label('taskdocument_date', H::fd( $task->document_date)) ); + $row->add(new Label('taskdocument_date', H::fd($task->document_date))); $row->add(new Label('taskhours', $task->headerdata['taskhours'])); $row->add(new Label('taskstatus', Document::getStateName($task->state))); @@ -255,7 +255,7 @@ public function updateCal() { $items = $this->_taskds->getItems(); foreach ($items as $item) { - $col= "#aaa"; + $col = "#aaa"; if ($item->state == Document::STATE_INPROCESS) { $col = "#28a745"; } @@ -265,10 +265,12 @@ public function updateCal() { if ($item->state == Document::STATE_CLOSED) { $col = "#dddddd"; } - if(strlen($item->headerdata['taskhours'])==0) $item->headerdata['taskhours'] =0; + if (strlen($item->headerdata['taskhours']) == 0) { + $item->headerdata['taskhours'] = 0; + } $d = floor($item->headerdata['taskhours'] / 8); - $end_date = $item->document_date + (3600*24*$d); - + $end_date = $item->document_date + (3600 * 24 * $d); + $tasks[] = new \App\CEvent($item->document_id, $item->document_number, $item->document_date, $end_date, $col); } @@ -316,7 +318,7 @@ public function OnCal($sender, $action) { $task = Document::load($action['id']); $task->hours = $task->hours + ($action['delta'] / 3600); $task->end_date = $task->end_date + ($action['delta'] / 3600); - + if ($task->state == Document::STATE_CLOSED) { return; @@ -341,7 +343,7 @@ public function oncsv($sender) { $csv .= $task->document_number . ','; $csv .= str_replace(',', '', $task->notes) . ';'; - $csv .= H::fdt( $task->document_date) . ';'; + $csv .= H::fdt($task->document_date) . ';'; $csv .= $task->headerdata['taskhours'] . ';'; $csv .= Document::getStateName($task->state) . ';'; $csv .= $task->amount . ';'; diff --git a/www/app/pages/report/abc.php b/www/app/pages/report/abc.php index 99d8bb9c7..6a3a38810 100644 --- a/www/app/pages/report/abc.php +++ b/www/app/pages/report/abc.php @@ -115,9 +115,9 @@ private function generateReport() { } - $header = array('from' => \App\Helper::fd( $from), + $header = array('from' => \App\Helper::fd($from), "_detail" => $detail, - 'to' => \App\Helper::fd( $to), + 'to' => \App\Helper::fd($to), "type" => $this->typelist[$type], 'totala' => $totala, 'totalb' => $totalb, diff --git a/www/app/pages/report/custactivity.php b/www/app/pages/report/custactivity.php index 9fa45e644..3b110b31d 100644 --- a/www/app/pages/report/custactivity.php +++ b/www/app/pages/report/custactivity.php @@ -13,7 +13,7 @@ use Zippy\Html\Panel; use Zippy\Html\Form\AutocompleteTextInput; -/** +/** * Движение по контрагентам */ class CustActivity extends \App\Pages\Base @@ -31,8 +31,6 @@ public function __construct() { $this->filter->add(new AutocompleteTextInput('cust'))->onText($this, 'OnAutoCustomer'); - - $this->add(new \Zippy\Html\Link\ClickLink('autoclick'))->onClick($this, 'OnAutoLoad', true); @@ -40,16 +38,16 @@ public function __construct() { $this->detail->add(new \Zippy\Html\Link\BookmarkableLink('print', "")); $this->detail->add(new RedirectLink('excel', "custreport")); - - + + $this->detail->add(new RedirectLink('pdf', "custreport")); $this->detail->add(new Label('preview')); \App\Session::getSession()->issubmit = false; } public function OnSubmit($sender) { - if($this->filter->cust->getKey()==0) { - $this->setError(H::l('noselcust')) ; + if ($this->filter->cust->getKey() == 0) { + $this->setError(H::l('noselcust')); return; } @@ -119,28 +117,28 @@ private function generateReport() { $detail[] = array( - "date" => \App\Helper::fd( strtotime($row['dt'])), + "date" => \App\Helper::fd(strtotime($row['dt'])), + - "document_number" => $row['document_number'], "obin" => H::fa($row['obin']), - "obout" => H::fa($row['obout']) - + "obout" => H::fa($row['obout']) + ); - + $tin += $row['obin']; $tout += $row['obout']; } $tb = $tend - $tin + $tout; - $header = array('datefrom' => \App\Helper::fd( $from), + $header = array('datefrom' => \App\Helper::fd($from), "_detail" => $detail, - + 'tin' => H::fa($tin), 'tout' => H::fa($tout), - - 'datefrom' => \App\Helper::fd( $from), - 'dateto' => \App\Helper::fd( $to), + + 'datefrom' => \App\Helper::fd($from), + 'dateto' => \App\Helper::fd($to), "cust_name" => $this->filter->cust->getText() ); $report = new \App\Report('report/custactivity.tpl'); @@ -165,11 +163,11 @@ public function beforeRender() { App::addJavaScript("\$('#autoclick').click()", true); } - + public function OnAutoCustomer($sender) { $text = Customer::qstr('%' . $sender->getText() . '%'); return Customer::findArray("customer_name", "status=0 and (customer_name like {$text} or phone like {$text} )"); } - + } diff --git a/www/app/pages/report/custorder.php b/www/app/pages/report/custorder.php index 470d3db04..2515ca9cd 100644 --- a/www/app/pages/report/custorder.php +++ b/www/app/pages/report/custorder.php @@ -100,7 +100,7 @@ private function generateReport() { "_detail" => $detail, 'total' => H::fa($total), 'cust' => $cust > 0, - 'date' => \App\Helper::fd( time()), + 'date' => \App\Helper::fd(time()), 'customer_name' => $this->filter->cust->getValueName() ); $report = new \App\Report('report/custorder.tpl'); diff --git a/www/app/pages/report/emptask.php b/www/app/pages/report/emptask.php index a68a7e1de..41f123ad6 100644 --- a/www/app/pages/report/emptask.php +++ b/www/app/pages/report/emptask.php @@ -121,9 +121,9 @@ private function generateReport() { } } - $header = array('datefrom' => \App\Helper::fd( $from), + $header = array('datefrom' => \App\Helper::fd($from), "_detail" => $detail, - 'dateto' => \App\Helper::fd( $to) + 'dateto' => \App\Helper::fd($to) ); $report = new \App\Report('report/emptask.tpl'); diff --git a/www/app/pages/report/income.php b/www/app/pages/report/income.php index fd47ceb48..db886def1 100644 --- a/www/app/pages/report/income.php +++ b/www/app/pages/report/income.php @@ -27,7 +27,7 @@ public function __construct() { $this->add(new Form('filter'))->onSubmit($this, 'OnSubmit'); $this->filter->add(new Date('from', time() - (7 * 24 * 3600))); $this->filter->add(new Date('to', time())); - $this->filter->add(new DropDownChoice('type', array(1 => H::l('repbyitems'), 2 =>H::l('repbysellers') , 3 => H::l('repbydates'), 1)); + $this->filter->add(new DropDownChoice('type', array(1 => H::l('repbyitems'), 2 => H::l('repbysellers'), 3 => H::l('repbydates'), 1)); $this->add(new Panel('detail'))->setVisible(false); @@ -138,15 +138,15 @@ private function generateReport() { $detail[] = array( "code" => $row['item_code'], "name" => $row['itemname'], - "dt" => date\App\Helper::fd( strtotime($row['dt'])), + "dt" => date\App\Helper::fd(strtotime($row['dt'])), "qty" => H::fqty($row['qty']), "summa" => H::fa($row['summa']) ); } - $header = array('datefrom' => \App\Helper::fd( $from), + $header = array('datefrom' => \App\Helper::fd($from), "_detail" => $detail, - 'dateto' => \App\Helper::fd( $to) + 'dateto' => \App\Helper::fd($to) ); if ($type == 1) { $header['_type1'] = true; diff --git a/www/app/pages/report/itemactivity.php b/www/app/pages/report/itemactivity.php index cf5df7ccb..b50ceb484 100644 --- a/www/app/pages/report/itemactivity.php +++ b/www/app/pages/report/itemactivity.php @@ -178,7 +178,7 @@ private function generateReport() { $detail[] = array( "code" => $row['item_code'], "name" => $row['itemname'], - "date" => \App\Helper::fd( strtotime($row['dt'])), + "date" => \App\Helper::fd(strtotime($row['dt'])), "documents" => $row['docs'], "in" => H::fqty(strlen($row['begin_quantity']) > 0 ? $row['begin_quantity'] : 0), "obin" => H::fqty($row['obin']), @@ -190,9 +190,9 @@ private function generateReport() { $baout = $baout + $row['oboutamount']; } - $header = array('datefrom' => \App\Helper::fd( $from), + $header = array('datefrom' => \App\Helper::fd($from), "_detail" => $detail, - 'dateto' => \App\Helper::fd( $to), + 'dateto' => \App\Helper::fd($to), "store" => Store::load($storeid)->storename ); $header['ba'] = H::fa($ba); diff --git a/www/app/pages/report/outcome.php b/www/app/pages/report/outcome.php index b3ee67b1b..69a4e03a0 100644 --- a/www/app/pages/report/outcome.php +++ b/www/app/pages/report/outcome.php @@ -26,7 +26,7 @@ public function __construct() { $this->add(new Form('filter'))->onSubmit($this, 'OnSubmit'); $this->filter->add(new Date('from', time() - (7 * 24 * 3600))); $this->filter->add(new Date('to', time())); - $this->filter->add(new DropDownChoice('type', array(1 => H::l('repbyitems'),5 =>H::l('repbycat') , 2 =>H::l('repbybyers') , 3 => H::l('repbydates') , 4 => H::l('repbyservices') ), 1))->onChange($this,"OnType"); + $this->filter->add(new DropDownChoice('type', array(1 => H::l('repbyitems'), 5 => H::l('repbycat'), 2 => H::l('repbybyers'), 3 => H::l('repbydates'), 4 => H::l('repbyservices')), 1))->onChange($this, "OnType"); $this->filter->add(new DropDownChoice('emp', \App\Entity\User::findArray('username', "user_id in (select user_id from documents_view where meta_name in('GoodsIssue','ServiceAct','Task','Order','POSCheck'))", 'username'), 0)); $this->filter->add(new DropDownChoice('cat', \App\Entity\Category::findArray('cat_name', "", 'cat_name'), 0))->setVisible(false); @@ -39,14 +39,15 @@ public function __construct() { } public function OnType($sender) { - $type = $this->filter->type->getValue(); - $this->filter->cat->setValue(0) ; - if($type==5) { - $this->filter->cat->setVisible(true); - } else { - $this->filter->cat->setVisible(false); - } + $type = $this->filter->type->getValue(); + $this->filter->cat->setValue(0); + if ($type == 5) { + $this->filter->cat->setVisible(true); + } else { + $this->filter->cat->setVisible(false); + } } + public function OnAutoItem($sender) { $r = array(); @@ -99,12 +100,12 @@ private function generateReport() { $detail = array(); $conn = \ZDB\DB::getConnect(); - $cat=""; - if ($type == 5 && $cat_id>0) { - $cat = " and cat_id=".$cat_id; + $cat = ""; + if ($type == 5 && $cat_id > 0) { + $cat = " and cat_id=" . $cat_id; } - - if ($type == 1 || strlen($cat)>0) { //по товарам + + if ($type == 1 || strlen($cat) > 0) { //по товарам $sql = " select i.`itemname`,i.`item_code`,sum(0-e.`quantity`) as qty, sum(0-e.`amount`) as summa, sum(e.extcode*(0-e.`quantity`)) as navar from `entrylist_view` e @@ -165,7 +166,7 @@ private function generateReport() { order by s.`service_name` "; } - if ($type == 5 && strlen($cat)==0) { //по категориях + if ($type == 5 && strlen($cat) == 0) { //по категориях $sql = " select i.`cat_name` as itemname,sum(0-e.`quantity`) as qty, sum(0-e.`amount`) as summa, sum(e.extcode*(0-e.`quantity`)) as navar from `entrylist_view` e @@ -181,15 +182,15 @@ private function generateReport() { order by i.`cat_name` "; } - - + + $rs = $conn->Execute($sql); foreach ($rs as $row) { $detail[] = array( "code" => $row['item_code'], "name" => $row['itemname'], - "dt" => \App\Helper::fd( strtotime($row['dt'])), + "dt" => \App\Helper::fd(strtotime($row['dt'])), "qty" => H::fqty($row['qty']), "navar" => H::fa($row['navar']), "navarsign" => $row['navar'] > 0, @@ -197,11 +198,11 @@ private function generateReport() { ); } - $header = array('datefrom' => \App\Helper::fd( $from), + $header = array('datefrom' => \App\Helper::fd($from), "_detail" => $detail, - 'dateto' => \App\Helper::fd( $to) + 'dateto' => \App\Helper::fd($to) ); - if ($type == 1 || strlen($cat)>0) { + if ($type == 1 || strlen($cat) > 0) { $header['_type1'] = true; $header['_type2'] = false; $header['_type3'] = false; @@ -229,15 +230,15 @@ private function generateReport() { $header['_type4'] = true; $header['_type5'] = false; } - if ($type == 5 && strlen($cat)==0) { + if ($type == 5 && strlen($cat) == 0) { $header['_type1'] = false; $header['_type2'] = false; $header['_type3'] = false; $header['_type4'] = false; $header['_type5'] = true; } - - + + $report = new \App\Report('report/outcome.tpl'); $html = $report->generate($header); diff --git a/www/app/pages/report/payactivity.php b/www/app/pages/report/payactivity.php index ca84d3837..b4ec91dd6 100644 --- a/www/app/pages/report/payactivity.php +++ b/www/app/pages/report/payactivity.php @@ -123,7 +123,7 @@ private function generateReport() { $detail[] = array( - "date" => \App\Helper::fd( strtotime($row['dt'])), + "date" => \App\Helper::fd(strtotime($row['dt'])), "in" => H::fa(strlen($row['begin_amount']) > 0 ? $row['begin_amount'] : 0), "obin" => H::fa($row['obin']), @@ -136,13 +136,13 @@ private function generateReport() { } $tb = $tend - $tin + $tout; - $header = array('datefrom' => \App\Helper::fd( $from), + $header = array('datefrom' => \App\Helper::fd($from), "_detail" => $detail, 'tb' => H::fa($tb), 'tin' => H::fa($tin), 'tout' => H::fa($tout), 'tend' => H::fa($tend), - 'dateto' => \App\Helper::fd( $to), + 'dateto' => \App\Helper::fd($to), "mf_name" => MoneyFund::load($mf_id)->mf_name ); $report = new \App\Report('report/payactivity.tpl'); diff --git a/www/app/pages/report/paybalance.php b/www/app/pages/report/paybalance.php index 1311f8939..606c73790 100644 --- a/www/app/pages/report/paybalance.php +++ b/www/app/pages/report/paybalance.php @@ -130,8 +130,8 @@ private function generateReport() { $total = $tin - $tout; $header = array( - 'datefrom' => \App\Helper::fd( $from), - 'dateto' => \App\Helper::fd( $to), + 'datefrom' => \App\Helper::fd($from), + 'dateto' => \App\Helper::fd($to), "_detail" => $detail, "_detail2" => $detail2, 'tin' => H::fa($tin), diff --git a/www/app/pages/report/price.php b/www/app/pages/report/price.php index 4922125d4..e38aa6240 100644 --- a/www/app/pages/report/price.php +++ b/www/app/pages/report/price.php @@ -103,7 +103,7 @@ private function generateReport() { "price3name" => $isp3 ? $option['price3'] : "", "price4name" => $isp4 ? $option['price4'] : "", "price5name" => $isp5 ? $option['price5'] : "", - 'date' => \App\Helper::fd( time()) + 'date' => \App\Helper::fd(time()) ); $report = new \App\Report('report/price.tpl'); diff --git a/www/app/pages/report/prod.php b/www/app/pages/report/prod.php index 62c343ea8..f9b33862b 100644 --- a/www/app/pages/report/prod.php +++ b/www/app/pages/report/prod.php @@ -129,10 +129,10 @@ private function generateReport() { $sum2 += $row['summa']; } - $header = array('datefrom' => \App\Helper::fd( $from), + $header = array('datefrom' => \App\Helper::fd($from), "_detail" => $detail, "_detail2" => $detail2, - 'dateto' => \App\Helper::fd( $to), + 'dateto' => \App\Helper::fd($to), 'parea' => null, 'sum1' => H::fa($sum1), 'sum2' => H::fa($sum2) diff --git a/www/app/pages/report/salaryrep.php b/www/app/pages/report/salaryrep.php index 959ccaf92..e53f6ac21 100644 --- a/www/app/pages/report/salaryrep.php +++ b/www/app/pages/report/salaryrep.php @@ -86,9 +86,9 @@ private function generateReport() { $date = strtotime($doc->headerdata['year'] . '-' . $doc->headerdata['month'] . '-01'); - $d1 = \App\Helper::fdt( $from); - $d2 = \App\Helper::fdt( $to); - $d3 = \App\Helper::fdt( $date); + $d1 = \App\Helper::fdt($from); + $d2 = \App\Helper::fdt($to); + $d3 = \App\Helper::fdt($date); if ($date < $from || $date > $to) { continue; diff --git a/www/app/pages/roles.php b/www/app/pages/roles.php index 5dc07c0d9..b50ccd1d8 100644 --- a/www/app/pages/roles.php +++ b/www/app/pages/roles.php @@ -18,7 +18,8 @@ use \Zippy\Html\Panel; use \Zippy\Binding\PropertyBinding as Bind; -class Roles extends \App\Pages\Base { +class Roles extends \App\Pages\Base +{ public $role = null; @@ -26,7 +27,7 @@ public function __construct() { parent::__construct(); if (System::getUser()->userlogin != 'admin') { - $this->setError('onlyadminaccess'); + $this->setError('onlyadminaccess'); App::RedirectHome(); return false; } @@ -35,18 +36,18 @@ public function __construct() { $this->add(new Panel("listpan")); $this->listpan->add(new ClickLink('addnew', $this, "onAdd")); $this->listpan->add(new DataView("rolerow", new RoleDataSource(), $this, 'OnRow'))->Reload(); - + $this->add(new Panel("editpanname"))->setVisible(false); $this->editpanname->add(new Form('editformname'))->onSubmit($this, 'savenameOnClick'); $this->editpanname->editformname->add(new TextInput('editname')); $this->editpanname->editformname->add(new Button('cancelname'))->onClick($this, 'cancelOnClick'); - - + + $this->add(new Panel("editpan"))->setVisible(false); $this->editpan->add(new Form('editform'))->onSubmit($this, 'saveaclOnClick'); - - + + //виджеты $this->editpan->editform->add(new CheckBox('editwplanned')); $this->editpan->editform->add(new CheckBox('editwdebitors')); @@ -62,142 +63,157 @@ public function __construct() { $this->editpan->editform->add(new CheckBox('editshop')); $this->editpan->editform->add(new CheckBox('editnote')); $this->editpan->editform->add(new CheckBox('editissue')); - - + + $this->editpan->editform->add(new Button('cancel'))->onClick($this, 'cancelOnClick'); - $this->editpan->editform->add(new Panel('metaaccess')) ; + $this->editpan->editform->add(new Panel('metaaccess')); $this->editpan->editform->metaaccess->add(new DataView('metarow', new \ZCL\DB\EntityDataSource("\\App\\Entity\\MetaData", "", "meta_type,description"), $this, 'metarowOnRow')); - $this->editpan->editform->metaaccess->metarow->Reload(); - + $this->editpan->editform->metaaccess->metarow->Reload(); + $this->add(new Panel("editpanmenu"))->setVisible(false); $this->editpanmenu->add(new Form('editformmenu'))->onSubmit($this, 'savemenuOnClick'); - + $this->editpanmenu->editformmenu->add(new Button('cancelmenu'))->onClick($this, 'cancelOnClick'); $this->editpanmenu->editformmenu->add(new DataView('mlist', new \ZCL\DB\EntityDataSource("\\App\\Entity\\MetaData", "disabled<>1 ", "meta_type,description"), $this, 'menurowOnRow')); - + } public function onAdd($sender) { - $this->listpan->setVisible(false); $this->editpanname->setVisible(true); // Очищаем форму $this->editpanname->editformname->clean(); - + $this->role = new UserRole(); } public function onEdit($sender) { - $this->listpan->setVisible(false); - $this->editpanname->setVisible(true); - $this->role = $sender->getOwner()->getDataItem(); - $this->editpanname->editformname->editname->setText($this->role->rolename); - + $this->listpan->setVisible(false); + $this->editpanname->setVisible(true); + $this->role = $sender->getOwner()->getDataItem(); + $this->editpanname->editformname->editname->setText($this->role->rolename); + } + public function OnMenu($sender) { - $this->listpan->setVisible(false); - $this->editpanmenu->setVisible(true); - $this->role = $sender->getOwner()->getDataItem(); - - $w = ""; - - if (strlen($this->role->aclview) > 0) { - $w = " and meta_id in ({$this->role->aclview})"; - } else { - $w = " and meta_id in (0)"; - } - if($this->role->rolename=='admins') $w = ""; - $this->editpanmenu->editformmenu->mlist->getDataSource()->setWhere("disabled<>1 {$w}"); - $this->editpanmenu->editformmenu->mlist->Reload(); - + $this->listpan->setVisible(false); + $this->editpanmenu->setVisible(true); + $this->role = $sender->getOwner()->getDataItem(); + + $w = ""; + + if (strlen($this->role->aclview) > 0) { + $w = " and meta_id in ({$this->role->aclview})"; + } else { + $w = " and meta_id in (0)"; + } + if ($this->role->rolename == 'admins') { + $w = ""; + } + $this->editpanmenu->editformmenu->mlist->getDataSource()->setWhere("disabled<>1 {$w}"); + $this->editpanmenu->editformmenu->mlist->Reload(); + } + public function OnAcl($sender) { - $this->listpan->setVisible(false); $this->editpan->setVisible(true); $this->role = $sender->getOwner()->getDataItem(); - - + + $this->editpan->editform->metaaccess->metarow->Reload(); - - if (strpos($this->role->widgets, 'wplanned') !== false) + + if (strpos($this->role->widgets, 'wplanned') !== false) { $this->editpan->editform->editwplanned->setChecked(true); - if (strpos($this->role->widgets, 'wdebitors') !== false) + } + if (strpos($this->role->widgets, 'wdebitors') !== false) { $this->editpan->editform->editwdebitors->setChecked(true); - if (strpos($this->role->widgets, 'wnoliq') !== false) + } + if (strpos($this->role->widgets, 'wnoliq') !== false) { $this->editpan->editform->editwnoliq->setChecked(true); - if (strpos($this->role->widgets, 'wminqty') !== false) + } + if (strpos($this->role->widgets, 'wminqty') !== false) { $this->editpan->editform->editwminqty->setChecked(true); - if (strpos($this->role->widgets, 'wsdate') !== false) + } + if (strpos($this->role->widgets, 'wsdate') !== false) { $this->editpan->editform->editwsdate->setChecked(true); - if (strpos($this->role->widgets, 'wrdoc') !== false) + } + if (strpos($this->role->widgets, 'wrdoc') !== false) { $this->editpan->editform->editwrdoc->setChecked(true); - if (strpos($this->role->widgets, 'wopendoc') !== false) + } + if (strpos($this->role->widgets, 'wopendoc') !== false) { $this->editpan->editform->editwopendoc->setChecked(true); - if (strpos($this->role->widgets, 'wwaited') !== false) + } + if (strpos($this->role->widgets, 'wwaited') !== false) { $this->editpan->editform->editwwaited->setChecked(true); - if (strpos($this->role->widgets, 'wreserved') !== false) + } + if (strpos($this->role->widgets, 'wreserved') !== false) { $this->editpan->editform->editwreserved->setChecked(true); + } - if (strpos($this->role->modules, 'ocstore') !== false) + if (strpos($this->role->modules, 'ocstore') !== false) { $this->editpan->editform->editocstore->setChecked(true); - if (strpos($this->role->modules, 'shop') !== false) + } + if (strpos($this->role->modules, 'shop') !== false) { $this->editpan->editform->editshop->setChecked(true); - if (strpos($this->role->modules, 'note') !== false) + } + if (strpos($this->role->modules, 'note') !== false) { $this->editpan->editform->editnote->setChecked(true); - if (strpos($this->role->modules, 'issue') !== false) + } + if (strpos($this->role->modules, 'issue') !== false) { $this->editpan->editform->editissue->setChecked(true); + } } public function savenameOnClick($sender) { $this->role->rolename = $this->editpanname->editformname->editname->getText(); - $role = UserRole::getFirst('rolename='.UserRole::qstr($this->role->rolename)); + $role = UserRole::getFirst('rolename=' . UserRole::qstr($this->role->rolename)); if ($user instanceof UserRole) { if ($role->role_id != $this->role->role_id) { $this->setError('Неуникальное имя'); return; } - } - + } + $this->role->save(); $this->listpan->rolerow->Reload(); $this->listpan->setVisible(true); - $this->editpanname->setVisible(false); - + $this->editpanname->setVisible(false); + } + public function savemenuOnClick($sender) { $smartmenu = array(); foreach ($sender->mlist->getDataRows() as $row) { $item = $row->getDataItem(); - if ($item->mview == true) + if ($item->mview == true) { $smartmenu[] = $item->meta_id; + } } $this->role->smartmenu = implode(',', $smartmenu); - - + + $this->role->save(); $this->listpan->rolerow->Reload(); $this->listpan->setVisible(true); - $this->editpanmenu->setVisible(false); - + $this->editpanmenu->setVisible(false); + } - - - public function saveaclOnClick($sender) { - + + public function saveaclOnClick($sender) { $varr = array(); @@ -208,16 +224,16 @@ public function saveaclOnClick($sender) { foreach ($this->editpan->editform->metaaccess->metarow->getDataRows() as $row) { $item = $row->getDataItem(); if ($item->viewacc == true) { - $varr[] = $item->meta_id; + $varr[] = $item->meta_id; } if ($item->editacc == true) { - $earr[] = $item->meta_id; + $earr[] = $item->meta_id; } if ($item->exeacc == true) { - $xarr[] = $item->meta_id; + $xarr[] = $item->meta_id; } if ($item->cancelacc == true) { - $carr[] = $item->meta_id; + $carr[] = $item->meta_id; } } $this->role->aclview = implode(',', $varr); @@ -228,37 +244,50 @@ public function saveaclOnClick($sender) { $widgets = ""; - if ($this->editpan->editform->editwplanned->isChecked()) + if ($this->editpan->editform->editwplanned->isChecked()) { $widgets = $widgets . ',wplanned'; - if ($this->editpan->editform->editwdebitors->isChecked()) + } + if ($this->editpan->editform->editwdebitors->isChecked()) { $widgets = $widgets . ',wdebitors'; - if ($this->editpan->editform->editwnoliq->isChecked()) + } + if ($this->editpan->editform->editwnoliq->isChecked()) { $widgets = $widgets . ',wnoliq'; - if ($this->editpan->editform->editwminqty->isChecked()) + } + if ($this->editpan->editform->editwminqty->isChecked()) { $widgets = $widgets . ',wminqty'; - if ($this->editpan->editform->editwsdate->isChecked()) + } + if ($this->editpan->editform->editwsdate->isChecked()) { $widgets = $widgets . ',wsdate'; - if ($this->editpan->editform->editwrdoc->isChecked()) + } + if ($this->editpan->editform->editwrdoc->isChecked()) { $widgets = $widgets . ',wrdoc'; - if ($this->editpan->editform->editwopendoc->isChecked()) + } + if ($this->editpan->editform->editwopendoc->isChecked()) { $widgets = $widgets . ',wopendoc'; - if ($this->editpan->editform->editwwaited->isChecked()) + } + if ($this->editpan->editform->editwwaited->isChecked()) { $widgets = $widgets . ',wwaited'; - if ($this->editpan->editform->editwreserved->isChecked()) + } + if ($this->editpan->editform->editwreserved->isChecked()) { $widgets = $widgets . ',wreserved'; + } $this->role->widgets = trim($widgets, ','); $modules = ""; - if ($this->editpan->editform->editshop->isChecked()) + if ($this->editpan->editform->editshop->isChecked()) { $modules = $modules . ',shop'; - if ($this->editpan->editform->editnote->isChecked()) + } + if ($this->editpan->editform->editnote->isChecked()) { $modules = $modules . ',note'; - if ($this->editpan->editform->editocstore->isChecked()) + } + if ($this->editpan->editform->editocstore->isChecked()) { $modules = $modules . ',ocstore'; - if ($this->editpan->editform->editissue->isChecked()) + } + if ($this->editpan->editform->editissue->isChecked()) { $modules = $modules . ',issue'; + } $this->role->modules = trim($modules, ','); @@ -266,7 +295,7 @@ public function saveaclOnClick($sender) { $this->listpan->rolerow->Reload(); $this->listpan->setVisible(true); $this->editpan->setVisible(false); - + } public function cancelOnClick($sender) { @@ -275,14 +304,14 @@ public function cancelOnClick($sender) { $this->editpanname->setVisible(false); $this->editpanmenu->setVisible(false); } - + //удаление роли public function OnRemove($sender) { - + $role = $sender->getOwner()->getDataItem(); - + $del = UserRole::delete($role->role_id); if (strlen($del) > 0) { $this->setError($del); @@ -296,16 +325,20 @@ public function OnRow($datarow) { $item = $datarow->getDataItem(); $datarow->add(new \Zippy\Html\Label("rolename", $item->rolename)); $datarow->add(new \Zippy\Html\Label("cnt", $item->cnt)); - + $datarow->add(new \Zippy\Html\Link\ClickLink("smenu", $this, "OnMenu")); $datarow->add(new \Zippy\Html\Link\ClickLink("acl", $this, "OnAcl"))->setVisible($item->rolename != 'admins'); $datarow->add(new \Zippy\Html\Link\ClickLink("edit", $this, "OnEdit"))->setVisible($item->rolename != 'admins'); $datarow->add(new \Zippy\Html\Link\ClickLink("remove", $this, "OnRemove"))->setVisible($item->rolename != 'admins'); - if($item->cnt>0) $datarow->remove->setVisible(false) ; - if($item->cnt==0) $datarow->cnt->setVisible(false) ; + if ($item->cnt > 0) { + $datarow->remove->setVisible(false); + } + if ($item->cnt == 0) { + $datarow->cnt->setVisible(false); + } } - + public function metarowOnRow($row) { $item = $row->getDataItem(); switch ($item->meta_type) { @@ -354,8 +387,8 @@ public function metarowOnRow($row) { $row->add(new CheckBox('exeacc', new Bind($item, 'exeacc')))->setVisible($item->meta_type == 1); $row->add(new CheckBox('cancelacc', new Bind($item, 'cancelacc')))->setVisible($item->meta_type == 1); } - - + + public function menurowOnRow($row) { $item = $row->getDataItem(); switch ($item->meta_type) { @@ -386,12 +419,12 @@ public function menurowOnRow($row) { $row->add(new CheckBox('mshow', new Bind($item, 'mview'))); } - - + } -class RoleDataSource implements \Zippy\Interfaces\DataSource { +class RoleDataSource implements \Zippy\Interfaces\DataSource +{ //private $model, $db; diff --git a/www/app/pages/service/armpos.php b/www/app/pages/service/armpos.php index 25d111858..68bc49de3 100644 --- a/www/app/pages/service/armpos.php +++ b/www/app/pages/service/armpos.php @@ -48,7 +48,7 @@ public function __construct() { $plist = \App\Entity\Pos::findArray('pos_name', 'pos_id=' . $cc); } $this->form1->add(new DropDownChoice('pos', $plist, $cc)); - $this->form1->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0)) ; + $this->form1->add(new DropDownChoice('firm', \App\Entity\Firm::getList(), 0)); $this->form1->add(new SubmitButton('next1'))->onClick($this, 'next1docOnClick'); @@ -214,7 +214,7 @@ public function detailOnRow($row) { $row->add(new Label('code', $item->item_code)); $row->add(new Label('msr', $item->msr)); $row->add(new Label('snumber', $item->snumber)); - $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd( $item->sdate) : '')); + $row->add(new Label('sdate', $item->sdate > 0 ? \App\Helper::fd($item->sdate) : '')); $row->add(new Label('quantity', H::fqty($item->quantity))); $row->add(new Label('price', H::fa($item->price))); @@ -623,10 +623,10 @@ public function savedocOnClick($sender) { $this->_doc->headerdata['store'] = $this->pos->store; $this->_doc->headerdata['pricetype'] = $this->pos->pricetype; // $this->_doc->headerdata['pricetypename'] = $this->form1->pricetype->getValueName(); - + $this->_doc->headerdata['firm_id'] = $this->form1->firm->getValue(); - - $firm = H::getFirmData($this->_doc->branch_id,$this->_doc->headerdata['firm_id']); + + $firm = H::getFirmData($this->_doc->branch_id, $this->_doc->headerdata['firm_id']); $this->_doc->headerdata["firm_name"] = $firm['firm_name']; $this->_doc->headerdata["inn"] = $firm['inn']; $this->_doc->headerdata["address"] = $firm['address']; diff --git a/www/app/pages/service/export.php b/www/app/pages/service/export.php index bcd41fb69..ae099a7b2 100644 --- a/www/app/pages/service/export.php +++ b/www/app/pages/service/export.php @@ -20,7 +20,7 @@ class Export extends \App\Pages\Base { public $_docs = array(); - + public function __construct() { parent::__construct(); if (false == \App\ACL::checkShowSer('Export')) { @@ -29,7 +29,7 @@ public function __construct() { $form = $this->add(new Form("iform")); - $form->add(new DropDownChoice("itype", array( ), 0))->onChange($this, "onType"); + $form->add(new DropDownChoice("itype", array(), 0))->onChange($this, "onType"); $form->add(new DropDownChoice("encode", array(1 => 'UTF8', 2 => 'win1251'), 0)); $form->add(new DropDownChoice("price", Item::getPriceTypeList())); $form->add(new DropDownChoice("store", Store::getList(), H::getDefStore())); @@ -41,15 +41,15 @@ public function __construct() { $form = $this->add(new Form("cform")); - $form->add(new DropDownChoice("ctype", array( ), 0)); + $form->add(new DropDownChoice("ctype", array(), 0)); $form->add(new DropDownChoice("cencode", array(1 => 'UTF8', 2 => 'win1251'), 0)); $form->add(new TextInput("csep", ';')); $form->onSubmit($this, "onCExport"); $form = $this->add(new Form("dform")); - - $form->add(new DropDownChoice("dtype", array( 'GoodsReceipt'=>Document::getDesc('GoodsReceipt'),'GoodsIssue'=>Document::getDesc('GoodsIssue')), 'GoodsReceipt')); + + $form->add(new DropDownChoice("dtype", array('GoodsReceipt' => Document::getDesc('GoodsReceipt'), 'GoodsIssue' => Document::getDesc('GoodsIssue')), 'GoodsReceipt')); $form->add(new DropDownChoice("dencode", array(1 => 'UTF8', 2 => 'win1251'), 0)); $form->add(new TextInput("dsep", ';')); $form->add(new Date('dfrom', time() - (7 * 24 * 3600))); @@ -167,28 +167,29 @@ public function onExport($sender) { } - + public function onDPreview($sender) { - $dt = $sender->dtype->getValue() ; - + $dt = $sender->dtype->getValue(); + $conn = \ZDB\DB::getConnect(); - - $sql = "meta_name='{$dt}' and date(document_date) >= " . $conn->DBDate($sender->dfrom->getDate()) . " and date(document_date) <= " . $conn->DBDate($sender->dto->getDate()) ; + + $sql = "meta_name='{$dt}' and date(document_date) >= " . $conn->DBDate($sender->dfrom->getDate()) . " and date(document_date) <= " . $conn->DBDate($sender->dto->getDate()); $this->_docs = Document::find($sql); $this->dformlist->doclist->Reload(); } + public function expDRow($row) { $doc = $row->getDataItem(); $row->add(new CheckBox('dch', new Prop($doc, 'ch'))); $row->add(new Label('dnumber', $doc->document_number)); - $row->add(new Label('ddate', \App\Helper::fd( $doc->document_date))); - $row->add(new Label('damount', \App\Helper::fa($doc->amount))); + $row->add(new Label('ddate', \App\Helper::fd($doc->document_date))); + $row->add(new Label('damount', \App\Helper::fa($doc->amount))); $row->add(new Label('dcustomer', $doc->customer_name)); - - } - - public function onDExport($sender) { + + } + + public function onDExport($sender) { $encode = $this->dform->dencode->getValue(); $sep = $this->dform->dsep->getText(); @@ -197,43 +198,43 @@ public function onDExport($sender) { $this->setError('noselencode'); return; } - $csv=""; - + $csv = ""; + foreach ($this->_docs as $doc) { if ($doc->ch == false) { continue; } - - $csv .= $doc->document_number . $sep; - $csv .= H::fd($doc->document_date) . $sep; - $csv .= $doc->customer_name . $sep; + + $csv .= $doc->document_number . $sep; + $csv .= H::fd($doc->document_date) . $sep; + $csv .= $doc->customer_name . $sep; $csv .= "\n"; - $n=1; - - foreach($doc->unpackDetails('detaildata') as $item) { - $csv .= $sep. $n . $sep; - $csv .= $item->itemname . $sep; - $csv .= $item->item_code . $sep; - $csv .= H::fqty($item->quantity) . $sep; - $csv .= H::fa($item->price) . $sep; - $csv .= "\n"; + $n = 1; + + foreach ($doc->unpackDetails('detaildata') as $item) { + $csv .= $sep . $n . $sep; + $csv .= $item->itemname . $sep; + $csv .= $item->item_code . $sep; + $csv .= H::fqty($item->quantity) . $sep; + $csv .= H::fa($item->price) . $sep; + $csv .= "\n"; } - $csv .= "Итого: " . $sep; - $csv .= H::fa($doc->amount) . $sep. $sep. $sep. $sep. $sep; + $csv .= "Итого: " . $sep; + $csv .= H::fa($doc->amount) . $sep . $sep . $sep . $sep . $sep; $csv .= "\n"; - + } if ($encode == 2) { $csv = mb_convert_encoding($csv, "windows-1251", "utf-8"); - } + } header("Content-type: text/csv"); header("Content-Disposition: attachment;Filename=exportdoc_" . date('Y_m_d', time()) . ".csv"); header("Content-Transfer-Encoding: binary"); echo $csv; flush(); - die; - } - - + die; + } + + } diff --git a/www/app/pages/service/import.php b/www/app/pages/service/import.php index 819be62a6..4ae48299b 100644 --- a/www/app/pages/service/import.php +++ b/www/app/pages/service/import.php @@ -26,7 +26,7 @@ public function __construct() { //ТМЦ $form = $this->add(new Form("iform")); - $form->add(new DropDownChoice("itype", array( ), 0))->onChange($this, "onType"); + $form->add(new DropDownChoice("itype", array(), 0))->onChange($this, "onType"); $form->add(new DropDownChoice("encode", array(1 => 'UTF8', 2 => 'win1251'), 0)); $form->add(new DropDownChoice("price", Item::getPriceTypeList())); $form->add(new DropDownChoice("store", Store::getList(), H::getDefStore())); @@ -70,7 +70,7 @@ public function __construct() { //контрагенты $form = $this->add(new Form("cform")); - $form->add(new DropDownChoice("ctype", array( ), 0)); + $form->add(new DropDownChoice("ctype", array(), 0)); $form->add(new DropDownChoice("cencode", array(1 => 'UTF8', 2 => 'win1251'), 0)); $form->add(new TextInput("csep", ';')); $form->add(new CheckBox("cpreview")); diff --git a/www/app/pages/showdoc.php b/www/app/pages/showdoc.php index cedbfa1df..de8d0031d 100644 --- a/www/app/pages/showdoc.php +++ b/www/app/pages/showdoc.php @@ -9,12 +9,12 @@ class ShowDoc extends \Zippy\Html\WebPage { public function __construct($type, $docid) { - + $user = \App\System::getUser(); if ($user->user_id == 0) { die; - } - + } + $doc = Document::load($docid); if ($doc == null) { echo "Не задан документ"; @@ -73,7 +73,7 @@ public function __construct($type, $docid) { header("Content-Transfer-Encoding: binary"); - $dompdf = new \Dompdf\Dompdf(array('isRemoteEnabled' => true,'defaultFont' => 'DejaVu Sans')); + $dompdf = new \Dompdf\Dompdf(array('isRemoteEnabled' => true, 'defaultFont' => 'DejaVu Sans')); $dompdf->loadHtml($html); // (Optional) Setup the paper size and orientation diff --git a/www/app/pages/userlogin.php b/www/app/pages/userlogin.php index 94ea7e1c2..9007420ec 100644 --- a/www/app/pages/userlogin.php +++ b/www/app/pages/userlogin.php @@ -10,15 +10,15 @@ class UserLogin extends \Zippy\Html\WebPage { - private $cntlogin=0; - + private $cntlogin = 0; + public function __construct() { parent::__construct(); global $_config; - + $common = System::getOptions('common'); - - + + $form = new \Zippy\Html\Form\Form('loginform'); $form->add(new TextInput('userlogin')); $form->add(new TextInput('userpassword')); @@ -29,26 +29,26 @@ public function __construct() { $this->add($form); $this->setError(''); - - - $curver = 'v4.4.1'; - $this->_tvars['curversion'] = $curver ; - + + + $curver = 'v4.4.1'; + $this->_tvars['curversion'] = $curver; + //проверка новой версии - $this->_tvars['isnewversion'] = false; - + $this->_tvars['isnewversion'] = false; + $v = @file_get_contents("https://zippy.com.ua/version.json"); - $v = @json_decode($v,true) ; - if(strlen( $v['version'])>0){ - $c = (int) str_replace(".","",str_replace("v","",$curver )) ; - $n = (int)str_replace(".","",str_replace("v","",$v['version'] )) ; - if($n>$c) { - $this->_tvars['isnewversion'] = true; - } - - $this->_tvars['newversion'] = $v['version'] ; + $v = @json_decode($v, true); + if (strlen($v['version']) > 0) { + $c = (int)str_replace(".", "", str_replace("v", "", $curver)); + $n = (int)str_replace(".", "", str_replace("v", "", $v['version'])); + if ($n > $c) { + $this->_tvars['isnewversion'] = true; + } + + $this->_tvars['newversion'] = $v['version']; } - + $this->_tvars['capcha'] = $common['capcha'] == 1; } @@ -58,14 +58,14 @@ public function onsubmit($sender) { $this->setError(''); $login = $sender->userlogin->getText(); $password = $sender->userpassword->getText(); - $sender->userpassword->setText('') ; - if($this->_tvars['capcha']==true){ + $sender->userpassword->setText(''); + if ($this->_tvars['capcha'] == true) { $entercode = $sender->capchacode->getText(); $capchacode = $sender->capcha->getCode(); - if(strlen($entercode)==0 || $entercode != $capchacode) { - $this->setError("invalidcapcha") ; - $this->counter() ; - + if (strlen($entercode) == 0 || $entercode != $capchacode) { + $this->setError("invalidcapcha"); + $this->counter(); + return; } } @@ -104,8 +104,8 @@ public function onsubmit($sender) { } else { $this->setError('invalidlogin'); - - $this->counter() ; + + $this->counter(); } } @@ -130,30 +130,30 @@ protected function afterRender() { // $this->_tvars['alerterror'] = ''; } - + private function counter() { - $this->cntlogin++; - if($this->cntlogin==5){ - $msg = Helper::l("extralogin"); - $msg .= '
'.$this->loginform->userlogin->getText() .', '; - $msg .= $_SERVER['HTTP_HOST'] .' '. $_SERVER['SERVER_ADDR']; - $admin = \App\Entity\User::getByLogin('admin'); - $n = new \App\Entity\Notify(); - $n->user_id = $admin->user_id; - - $n->dateshow = time(); - $n->message = $msg; - - $n->save(); - - $this->setError('invalidloginalert'); - $this->loginform->setVisible(false); - if(strlen($admin->email)>0) { - Helper::sendLetter($msg,$admin->email,$admin->email,"Zippy Store alert") ; - } - - } - + $this->cntlogin++; + if ($this->cntlogin == 5) { + $msg = Helper::l("extralogin"); + $msg .= '
' . $this->loginform->userlogin->getText() . ', '; + $msg .= $_SERVER['HTTP_HOST'] . ' ' . $_SERVER['SERVER_ADDR']; + $admin = \App\Entity\User::getByLogin('admin'); + $n = new \App\Entity\Notify(); + $n->user_id = $admin->user_id; + + $n->dateshow = time(); + $n->message = $msg; + + $n->save(); + + $this->setError('invalidloginalert'); + $this->loginform->setVisible(false); + if (strlen($admin->email) > 0) { + Helper::sendLetter($msg, $admin->email, $admin->email, "Zippy Store alert"); + } + + } + // $this->_tvars['alerterror'] = ''; } diff --git a/www/app/pages/userprofile.php b/www/app/pages/userprofile.php index 5eb857b77..753b116dd 100644 --- a/www/app/pages/userprofile.php +++ b/www/app/pages/userprofile.php @@ -38,10 +38,9 @@ public function __construct() { $form->add(new DropDownChoice('defmf', \App\Entity\MoneyFund::getList(), $this->user->defmf)); $form->add(new DropDownChoice('pagesize', array(15 => 15, 25 => 25, 50 => 50, 100 => 100), $this->user->pagesize)); - - + $this->add($form); - + //форма пароля @@ -66,7 +65,6 @@ public function onsubmit($sender) { $this->user->defmf = $sender->defmf->getValue(); $this->user->pagesize = $sender->pagesize->getValue(); - if (!$this->isError()) { $this->user->save(); @@ -156,5 +154,5 @@ public function OnSend($sender) { $sender->clean(); } - + } diff --git a/www/app/pages/users.php b/www/app/pages/users.php index 9344f86b1..74b35608f 100644 --- a/www/app/pages/users.php +++ b/www/app/pages/users.php @@ -27,8 +27,8 @@ public function __construct() { parent::__construct(); if (System::getUser()->rolename != 'admins') { - - $this->setError('onlyadmisaccess'); + + $this->setError('onlyadmisaccess'); App::RedirectHome(); return false; } @@ -44,23 +44,23 @@ public function __construct() { $this->editpan->editform->add(new TextInput('editlogin')); $this->editpan->editform->add(new TextInput('editpass')); $this->editpan->editform->add(new TextInput('editemail')); - $this->editpan->editform->add(new DropDownChoice('editrole',UserRole::findArray('rolename','','rolename'))); + $this->editpan->editform->add(new DropDownChoice('editrole', UserRole::findArray('rolename', '', 'rolename'))); $this->editpan->editform->add(new CheckBox('editdisabled')); $this->editpan->editform->add(new CheckBox('editonlymy')); - + $this->editpan->editform->onSubmit($this, 'saveOnClick'); $this->editpan->editform->add(new Button('cancel'))->onClick($this, 'cancelOnClick'); - + $this->editpan->editform->add(new DataView('brow', new \ZCL\DB\EntityDataSource("\\App\\Entity\\Branch", "disabled<>1", "branch_name"), $this, 'branchOnRow')); } public function onAdd($sender) { if (System::getUser()->rolename !== 'admins') { - $this->setError( \App\Helper::l('onlyadminsuser')); + $this->setError(\App\Helper::l('onlyadminsuser')); return; } @@ -69,7 +69,7 @@ public function onAdd($sender) { $this->editpan->setVisible(true); // Очищаем форму $this->editpan->editform->clean(); - + $this->user = new User(); } @@ -77,7 +77,7 @@ public function onAdd($sender) { public function onEdit($sender) { if (System::getUser()->rolename !== 'admins') { - $this->setError( \App\Helper::l('onlyadminsuser')); + $this->setError(\App\Helper::l('onlyadminsuser')); return; } @@ -95,7 +95,7 @@ public function onEdit($sender) { $this->editpan->editform->editdisabled->setChecked($this->user->disabled); $this->editpan->editform->brow->Reload(); - + } public function saveOnClick($sender) { @@ -145,7 +145,7 @@ public function saveOnClick($sender) { } $this->user->aclbranch = implode(',', $barr); - + $this->user->save(); $this->listpan->userrow->Reload(); $this->listpan->setVisible(true); @@ -158,13 +158,13 @@ public function cancelOnClick($sender) { $this->editpan->setVisible(false); } - + //удаление юзера public function OnRemove($sender) { if (System::getUser()->rolename !== 'admins') { - $this->setError( \App\Helper::l('onlyadminsuser')); + $this->setError(\App\Helper::l('onlyadminsuser')); return; } @@ -202,7 +202,7 @@ public function branchOnRow($row) { $row->add(new CheckBox('editbr', new Bind($item, 'editbr'))); } - + } class UserDataSource implements \Zippy\Interfaces\DataSource diff --git a/www/app/session.php b/www/app/session.php index 9d2275fa8..455afe72d 100644 --- a/www/app/session.php +++ b/www/app/session.php @@ -11,7 +11,7 @@ class Session private $values = array(); public $filter = array(); - + public function __construct() { diff --git a/www/app/system.php b/www/app/system.php index ab4ae55b7..d6120a79b 100644 --- a/www/app/system.php +++ b/www/app/system.php @@ -35,13 +35,13 @@ public static function getUser() { public static function setUser(User $user) { Session::getSession()->user = $user; } - + public static function getBranch() { - + return Session::getSession()->branch_id; } - + public static function setBranch(int $branch_id) { Session::getSession()->branch_id = $branch_id; } @@ -116,7 +116,7 @@ public static function getCache($key) { return null; } - public static function setSuccesMsg($msg) { + public static function setSuccessMsg($msg) { Session::getSession()->smsg = $msg; } diff --git a/www/app/widgets/docview.php b/www/app/widgets/docview.php index 51ed83ed5..ee0bb129e 100644 --- a/www/app/widgets/docview.php +++ b/www/app/widgets/docview.php @@ -41,7 +41,7 @@ public function __construct($id) { $this->add(new RedirectLink('excel', "")); $this->add(new RedirectLink('pdf', "")); $this->add(new BookmarkableLink('pos', "")); - $this->add(new ClickLink('email', $this,"onMail"))->setVisible(true); + $this->add(new ClickLink('email', $this, "onMail"))->setVisible(true); $this->add(new Label('preview')); $this->add(new Label('previewpos')); @@ -139,7 +139,7 @@ public function setDoc(\App\Entity\Doc\Document $doc) { public function stateListOnRow($row) { $item = $row->getDataItem(); // $row->add(new Label('statehost', $item->hostname)); - $row->add(new Label('statedate', \App\Helper::fdt( $item->createdon))); + $row->add(new Label('statedate', \App\Helper::fdt($item->createdon))); $row->add(new Label('stateuser', $item->username)); $row->add(new Label('statename', Document::getStateName($item->docstate))); } @@ -147,7 +147,7 @@ public function stateListOnRow($row) { //вывод строки оплат public function payListOnRow($row) { $item = $row->getDataItem(); - $row->add(new Label('paydate', \App\Helper::fd( $item->paydate))); + $row->add(new Label('paydate', \App\Helper::fd($item->paydate))); $row->add(new Label('payamountp', H::fa($item->amount > 0 ? $item->amount : ""))); $row->add(new Label('payamountm', H::fa($item->amount < 0 ? 0 - $item->amount : ""))); @@ -264,7 +264,7 @@ public function OnMsgSubmit($sender) { //список комментариев private function updateMessages() { - $this->_msglist = \App\Entity\Message::getMessages(1, $this->_doc->document_id ); + $this->_msglist = \App\Entity\Message::getMessages(1, $this->_doc->document_id); $this->dw_msglist->Reload(); $this->hmessages->setText(count($this->_msglist)); $this->hmessages->setVisible(count($this->_msglist) > 0); @@ -274,8 +274,8 @@ private function updateMessages() { public function msgListOnRow($row) { $item = $row->getDataItem(); - $row->add(new Label("msgdata", nl2br($item->message) ,true )); - $row->add(new Label("msgdate", \App\Helper::fdt( $item->created))); + $row->add(new Label("msgdata", nl2br($item->message), true)); + $row->add(new Label("msgdate", \App\Helper::fdt($item->created))); $row->add(new Label("msguser", $item->username)); $row->add(new ClickLink('delmsg'))->onClick($this, 'deleteMsgOnClick'); @@ -357,7 +357,7 @@ public function OnAddDoc($sender) { } public function onMail($sender) { - $this->_doc->sendEmail() ; + $this->_doc->sendEmail(); } - + } diff --git a/www/app/widgets/itemsel.php b/www/app/widgets/itemsel.php index 72e658c3b..4a52a68ea 100644 --- a/www/app/widgets/itemsel.php +++ b/www/app/widgets/itemsel.php @@ -41,7 +41,7 @@ public function __construct($id, $page, $event) { $this->wisfilter->add(new TextInput('wissearchkey')); $this->wisfilter->add(new DropDownChoice('wissearchcat', Category::findArray("cat_name", "", "cat_name"), 0)); - $this->wisfilter->add(new TextInput('wissearchmanufacturer' )); + $this->wisfilter->add(new TextInput('wissearchmanufacturer')); $ds = new ArrayDataSource($this, '_list'); @@ -49,8 +49,8 @@ public function __construct($id, $page, $event) { $table = $this->add(new DataTable('witemselt', $ds, true, true)); $table->setPageSize(H::getPG()); $table->AddColumn(new Column('itemname', H::l('name'), true, true, true)); - $table->AddColumn(new Column('item_code', H::l('code'), true, true, false)); - $table->AddColumn(new Column('manufacturer', H::l('brand'), true, true, false)); + $table->AddColumn(new Column('item_code', H::l('code'), true, true, false)); + $table->AddColumn(new Column('manufacturer', H::l('brand'), true, true, false)); $table->setCellClickEvent($this, 'OnSelect'); @@ -103,9 +103,9 @@ public function ReloadData() { $where = $where . " and (itemname like {$text} or item_code like {$text} ) "; } - if (strlen($man) > 0) { + if (strlen($man) > 0) { - $man = Item::qstr( $man ); + $man = Item::qstr($man); $where = $where . " and manufacturer like {$man} "; } diff --git a/www/app/widgets/wopendocs.php b/www/app/widgets/wopendocs.php index 175779e8e..a212f73f9 100644 --- a/www/app/widgets/wopendocs.php +++ b/www/app/widgets/wopendocs.php @@ -46,7 +46,7 @@ public function doclistOnRow($row) { $row->add(new \Zippy\Html\Link\RedirectLink("number", "\\App\\Pages\\Register\\DocList", $item->document_id))->setValue($item->document_number); - $row->add(new Label('date', \App\Helper::fdt( $item->document_date))); + $row->add(new Label('date', \App\Helper::fdt($item->document_date))); $row->add(new Label('type', $item->meta_desc)); $row->add(new Label('amount', Helper::fa($item->amount))); } diff --git a/www/app/widgets/wplanneddocs.php b/www/app/widgets/wplanneddocs.php index 428e82ebc..8e963de4a 100644 --- a/www/app/widgets/wplanneddocs.php +++ b/www/app/widgets/wplanneddocs.php @@ -45,7 +45,7 @@ public function __construct($id) { public function doclistOnRow($row) { $item = $row->getDataItem(); $item = $item->cast(); - $dt = \App\Helper::fd( $item->document_date); + $dt = \App\Helper::fd($item->document_date); $row->add(new \Zippy\Html\Link\RedirectLink("number", "\\App\\Pages\\Register\\DocList", $item->document_id))->setValue($item->document_number); $row->add(new Label('date', $dt)); diff --git a/www/app/widgets/wrdoc.php b/www/app/widgets/wrdoc.php index abe17af3b..0b3f4f291 100644 --- a/www/app/widgets/wrdoc.php +++ b/www/app/widgets/wrdoc.php @@ -54,7 +54,7 @@ public function doclistOnRow($row) { $item = $row->getDataItem(); - $row->add(new Label('date', \App\Helper::fd( strtotime($item->document_date)))); + $row->add(new Label('date', \App\Helper::fd(strtotime($item->document_date)))); $row->add(new Label('type', $item->meta_desc)); $row->add(new Label('amount', Helper::fa($item->amount))); $row->add(new \Zippy\Html\Link\RedirectLink("number", "\\App\\Pages\\Register\\DocList", $item->document_id))->setValue($item->document_number); diff --git a/www/app/widgets/wsdate.php b/www/app/widgets/wsdate.php index d80332ae8..7d0ee4fd5 100644 --- a/www/app/widgets/wsdate.php +++ b/www/app/widgets/wsdate.php @@ -57,7 +57,7 @@ public function sdlistOnRow($row) { $row->add(new Label('storename', $stock->storename)); $row->add(new Label('itemname', $stock->itemname)); $row->add(new Label('snumber', $stock->snumber)); - $row->add(new Label('edate', \App\Helper::fd( $stock->sdate))); + $row->add(new Label('edate', \App\Helper::fd($stock->sdate))); $row->add(new Label('qty', Helper::fqty($stock->qty))); $row->edate->setAttribute('class', 'badge badge-danger'); if ($stock->sdate > time()) { diff --git a/www/config/config.ini b/www/config/config.ini index 28dec8579..08a5abed0 100644 --- a/www/config/config.ini +++ b/www/config/config.ini @@ -1,6 +1,6 @@ [common] -salt=qwerty +salt=qwerty loglevel=100 ;DEBUG = 100,INFO = 200,WARNING = 300,ERROR = 400; lang=ru ;ru,ua @@ -13,14 +13,14 @@ pass=root [smtp] host=smtp.gmail.com port=587 -user=admin@admin.admin +user=admin@gmail.com pass=admin tls=true -fromname=ZStore ;для поля От кого + [modules] -ocstore=0 -shop=0 -note=1 -issue=1 -woocomerce=0 \ No newline at end of file +ocstore=0 ; интеграция с опенкеарт +shop=0 ; встроеный модуль онлайн каталога +note=0 ; модуль органайзера(базы знаний) +issue=0 ; модуль Проекты и задачи +woocomerce=0; интеграция с вукомерсе \ No newline at end of file diff --git a/www/templates/emails/invoice.tpl b/www/templates/emails/invoice.tpl deleted file mode 100644 index cce361e1e..000000000 --- a/www/templates/emails/invoice.tpl +++ /dev/null @@ -1,10 +0,0 @@ - Здраствуйте, {{customer_name}} - -
-
- Во влежении счёт на оплату (номер и дата) на сумму (и сумма). -
- С уважением, - {{firm_name}} - - \ No newline at end of file diff --git a/www/templates/lang.json b/www/templates/lang.json index 853c93fed..8b6b422ad 100644 --- a/www/templates/lang.json +++ b/www/templates/lang.json @@ -203,10 +203,10 @@ "partmove": "Перемещение партий", "noaccesstopage": "Нет права доступа к странице", "nodelusedfroup": "Нельзя удалять используемую группу", - "tobay": "Купить", - "toorder": "Заказать", - "isonstore": "В наличии", - "fororder": "Под заказ", + "tobay": "Купить", + "toorder": "Заказать", + "isonstore": "В наличии", + "fororder": "Под заказ", "cancelsell": "Снят с продажи", "name": "Наименование", "code": "Код", @@ -215,35 +215,34 @@ "onlyadminsaccess": "К странице имеют доступ только пользователи с ролью admins ", "onlyadminsuser": "Пользователями может управлять только пользователи с ролью admins ", "notnumber": "Не введен номер", - "cnal" : "Нал", + "cnal": "Нал", "cbeznal": "Безнал", "ckredit": "В кредит", - "creal" : "Под реализацию", - "invalidcapcha" : "Неверный код капчи", - "extralogin" : "Много неудачных авторизаций.", - "invalidloginalert" : "Много неудачных авторизаций. Администратору системы отправлено уведомление", - "garant" : "Гарантия", - "repbyitems" : "По товарам", - "repbycat" : "По категориям", - "repbybyers" : "По покупателям", - "repbydates" : "По датам", - "repbysellers" : "По поставщикам", - "repbyservices" : "Услуги, работы", - "mall" : "Все", - "mopen" : "Открытые", - "msgtask" : "Коментарий к задаче", - "msgreply" : "Ответить", - "msgopen" : "Открыть", - "iscreated" : "Создание задачи", - "isstchanged" : "Статус изменен на", - "isprchanged" : "Приоритет изменен на", - "isuserchanged" : "Задача переведена на", - "isassigned" : "На вас назначена задача", - "onlyadminpage" : "К странице имеет доступ только администратор", - "email_sent" : "Письмо отправлено", - "emailinvsub" : "Счет к оплате номер %s ", - + "creal": "Под реализацию", + "invalidcapcha": "Неверный код капчи", + "extralogin": "Много неудачных авторизаций.", + "invalidloginalert": "Много неудачных авторизаций. Администратору системы отправлено уведомление", + "garant": "Гарантия", + "repbyitems": "По товарам", + "repbycat": "По категориям", + "repbybyers": "По покупателям", + "repbydates": "По датам", + "repbysellers": "По поставщикам", + "repbyservices": "Услуги, работы", + "mall": "Все", + "mopen": "Открытые", + "msgtask": "Коментарий к задаче", + "msgreply": "Ответить", + "msgopen": "Открыть", + "iscreated": "Создание задачи", + "isstchanged": "Статус изменен на", + "isprchanged": "Приоритет изменен на", + "isuserchanged": "Задача переведена на", + "isassigned": "На вас назначена задача", + "onlyadminpage": "К странице имеет доступ только администратор", + "email_sent": "Письмо отправлено", + "emailinvsub": "Счет к оплате номер %s ", "refreshed": "Обновлено", - "sent" : "Отправлено", + "sent": "Отправлено", "saved": "Сохранено" } \ No newline at end of file diff --git a/www/templates/modules/issue/pages/issuelist.html b/www/templates/modules/issue/pages/issuelist.html index e4b901ce7..0ffb625ac 100644 --- a/www/templates/modules/issue/pages/issuelist.html +++ b/www/templates/modules/issue/pages/issuelist.html @@ -46,8 +46,8 @@

Список задач

- - + + @@ -68,7 +68,7 @@

Список задач

- +

Редактировать   Удалить @@ -106,8 +106,8 @@
Коментарии
x
-
- +
+
@@ -116,14 +116,14 @@
Коментарии
style="width:400px;height:120px;"> + +
@@ -172,9 +172,9 @@
Коментарии

- - + +

-

+
diff --git a/www/templates/modules/issue/pages/projectlist.html b/www/templates/modules/issue/pages/projectlist.html index dc01a5726..7b1848590 100644 --- a/www/templates/modules/issue/pages/projectlist.html +++ b/www/templates/modules/issue/pages/projectlist.html @@ -61,40 +61,41 @@

Проекты

-
- -
-
- -
- - -
-
- - -
-
- - -
-
-
-
- -
-
-
-
-
-   - -
-
-
- -
+
+
+
+
+ +
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+
+
+
+
+   + +
+
+
+
+
@@ -143,7 +144,7 @@
Коментарии
x -
+
diff --git a/www/templates/modules/note/pages/main.html b/www/templates/modules/note/pages/main.html index ba2a8b297..23cde8c8c 100644 --- a/www/templates/modules/note/pages/main.html +++ b/www/templates/modules/note/pages/main.html @@ -72,8 +72,9 @@ - + @@ -94,7 +95,7 @@   - +
- +
@@ -119,21 +120,21 @@
- + - -
+ +
- -
+ +
- + Отмена  Сохранить diff --git a/www/templates/modules/ocstore/options.html b/www/templates/modules/ocstore/options.html index 400e84e2b..5b2022c82 100644 --- a/www/templates/modules/ocstore/options.html +++ b/www/templates/modules/ocstore/options.html @@ -36,20 +36,22 @@

Настройки соединения

- Цена для обновления в магазине + Цена для обновления в магазине
- - Вместо заказа формировать и автоматически проводить расходную накладную. - Используется если заказы обрабатываются на стороне ИМ. -
-
+ + Вместо заказа формировать и автоматически проводить расходную + накладную. + Используется если заказы обрабатываются на стороне ИМ. +
+
- Импортировать зарегистрированых клиентов из ИМ в справочник контрагентов. -
- + Импортировать зарегистрированых клиентов из ИМ в справочник + контрагентов. +
+
diff --git a/www/templates/modules/ocstore/orders.html b/www/templates/modules/ocstore/orders.html index fefed818d..db4b26979 100644 --- a/www/templates/modules/ocstore/orders.html +++ b/www/templates/modules/ocstore/orders.html @@ -18,8 +18,6 @@

Импорт заказов

- - @@ -57,13 +55,12 @@

Импорт заказов

diff --git a/www/templates/modules/shop/pages/aboutus.html b/www/templates/modules/shop/pages/aboutus.html index ff6cbfba8..c1968aab8 100644 --- a/www/templates/modules/shop/pages/aboutus.html +++ b/www/templates/modules/shop/pages/aboutus.html @@ -1,10 +1,11 @@ - -
-
+ +
+
+
- {{{aboutus}}} -
-
- + {{{aboutus}}} +
+
+ \ No newline at end of file diff --git a/www/templates/modules/shop/pages/base.html b/www/templates/modules/shop/pages/base.html index 3247d26ba..ffcf10fc7 100644 --- a/www/templates/modules/shop/pages/base.html +++ b/www/templates/modules/shop/pages/base.html @@ -1,108 +1,111 @@ - - - - Онлайн каталог - - - + + + + Онлайн каталог + + + - - + + + + + + + + - - - - - - + + - - + - + + + + + - - - - - +
+
+ +
+ - - + + diff --git a/www/templates/modules/shop/pages/catalog.html b/www/templates/modules/shop/pages/catalog.html index 77e089912..00f1e1b43 100644 --- a/www/templates/modules/shop/pages/catalog.html +++ b/www/templates/modules/shop/pages/catalog.html @@ -1,102 +1,109 @@ - -
-
- +
+
+
+
+
+
+ + +
+ +
+
+ З + + по + +
+
+ Бренд +
+
+
+
+
-
-
-
- -
- - -
- -
-
- З - - по - -
-
- Бренд -
-
-
-
-
-
- - - + -
-
-
-
+
+
+
+
+
+
- - -

-
-
-
+ + -
-
- Новинка - Топ продаж - - -

-
-
- -
-
+ +
+
+
+
-

{{currencyname}}

-
-
- Купить +
+
+ Новинка + Топ продаж + + +

+
+
+
-
-
-
+
-
-
-
-
-

Недавно просмотренные

-
-
-
- - -
+

+ {{currencyname}}

-
+ Купить +
+
+
+
+ +
+
+
+
+

Недавно просмотренные

+
+
+
+ + +
+
+
+
- + diff --git a/www/templates/modules/shop/pages/compare.html b/www/templates/modules/shop/pages/compare.html index 33c8a21c0..043319a06 100644 --- a/www/templates/modules/shop/pages/compare.html +++ b/www/templates/modules/shop/pages/compare.html @@ -1,11 +1,12 @@ - - -
-
-

Сравнение товаров

-
+ + +
+
+
+

Сравнение товаров

+
-
-
- +
+
+ diff --git a/www/templates/modules/shop/pages/contact.html b/www/templates/modules/shop/pages/contact.html index bb392cb79..cd9028170 100644 --- a/www/templates/modules/shop/pages/contact.html +++ b/www/templates/modules/shop/pages/contact.html @@ -1,33 +1,34 @@ - -

-
- {{{contact}}} -
-
-
-

Обратная связь

-
-
- - -
-
- - -
-
- - -
- + +

+
+
+ {{{contact}}} +
+
+
+

Обратная связь

+ +
+ + +
+
+ + +
+
+ + +
-
- -
- +
+
-
- + + +
+
+ \ No newline at end of file diff --git a/www/templates/modules/shop/pages/delivery.html b/www/templates/modules/shop/pages/delivery.html index d0f336480..995047d87 100644 --- a/www/templates/modules/shop/pages/delivery.html +++ b/www/templates/modules/shop/pages/delivery.html @@ -1,9 +1,10 @@ - -
-
- {{{delivery}}} -
-
- + +
+
+
+ {{{delivery}}} +
+
+ \ No newline at end of file diff --git a/www/templates/modules/shop/pages/grouplist.html b/www/templates/modules/shop/pages/grouplist.html index 5e463ad83..f77f6a0d1 100644 --- a/www/templates/modules/shop/pages/grouplist.html +++ b/www/templates/modules/shop/pages/grouplist.html @@ -1,131 +1,132 @@ - - -
-
-

Категория товаров

+ + +
+
+

Категория товаров

+
+
+
+
+ +
+ +
+ + -
-
+ + +
+ + +
+
+ +
-
- - - - - - -
- - -
-
- -
- -
-
-
- -
- -
- -
- -
-
-

Список атрибутов

- Новый атрибут
- - - - - - - - - - - - - - - - - -
НаименованиеТипЗначение   
-
- -
-
-
- - - -
-
- - -
-
- - -
-
- - -
- - -
- - - -
-
- - -
- -
+
+ + + + +
+
+

Список атрибутов

+ Новый атрибут
+ + + + + + + + + + + + + + + + + +
НаименованиеТипЗначение   
+
+
+
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
-
+ +
+ + + +
+
+ + +
+ +
- - + + +
+
+ + diff --git a/www/templates/modules/shop/pages/main.html b/www/templates/modules/shop/pages/main.html index bb5f3bb6a..c0dd62f1c 100644 --- a/www/templates/modules/shop/pages/main.html +++ b/www/templates/modules/shop/pages/main.html @@ -1,56 +1,56 @@ - -
-
- -
-
+ +
+
+ +
+
+
+ +
+
+ +
+ {{#leftmenu}} + {{name}} + {{/leftmenu}}
- -
-
- -
- {{#leftmenu}} - {{name}} - {{/leftmenu}} -
-
+
-
+
-
+
-
+
-
-
- -
- -
-
-
-
+
+
+ +
+ +
+
+
+
-
-

Новинки

-
-
-
- - -
-
-
- +
+

Новинки

+
+
+
+ + +
-
+
- +
+
+ + diff --git a/www/templates/modules/shop/pages/manufacturers.html b/www/templates/modules/shop/pages/manufacturers.html index 659ab8ad5..14e55b672 100644 --- a/www/templates/modules/shop/pages/manufacturers.html +++ b/www/templates/modules/shop/pages/manufacturers.html @@ -1,39 +1,40 @@ - - - - -
+ + + + +
-
-

Список производителей, брендов

- Добавить - - - - - - -
 
+
+

Список производителей, брендов

+ Добавить + + + + + + +
 
-
-
+
+ -

Редактирование

-
- - -
-
- - -
-
- -   -
- - +

Редактирование

+
+ +
+
+ + +
+
+ +   +
+ + +
- + \ No newline at end of file diff --git a/www/templates/modules/shop/pages/options.html b/www/templates/modules/shop/pages/options.html index bb0b44eb0..e441bbfa5 100644 --- a/www/templates/modules/shop/pages/options.html +++ b/www/templates/modules/shop/pages/options.html @@ -1,118 +1,119 @@ - -
-
-

Администрирование

- Обновить цены -
-
- -
-
-

Настройка

-
-
- -
- -
-
-
- -
- -
-
-
- -
- - Условный контрагент от имени которого будут формироваться заказ -
-
+
+
+

Настройка

+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ -
-
-
- -
- -
-
+ + + Условный контрагент от имени которого будут формироваться + заказ +
+
-
- -
- -
-
+
+ +
+ +
+
+
+ +
+ +
+
-
- - - -
+
+ +
+ +
+
-
-
- -
-
+
+ + -
-
-

Тексты страниц

+ +
+
+ +
-
-
-
- - -
-
- - -
-
- - -
-
+
+
- + -
-
+ +
- + - + - + \ No newline at end of file diff --git a/www/templates/modules/shop/pages/order.html b/www/templates/modules/shop/pages/order.html index 824f2a0ec..091c0c584 100644 --- a/www/templates/modules/shop/pages/order.html +++ b/www/templates/modules/shop/pages/order.html @@ -1,85 +1,86 @@ - - -
-
-

Формирование заказа

-
- - - - - - - - - - - - - - - - - - - - - - -
 НаименованиеЦенаКол.
Всего:
+ + +
+
+

Формирование заказа

+ + + + + + + + + + + + + + + + + + + + + + + +
 НаименованиеЦенаКол.
Всего:
- -
-
-
-
-
- -
- -
-
-
- -
- -
-
- -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
-
-
+
+
- + - + diff --git a/www/templates/modules/shop/pages/productlist.html b/www/templates/modules/shop/pages/productlist.html index 2c7b5c6fc..1ae67d8d3 100644 --- a/www/templates/modules/shop/pages/productlist.html +++ b/www/templates/modules/shop/pages/productlist.html @@ -1,208 +1,212 @@ - - - -
-
-

Список товаров

-
+ + + +
+
+

Список товаров

+
+ +
+
+
+
+
+
+ + + Добавить новый - + + + + + + + + + -
+
+ + + - -   + - + + + + + + + +
НаименованиеКодЦенаКол.
+ - - - - +

+
+
+
+ + +
+

Редактирование

+
+ +
+
- +
+ +
+ +
+
+
+ +
+ +
+
- - - +
+
- +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
- Добавить новый +
+ +
- - - - - - - - - - - - - - - - - - - - - + + +
+
НаименованиеКод Цена Кол.
- - - -

-
-
- - - -
-

Редактирование

-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
- -
- - - -
-
- -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- - -
- - - -
- - -
-
- - -
- -
- -
-
-
- - - -
-
- - Отменить -   -  Изъять - -
-
+ + +
+ +
+ +
+
+
+ + +
+
-
- В список продуктов -

Список изображений

+ Отменить +   +  Изъять -
- - -
+
+ +
-
+
+ В список продуктов +

Список изображений

-
- -
Изъять -
Сделать +
+ + +
+ +
- - +
+
+ + diff --git a/www/templates/modules/shop/pages/productview.html b/www/templates/modules/shop/pages/productview.html index 7a92b75fb..919f50308 100644 --- a/www/templates/modules/shop/pages/productview.html +++ b/www/templates/modules/shop/pages/productview.html @@ -1,142 +1,142 @@ - - - -
-
- + + + +
+
+ +
+
+
+
+ +
+
+ + + +
+ {{#islistimage}} +
+
+
-
-
-
- -
-
- - - -
- {{#islistimage}} -
-
- -
-
- {{/islistimage}} - -
- +
+ {{/islistimage}} -
-
-
- Новинка - Топ продаж +
-

-
-

-
-
- -

  {{currencyname}}

-
-
- -
- - -
+
+
+
+ Новинка + Топ продаж +

+
+

+
-
-
-
-
-
-

Характеристики

- - - - - -
-
-
-

Отзывы

- - - - - -
- -    -
: -

- -
- {{#islogined}} - - {{/islogined}} -
-
- -
- -
- - -
-
- - -
+

  {{currencyname}}

+
+
-
- - -
- -
- -
- - - - -
- -
+
+ +
+ + +
+ +
+
+
+
+
+

Характеристики

+ + + + + +
+
+
+

Отзывы

+ + + + + +
+ +    +
: +

+ +
+ {{#islogined}} + + {{/islogined}} +
+
+ +
+ +
+ + +
+
+ + +
+
+ + +
-
+
+ +
- - + + diff --git a/www/templates/pages/base.html b/www/templates/pages/base.html index e29520dcf..2b535d883 100644 --- a/www/templates/pages/base.html +++ b/www/templates/pages/base.html @@ -540,31 +540,32 @@
_______________

  Пользователи

- + - {{#isadmin}} - - - - + + {{#isadmin}} + + + + {{#usefirms}} - - {{/usefirms}} - + + {{/usefirms}} + {{#usebranch}} {{/usebranch}} - + - {{/isadmin}} + + {{/isadmin}} @@ -644,7 +645,7 @@
_______________
- + diff --git a/www/templates/pages/doc/goodsissue.html b/www/templates/pages/doc/goodsissue.html index a3adc34d0..f9c5ac689 100644 --- a/www/templates/pages/doc/goodsissue.html +++ b/www/templates/pages/doc/goodsissue.html @@ -31,23 +31,23 @@

Расходная накладная

Добавить нового
- {{#usefirms}} -
- - -
+ {{#usefirms}} +
+ + +
{{/usefirms}} -
- - - - -
- +
+ + + + +
+
@@ -120,7 +120,7 @@

Расходная накладная

Добавить позицию - + @@ -168,7 +168,7 @@

Расходная накладная

- + @@ -184,13 +184,15 @@

Расходная накладная

- + - + - @@ -319,7 +321,7 @@ - +
diff --git a/www/templates/pages/doc/goodsreceipt.html b/www/templates/pages/doc/goodsreceipt.html index e775647f9..d68cb6343 100644 --- a/www/templates/pages/doc/goodsreceipt.html +++ b/www/templates/pages/doc/goodsreceipt.html @@ -24,22 +24,22 @@

Приходная накладная

Добавить нового
- {{#usefirms}} -
- - -
+ {{#usefirms}} +
+ + +
{{/usefirms}} -
- - - - -
+
+ + + + +
@@ -64,8 +64,8 @@

Приходная накладная

- {{#useval}} - + {{#useval}} +
- {{/useval}} - + {{/useval}} +
@@ -96,7 +96,7 @@

Приходная накладная

Название Код Ед. Всего:Всего:
Стоимость доставки:Стоимость доставки:
- + @@ -151,7 +151,8 @@

Приходная накладная

- + {{/useval}} @@ -261,7 +262,7 @@ - +
@@ -66,7 +66,7 @@

Счет-фактура

-
+
- - -
+
+ + +
{{/usefirms}} -
- - - - -
+
+ + + + +
@@ -47,8 +47,8 @@

Счет входящий

- {{#useval}} - + {{#useval}} +
- {{/useval}} + {{/useval}}
- - - При проведении сформируется документ Оприходование товара. - Если включена поддержка филиалов документ не будет проведен и ему не будет присвоен автор пока пользовтель, - имеющий права работы с целевым филиалом, не откроет и не сохранит или проведет созданый документ. + + + При проведении сформируется документ Оприходование товара. + Если включена поддержка филиалов документ не будет проведен и ему не будет присвоен автор пока + пользовтель, + имеющий права работы с целевым филиалом, не откроет и не сохранит или проведет созданый + документ.
@@ -158,14 +160,14 @@

Ввод товара

$('#addcode').click() } } - - function onItem(ele) { - - if (event.key === 'Enter' || event.keyCode == 13) { - // alert($('#barcode').val()); - $('#saverow').click() - } - } + + function onItem(ele) { + + if (event.key === 'Enter' || event.keyCode == 13) { + // alert($('#barcode').val()); + $('#saverow').click() + } + } diff --git a/www/templates/pages/doc/serviceact.html b/www/templates/pages/doc/serviceact.html index cec5498de..43e457b45 100644 --- a/www/templates/pages/doc/serviceact.html +++ b/www/templates/pages/doc/serviceact.html @@ -26,23 +26,23 @@

Акт выполненых работ Добавить нового

{{#usefirms}} -
- - -
+
+ + +
{{/usefirms}} -
- - - - -
- - +
+ + + + +
+ +
@@ -91,7 +91,7 @@

Акт выполненых работ

- + diff --git a/www/templates/pages/doc/task.html b/www/templates/pages/doc/task.html index 2c0310004..ef65ebb91 100644 --- a/www/templates/pages/doc/task.html +++ b/www/templates/pages/doc/task.html @@ -41,7 +41,7 @@

Наряд на выполнение работ - +
diff --git a/www/templates/pages/firmlist.html b/www/templates/pages/firmlist.html index 1886ee924..fa179e7d4 100644 --- a/www/templates/pages/firmlist.html +++ b/www/templates/pages/firmlist.html @@ -7,17 +7,17 @@

Список компаний

- + Добавить

Наименование Код Ед.
Курс валюты:
ОписаниеСтоимостьСтоимость
- + - + @@ -32,12 +32,12 @@

Список компаний

-
- - - Вводится если название магазина отличается от названия компании -
-
+
+ + + Вводится если название магазина отличается от названия компании +
+
@@ -48,7 +48,33 @@

Список компаний

-
+
+
+ + +
+
+ + +
+
+ + + Путь к файлу логотипа относительно корня сайта. Например + '/upload/logo.png' +
+
+ + + Путь к изображению печати относительно корня сайта. +
+
+ + + Путь к изображению относительно корня сайта. +
+ +
diff --git a/www/templates/pages/options.html b/www/templates/pages/options.html index 5d135bcf7..7ed17c30d 100644 --- a/www/templates/pages/options.html +++ b/www/templates/pages/options.html @@ -22,7 +22,8 @@

Настройки системы

- Введите наименования типов цен. Ненужные поля оставте пустыми + Введите наименования типов цен. Ненужные поля оставте + пустыми
@@ -46,28 +47,29 @@

Настройки системы

-
+
- Используется если не задана цена в товаре или в категории товара + Используется если не задана цена в товаре или в категории + товара
- Используется для сумм прописью в печатных формах. + Используется для сумм прописью в печатных формах.
@@ -123,59 +125,59 @@

Настройки системы

- +
- +
- +
- {{#useval}} -

Курсы валют

- + {{#useval}} +

Курсы валют

+
- -
+ +
- -
+ +
- - + +
-
+
- - + +
-
+
- +
-
- - {{/useval}} - +
+ + {{/useval}} + {{^usefirms}}

Данные о компании

-
+
@@ -188,7 +190,8 @@

Данные о компании

- Вводится если название магазина отличается от названия компании + Вводится если название магазина отличается от названия + компании
@@ -211,25 +214,26 @@

Данные о компании

- Путь к файлу логотипа относительно корня сайта. Например '/upload/logo.png' + Путь к файлу логотипа относительно корня сайта. Например + '/upload/logo.png'
- Путь к изображению печати относительно корня сайта. -
+ Путь к изображению печати относительно корня сайта. +
- Путь к изображению относительно корня сайта. + Путь к изображению относительно корня сайта.
- {{/usefirms}} - + {{/usefirms}} +

Настройка принтера

Настройки узкого принтера для печати чеков и этикеток
diff --git a/www/templates/pages/reference/contractlist.html b/www/templates/pages/reference/contractlist.html index 5ce0ec336..84377c8c9 100644 --- a/www/templates/pages/reference/contractlist.html +++ b/www/templates/pages/reference/contractlist.html @@ -14,14 +14,14 @@

Договора

- + {{#usefirms}} - + - {{/usefirms}} + {{/usefirms}}
@@ -38,22 +38,25 @@

Договора

- {{#usefirms}} {{/usefirms}} + {{#usefirms}} + + {{/usefirms}} - - + + - - - - {{#usefirms}} {{/usefirms}} - - - - + + + + {{#usefirms}} + + {{/usefirms}} + + +
Название
Номер Дата КонтрагентКомпанияКомпанияОплата
Договора -
+
- +
- +
{{#usefirms}}
@@ -92,20 +95,20 @@

Договора

- {{/usefirms}} + {{/usefirms}}
-
- - - - - -
+
+ + + + + +
diff --git a/www/templates/pages/reference/customerlist.html b/www/templates/pages/reference/customerlist.html index 2f29a440f..cb4a635bf 100644 --- a/www/templates/pages/reference/customerlist.html +++ b/www/templates/pages/reference/customerlist.html @@ -27,7 +27,7 @@

Справочник контрагентов

Добавить контрагента
- +
@@ -207,7 +207,7 @@
Прикрепленные файлы
- +
diff --git a/www/templates/pages/reference/employeelist.html b/www/templates/pages/reference/employeelist.html index cb66bf99a..e09a31fba 100644 --- a/www/templates/pages/reference/employeelist.html +++ b/www/templates/pages/reference/employeelist.html @@ -9,7 +9,7 @@

Справочник сотрудников

Добавить -
+
diff --git a/www/templates/pages/reference/itemlist.html b/www/templates/pages/reference/itemlist.html index 1d18b69c4..75055ae5d 100644 --- a/www/templates/pages/reference/itemlist.html +++ b/www/templates/pages/reference/itemlist.html @@ -9,17 +9,18 @@
-

Справочник товаров - -

+
ФИО
+
{{#useimages}} @@ -50,10 +51,11 @@

Справочник товаров

- - {{#usesnumber}} {{/usesnumber}} - - + + {{#usesnumber}} + + {{/usesnumber}} + @@ -76,10 +78,13 @@

Справочник товаров

- - - {{#usesnumber}} {{/usesnumber}} - + + + {{#usesnumber}} + + {{/usesnumber}} + + + {{/note}} + {{#issue}} + + + + {{/issue}} +
Отп. цена Ячейка @@ -133,8 +138,9 @@

Редактирование товара

- Код товара должен быть уникальным. - Если используется код производителя, следует добавить бренд к коду например k123_имябренда + Код товара должен быть уникальным. + Если используется код производителя, следует добавить бренд к коду например + k123_имябренда
@@ -154,7 +160,8 @@

Редактирование товара

- Если задано то при уменьшении количества на складе меньше заданного + Если задано то при уменьшении количества на складе меньше + заданного товар появится в соответствующем виджете на главной странице
@@ -174,22 +181,23 @@

Редактирование товара

- - - {{#manlist}} -
+ + + {{#manlist}} + +
- {{#usesnumber}} + {{#usesnumber}}
- {{/usesnumber}} + {{/usesnumber}}
@@ -295,13 +303,13 @@

}); - function onSearch(ele) { + function onSearch(ele) { - if (event.key === 'Enter' || event.keyCode == 13) { - // alert($('#barcode').val()); - $('#filter').Submit() ; - } + if (event.key === 'Enter' || event.keyCode == 13) { + // alert($('#barcode').val()); + $('#filter').Submit(); } + } diff --git a/www/templates/pages/reference/servicelist.html b/www/templates/pages/reference/servicelist.html index 7cdbe12f4..98f43e082 100644 --- a/www/templates/pages/reference/servicelist.html +++ b/www/templates/pages/reference/servicelist.html @@ -25,7 +25,7 @@

Услуги, работы

Добавить - +
@@ -62,22 +62,22 @@

Услуги, работы

- Стоимость работ для заказчика + Стоимость работ для заказчика
- Расценки для начисления зарплат -
+ Расценки для начисления зарплат +
- Ориентировочное время при почасовой оплате -
+ Ориентировочное время при почасовой оплате +
diff --git a/www/templates/pages/reference/storelist.html b/www/templates/pages/reference/storelist.html index b557e1c23..b68df995d 100644 --- a/www/templates/pages/reference/storelist.html +++ b/www/templates/pages/reference/storelist.html @@ -9,7 +9,7 @@

Справочник складов

-
Название Цена
+
{{#usebranch}} diff --git a/www/templates/pages/register/gilist.html b/www/templates/pages/register/gilist.html index a2deac61e..0be65acc9 100644 --- a/www/templates/pages/register/gilist.html +++ b/www/templates/pages/register/gilist.html @@ -23,13 +23,13 @@

Журнал продаж

- {{#usefirms}} - - - - {{/usefirms}} + {{#usefirms}} + + + + {{/usefirms}} @@ -49,8 +49,10 @@

Журнал продаж

- {{#usefirms}} {{/usefirms}} - + {{#usefirms}} + + {{/usefirms}} + @@ -67,7 +69,9 @@

Журнал продаж

- {{#usefirms}} {{/usefirms}} + {{#usefirms}} + + {{/usefirms}} diff --git a/www/templates/pages/register/grlist.html b/www/templates/pages/register/grlist.html index a3271c1fc..46eb33dd7 100644 --- a/www/templates/pages/register/grlist.html +++ b/www/templates/pages/register/grlist.html @@ -23,13 +23,13 @@

Журнал закупок

- {{#usefirms}} - - - - {{/usefirms}} + {{#usefirms}} + + + + {{/usefirms}} @@ -48,12 +48,14 @@

Журнал закупок

- {{#usefirms}} {{/usefirms}} - + {{#usefirms}} + + {{/usefirms}} + - + @@ -65,8 +67,10 @@

Журнал закупок

- {{#usefirms}} {{/usefirms}} - + {{#usefirms}} + + {{/usefirms}} + diff --git a/www/templates/pages/register/itemlist.html b/www/templates/pages/register/itemlist.html index 0230dde70..8a3feb943 100644 --- a/www/templates/pages/register/itemlist.html +++ b/www/templates/pages/register/itemlist.html @@ -15,7 +15,7 @@

Товары на складе

+ onkeydown="onSearch()" zippy="searchkey"> @@ -171,13 +171,13 @@

}); - function onSearch(ele) { + function onSearch(ele) { - if (event.key === 'Enter' || event.keyCode == 13) { - // alert($('#barcode').val()); - $('#filter').Submit() ; - } + if (event.key === 'Enter' || event.keyCode == 13) { + // alert($('#barcode').val()); + $('#filter').Submit(); } + } diff --git a/www/templates/pages/register/tasklist.html b/www/templates/pages/register/tasklist.html index 3e0cfa10b..c0ec57262 100644 --- a/www/templates/pages/register/tasklist.html +++ b/www/templates/pages/register/tasklist.html @@ -126,17 +126,20 @@

Журнал нарядов

- - - diff --git a/www/templates/pages/report/custactivity.html b/www/templates/pages/report/custactivity.html index 639f259df..a297f6c00 100644 --- a/www/templates/pages/report/custactivity.html +++ b/www/templates/pages/report/custactivity.html @@ -5,7 +5,7 @@
-

Движение по контрагентам

+

Движение по контрагентам

Название Дата Заказ КлиентКомпанияКомпанияСумма Статус Дата ПоставщикКомпанияКомпанияСумма СтатусПримечание
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Роль     
+ +
+ + +
+

Роли пользователей

+ Добавить + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Роль     
+ +
+ + +
+

Редактирование роли

+ +
+ +
+
+ +   Отменить +
+ +
+
+

Редактирование доступа

+
-
-

Редактирование роли

- -
- - - -
-
- -   Отменить -
- -
- -
-

Редактирование доступа

-
- - -
- -
- -
- +
+ +
+ +
+ - - - - - + + + + + + + - + + @@ -86,139 +93,175 @@

Редактирование доступа

СтраницаТип
СтраницаТип +
-
+
  Отменить -
- -
- +
+ +
+
- - - - - - - - - - - {{#usesnumber}} - - {{/usesnumber}} - - - - - - - - - {{#ocstore}} - - {{/ocstore}} - - {{#shop}} - - {{/shop}} - {{#note}} - - {{/note}} - {{#issue}} - - {{/issue}} -
- Виджеты на главной странице
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- Доступ к модулям -
- - - -
- - - -
- - - -
- - - -
-
-
-
- - -
+ + + + + + + + + + + + + + + + + + + {{#usesnumber}} + + + + {{/usesnumber}} + + + + + + + + + + + + + + + + + + + {{#ocstore}} + + + + {{/ocstore}} -
-

Меню быстрого доступа

-
-
- -
+ Виджеты на главной странице
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ Доступ к модулям +
+ + + +
+ {{#shop}} + + - - - + + + + + {{/shop}} + {{#note}} + + -
-
-
+ + +
- + + +
-
+
+ - -   Отменить - - - - - - - + + \ No newline at end of file diff --git a/www/templates/pages/service/armpos.html b/www/templates/pages/service/armpos.html index f2dc35a65..7afd3d77a 100644 --- a/www/templates/pages/service/armpos.html +++ b/www/templates/pages/service/armpos.html @@ -15,13 +15,13 @@

        АРМ кассира

- {{#usefirms}} -
- - -
+ {{#usefirms}} +
+ + +
{{/usefirms}}
diff --git a/www/templates/pages/service/export.html b/www/templates/pages/service/export.html index 13571b604..5c275e714 100644 --- a/www/templates/pages/service/export.html +++ b/www/templates/pages/service/export.html @@ -6,89 +6,89 @@

Экспорт документов

-
+
- -
-
-
+ +
+
+
- + -
-
+
+
- + -
-
-
+
+ +
- -
-
+ + +
- + + +
+
- - -
-
- + + - -
+
+
- - - - - - - - - - - - - - - - - -
НомерДатаКонтрагентСумма
+ + + + + + + + + + + + + + + + + +
НомерДатаКонтрагентСумма
-
-
- -
- + + + + +

Экспорт номенклатуры

- - + +
+
@@ -122,7 +122,7 @@

Экспорт номенклатуры

Экспорт контрагентов

- +
diff --git a/www/templates/pages/service/import.html b/www/templates/pages/service/import.html index c8a48f0f8..2523866d1 100644 --- a/www/templates/pages/service/import.html +++ b/www/templates/pages/service/import.html @@ -276,9 +276,9 @@

Импорт контрагентов
diff --git a/www/templates/pages/userlogin.html b/www/templates/pages/userlogin.html index d29c35941..fd396c08e 100644 --- a/www/templates/pages/userlogin.html +++ b/www/templates/pages/userlogin.html @@ -42,7 +42,7 @@

- +
- +
- {{#isnewversion}} -
-
- Доступна новая версия {{newversion}} Открыть... - -
-
- {{/isnewversion}} + {{#isnewversion}} +
+
+ Доступна новая версия {{newversion}} Открыть... + +
+
+ {{/isnewversion}}
@@ -106,7 +107,7 @@
- {{curversion}} © zippy.com.ua + {{curversion}} © zippy.com.ua
diff --git a/www/templates/pages/userprofile.html b/www/templates/pages/userprofile.html index d18b37cc5..3d03f8fdf 100644 --- a/www/templates/pages/userprofile.html +++ b/www/templates/pages/userprofile.html @@ -50,7 +50,6 @@

Мой профиль

-
diff --git a/www/templates/pages/users.html b/www/templates/pages/users.html index b093571d5..95dcf2992 100644 --- a/www/templates/pages/users.html +++ b/www/templates/pages/users.html @@ -53,20 +53,20 @@

Редактирование пользователя

Если не меняется пароль существующего пользолвателя, оставте пустым - +
- +
- - + +
- {{#usebranch}} + {{#usebranch}}
@@ -80,15 +80,16 @@

Редактирование пользователя

{{/usebranch}} -
-
- - - -
-
- -
+
+
+ + + +
+
+ +
diff --git a/www/templates/printforms/doc/goodsissue.tpl b/www/templates/printforms/doc/goodsissue.tpl index 84d8b425f..619caaa23 100644 --- a/www/templates/printforms/doc/goodsissue.tpl +++ b/www/templates/printforms/doc/goodsissue.tpl @@ -8,24 +8,24 @@ {{#isfirm}} - + Продавец {{firm_name}} {{/isfirm}} - {{#iscontract}} + {{#iscontract}} - + Договор - {{contract}} от {{createdon}} + {{contract}} от {{createdon}} - {{/iscontract}} - - + {{/iscontract}} + + Списано с {{store_name}} @@ -49,24 +49,24 @@ Декларация - {{ship_number}} + {{ship_number}} Дата отправки - {{sent_date}} + {{sent_date}} Дата доставки - {{delivery_date}} + {{delivery_date}} Ответственный {{emp_name}} - + {{/isdelivery}} @@ -97,7 +97,7 @@ {{/_detail}} - {{weight}} + {{weight}} Итого: {{total}} @@ -109,15 +109,14 @@ {{paydisc}} {{/isdisc}} - {{#isdelivery}} + {{#isdelivery}} Стоимость доставки: {{delivery_cost}} {{/isdelivery}} - - - + + К оплате: {{payamount}} diff --git a/www/templates/printforms/doc/goodsreceipt.tpl b/www/templates/printforms/doc/goodsreceipt.tpl index e134600f7..0d36ffc73 100644 --- a/www/templates/printforms/doc/goodsreceipt.tpl +++ b/www/templates/printforms/doc/goodsreceipt.tpl @@ -8,22 +8,22 @@ {{#isfirm}} - + - Покупатель + Покупатель {{firm_name}} {{/isfirm}} - {{#iscontract}} + {{#iscontract}} - + - Договор - {{contract}} от {{createdon}} + Договор + {{contract}} от {{createdon}} - {{/iscontract}} + {{/iscontract}} Основание diff --git a/www/templates/printforms/doc/invoice.tpl b/www/templates/printforms/doc/invoice.tpl index c1c797a11..85871e979 100644 --- a/www/templates/printforms/doc/invoice.tpl +++ b/www/templates/printforms/doc/invoice.tpl @@ -1,13 +1,13 @@ - {{#islogo}} + {{#islogo}} - - - + - {{/islogo}} + {{/islogo}} @@ -23,33 +23,34 @@ - {{#isfirm}} + {{#iscontract}} - + - - + + - {{/isfirm}} - {{#iscontract}} + {{/iscontract}} + {{#isfirm}} - + - - + + - {{/iscontract}} - {{#isbank}} + {{/isfirm}} + + {{#isbank}} - + - - + + - {{/isbank}} + {{/isbank}} - + - + {{#isstamp}} + + {{/isstamp}} + + + +
- + + +
ПокупательEmail {{email}}
Продавец {{firm_name}} Договор{{contract}} от {{createdon}}
Договор {{contract}} от {{createdon}} Продавец{{firm_name}}
р/с {{bankacc}} в {{bank}} р/с{{bankacc}} в {{bank}}
Счет-фактура № {{document_number}} от {{date}} @@ -101,21 +102,21 @@ На сумму {{totalstr}}
- {{#isstamp}} - - {{/isstamp}} - - - - {{#issign}} - - {{/issign}} - - - + {{#issign}} + + {{/issign}} + + +
diff --git a/www/templates/printforms/doc/invoicecust.tpl b/www/templates/printforms/doc/invoicecust.tpl index c9e96176a..89279ca17 100644 --- a/www/templates/printforms/doc/invoicecust.tpl +++ b/www/templates/printforms/doc/invoicecust.tpl @@ -8,22 +8,22 @@ {{#isfirm}} - + - Покупатель + Покупатель {{firm_name}} {{/isfirm}} - {{#iscontract}} + {{#iscontract}} - + - Договор - {{contract}} от {{createdon}} + Договор + {{contract}} от {{createdon}} - {{/iscontract}} + {{/iscontract}}
Счет входящий № {{document_number}} от {{date}}

diff --git a/www/templates/printforms/doc/order.tpl b/www/templates/printforms/doc/order.tpl index c4ad002bc..8b5c92993 100644 --- a/www/templates/printforms/doc/order.tpl +++ b/www/templates/printforms/doc/order.tpl @@ -36,7 +36,7 @@ {{#_detail}} {{no}} - {{{tovar_name}}} + {{{tovar_name}}} {{tovar_code}} {{msr}} diff --git a/www/templates/printforms/doc/poscheck_bill.tpl b/www/templates/printforms/doc/poscheck_bill.tpl index 7806c3500..ca35770a1 100644 --- a/www/templates/printforms/doc/poscheck_bill.tpl +++ b/www/templates/printforms/doc/poscheck_bill.tpl @@ -1,4 +1,4 @@ - +
@@ -21,7 +21,7 @@ {{/shopname}} - + diff --git a/www/templates/printforms/doc/serviceact.tpl b/www/templates/printforms/doc/serviceact.tpl index fba5d7381..3d99abbcf 100644 --- a/www/templates/printforms/doc/serviceact.tpl +++ b/www/templates/printforms/doc/serviceact.tpl @@ -15,10 +15,10 @@ {{/isfirm}} - {{#iscontract}} + {{#iscontract}} @@ -33,7 +33,8 @@ {{/isdevice}} + Акт выполненых работ № {{document_number}} от {{date}} +
Чек {{document_number}}
{{address}} {{address}}
{{phone}}
- Договор: {{contract}} от {{createdon}} + Договор: {{contract}} от {{createdon}}
- Акт выполненых работ № {{document_number}} от {{date}}
@@ -59,7 +60,7 @@ {{/_detail}} Всего: - {{total}} + {{total}} К оплате: diff --git a/www/templates/printforms/doc/serviceact_bill.tpl b/www/templates/printforms/doc/serviceact_bill.tpl index cb658e632..63b137b93 100644 --- a/www/templates/printforms/doc/serviceact_bill.tpl +++ b/www/templates/printforms/doc/serviceact_bill.tpl @@ -1,4 +1,4 @@ - +
@@ -17,7 +17,7 @@ {{/shopname}} - + diff --git a/www/templates/printforms/doc/task.tpl b/www/templates/printforms/doc/task.tpl index 00c7347a3..ff9923fe0 100644 --- a/www/templates/printforms/doc/task.tpl +++ b/www/templates/printforms/doc/task.tpl @@ -1,7 +1,7 @@
Квитанция {{document_number}}
{{address}} {{address}}
{{phone}}
{{#pareaname}} @@ -76,7 +76,7 @@ - + {{/_detail2}} diff --git a/www/templates/printforms/emails/invoice.tpl b/www/templates/printforms/emails/invoice.tpl new file mode 100644 index 000000000..603d9c9af --- /dev/null +++ b/www/templates/printforms/emails/invoice.tpl @@ -0,0 +1,11 @@ +Здраствуйте, {{customer_name}} + +
+
+Во вложении счёт на оплату {{number}} от {{date}} на сумму {{amount}}. +
+
+С уважением, +{{firm_name}} + + \ No newline at end of file diff --git a/www/templates/printforms/item_tag.tpl b/www/templates/printforms/item_tag.tpl index 5ea2423a1..1d957db2f 100644 --- a/www/templates/printforms/item_tag.tpl +++ b/www/templates/printforms/item_tag.tpl @@ -1,7 +1,7 @@
-
- Наряд № {{document_number}} от {{document_date}} + Наряд № {{document_number}} от {{document_date}}
{{eq_name}}{{code}} {{code}}
+
- + diff --git a/www/templates/printforms/report/abc.tpl b/www/templates/printforms/report/abc.tpl index 42a4f1bd0..fec5897e1 100644 --- a/www/templates/printforms/report/abc.tpl +++ b/www/templates/printforms/report/abc.tpl @@ -1,5 +1,5 @@
{{name}} {{name}}
{{article}}
- + diff --git a/www/templates/printforms/report/custactivity.tpl b/www/templates/printforms/report/custactivity.tpl index 0143d8bd3..63c3c604d 100644 --- a/www/templates/printforms/report/custactivity.tpl +++ b/www/templates/printforms/report/custactivity.tpl @@ -2,7 +2,7 @@ @@ -18,36 +18,33 @@ - - + - {{#_detail}} + {{#_detail}} - - + {{/_detail}} - + - - + diff --git a/www/templates/printforms/report/custorder.tpl b/www/templates/printforms/report/custorder.tpl index 570f99970..8de6fef17 100644 --- a/www/templates/printforms/report/custorder.tpl +++ b/www/templates/printforms/report/custorder.tpl @@ -1,4 +1,4 @@ -

АВС анализ '{{type}}' c {{from}} по {{to}}

- Движение по контрагентам + Движение по контрагентам
ДатаПриход Расход
{{document_number}} {{date}}{{obin}} {{obout}}
Итого:{{tin}} {{tout}}
+
- + - + - - - + + + {{#_detail}} - + - - - - - + + + + {{/_detail}} @@ -110,17 +106,17 @@ {{#_type4}} - + - + - - + + {{#_detail}} @@ -130,9 +126,9 @@ - - - + + + {{/_detail}}
diff --git a/www/templates/printforms/report/emptask.tpl b/www/templates/printforms/report/emptask.tpl index 846a9157d..b672ece99 100644 --- a/www/templates/printforms/report/emptask.tpl +++ b/www/templates/printforms/report/emptask.tpl @@ -1,4 +1,4 @@ - +
- + - + - - + + {{#_detail}} - - + - - - + + + {{/_detail}} diff --git a/www/templates/printforms/report/itemactivity.tpl b/www/templates/printforms/report/itemactivity.tpl index 1309161d3..2b4b78bee 100644 --- a/www/templates/printforms/report/itemactivity.tpl +++ b/www/templates/printforms/report/itemactivity.tpl @@ -1,4 +1,4 @@ -
diff --git a/www/templates/printforms/report/income.tpl b/www/templates/printforms/report/income.tpl index d3b28497b..cf3201bfe 100644 --- a/www/templates/printforms/report/income.tpl +++ b/www/templates/printforms/report/income.tpl @@ -1,22 +1,21 @@ - - +
{{#_type1}} - + - - + + @@ -30,7 +29,7 @@ - + {{/_detail}} @@ -39,16 +38,15 @@ {{#_type2}} - + - - + - + {{#_detail}} @@ -57,9 +55,8 @@ - - - + + {{/_detail}}
- Период с {{datefrom}} по {{dateto}}

+ Период с {{datefrom}} по {{dateto}}

- Закупки по товарам

+ Закупки по товарам

НаименованиеКодНаименованиеКод Кол. На сумму{{code}} {{qty}}{{summa}} {{summa}}
- Закупки по поставщикам

+ Закупки по поставщикам

НаименованиеНаименование На сумму
{{name}}{{summa}} {{summa}}
@@ -67,28 +64,27 @@ {{#_type3}}
- Закупки по датам

+ Закупки по датам

ДатаДата На сумму
{{dt}}{{dt}}{{summa}} {{summa}}
+
- + {{/_detail}} diff --git a/www/templates/printforms/report/outcome.tpl b/www/templates/printforms/report/outcome.tpl index 5e0309ff3..e38265591 100644 --- a/www/templates/printforms/report/outcome.tpl +++ b/www/templates/printforms/report/outcome.tpl @@ -1,22 +1,21 @@ - -
@@ -34,7 +34,7 @@ {{in}} {{obin}} {{obout}}{{out}} {{out}} {{{documents}}}
+
{{#_type1}} - + - - + + @@ -32,13 +31,13 @@ - - {{#navarsign}} - - {{/navarsign}} - {{^navarsign}} - - {{/navarsign}} + + {{#navarsign}} + + {{/navarsign}} + {{^navarsign}} + + {{/navarsign}} {{/_detail}} @@ -47,18 +46,17 @@ {{#_type2}} - + - - + - + {{#_detail}} @@ -67,10 +65,9 @@ - - - - + + + {{/_detail}}
- Период с {{datefrom}} по {{dateto}}

+ Период с {{datefrom}} по {{dateto}}

- Продажи по товарам

+ Продажи по товарам

НаименованиеКодНаименованиеКод Кол. На сумму{{code}} {{qty}}{{summa}} {{navar}} {{navar}} {{summa}}{{navar}}{{navar}}
- Продажи по покупателям

+ Продажи по покупателям

НаименованиеНаименование На сумму Прибыль
{{name}}{{summa}} {{navar}} {{summa}}{{navar}}
@@ -78,30 +75,29 @@ {{#_type3}}
- Продажи по датам

+ Продажи по датам

ДатаДата На сумму
{{dt}}{{dt}}{{summa}} {{summa}}
- Услуги и работы

+ Услуги и работы

НаименованиеНаименование Кол. На сумму
{{qty}}{{summa}} {{summa}}
@@ -141,18 +137,17 @@ {{#_type5}} - Продажи по категориям

+ Продажи по категориям

- + - Наименование - + Наименование На сумму Прибыль - + {{#_detail}} @@ -161,10 +156,9 @@ {{name}} - - {{summa}} - {{navar}} - + {{summa}} + {{navar}} + {{/_detail}} diff --git a/www/templates/printforms/report/payactivity.tpl b/www/templates/printforms/report/payactivity.tpl index d0bff67ed..d31b5fadb 100644 --- a/www/templates/printforms/report/payactivity.tpl +++ b/www/templates/printforms/report/payactivity.tpl @@ -32,7 +32,7 @@ {{in}} {{obin}} {{obout}} - {{out}} + {{out}} {{/_detail}} @@ -44,7 +44,7 @@ {{tb}} {{tin}} {{tout}} - {{tend}} + {{tend}} diff --git a/www/templates/printforms/report/paybalance.tpl b/www/templates/printforms/report/paybalance.tpl index 7088ceb49..f046a0547 100644 --- a/www/templates/printforms/report/paybalance.tpl +++ b/www/templates/printforms/report/paybalance.tpl @@ -24,7 +24,7 @@ {{type}} - {{in}} + {{in}} {{/_detail}} @@ -32,7 +32,7 @@ Итого: - {{tin}} + {{tin}} @@ -48,7 +48,7 @@ {{type}} - {{out}} + {{out}} {{/_detail2}} @@ -56,14 +56,14 @@ Итого: - {{tout}} + {{tout}} Баланс: - {{total}} + {{total}} diff --git a/www/templates/printforms/report/price.tpl b/www/templates/printforms/report/price.tpl index bee896700..ba1a76a8a 100644 --- a/www/templates/printforms/report/price.tpl +++ b/www/templates/printforms/report/price.tpl @@ -1,4 +1,4 @@ - +
diff --git a/www/templates/printforms/report/prod.tpl b/www/templates/printforms/report/prod.tpl index dcc486f52..4e53c7558 100644 --- a/www/templates/printforms/report/prod.tpl +++ b/www/templates/printforms/report/prod.tpl @@ -1,4 +1,4 @@ -
+
diff --git a/www/templates/widgets/docview.html b/www/templates/widgets/docview.html index 15faa9a9f..c35a2aeb8 100644 --- a/www/templates/widgets/docview.html +++ b/www/templates/widgets/docview.html @@ -34,8 +34,8 @@ src="/assets/images/excel_32.png"> - + diff --git a/www/templates/widgets/itemsel.html b/www/templates/widgets/itemsel.html index 6c9a19636..0f7a46e24 100644 --- a/www/templates/widgets/itemsel.html +++ b/www/templates/widgets/itemsel.html @@ -12,14 +12,14 @@ - - - - {{#manlist}} - - + + + + {{#manlist}} + + diff --git a/www/templates_ua/emails/invoice.tpl b/www/templates_ua/emails/invoice.tpl deleted file mode 100644 index 535fb3a36..000000000 --- a/www/templates_ua/emails/invoice.tpl +++ /dev/null @@ -1,7 +0,0 @@ -Добрий день, {{customer_name}} -

- -З повагою, - {{firm_name}} - - \ No newline at end of file diff --git a/www/templates_ua/lang.json b/www/templates_ua/lang.json index 87b6a5c51..b82ea9ec6 100644 --- a/www/templates_ua/lang.json +++ b/www/templates_ua/lang.json @@ -203,38 +203,36 @@ "partmove": "Перемiщення партiй", "noaccesstopage": "Нема права доступу до сторiнки", "nodelusedfroup": "Не можна видаляти використовану групу", - "tobay": "Купити", - "toorder": "Замовити", - "isonstore": "В наявностi", - "fororder": "Для замовлення", + "tobay": "Купити", + "toorder": "Замовити", + "isonstore": "В наявностi", + "fororder": "Для замовлення", "cancelsell": "Знятий з продажу", "onlyadminaccess": "До сторiнки має доступ тiльки користувач admin", "onlyadminsaccess": "До сторiнки мають доступ тiльки користувачi з admins ", "onlyadminsuser": "Користувачами може керувати тiльки користувач з admins ", "notnumber": "Не введено номер", - "cnal" : "Готiвка", - "cbeznal" : "Безготiвка", - "ckredit" : "В кредит", - "creal" : "Пiд реалiзацiю", - "invalidcapcha" : "Невiрний код капчi", - "extralogin" : "Багато невдалих авторизацiй.", - "invalidloginalert" : "Багато невдалих авторизацiй. Адмiнiстратору системи вiдiслано попередження", - "garant" : "Гарантiя", - "repbyitems" : "По товарах", - "repbycat" : "По категорiях", - "repbybyers" : "По покупцях", - "repbydates" : "По датах", - "repbysellers" : "По постачальниках", - "repbyservices" : "Послуги, роботи", - "mall" : "Всi", - "mopen" : "Вiдкритi", - "msgtask" : "Коментар до завдання", - "msgreply" : "Вiдповiсти", - "onlyadminpage" : "До сторiнки має доступ тiльки адмiнiстратор", - "email_sent" : "Лист вiдправлено", - "emailinvsub" : "Рахунок до оплати номер %s ", - - + "cnal": "Готiвка", + "cbeznal": "Безготiвка", + "ckredit": "В кредит", + "creal": "Пiд реалiзацiю", + "invalidcapcha": "Невiрний код капчi", + "extralogin": "Багато невдалих авторизацiй.", + "invalidloginalert": "Багато невдалих авторизацiй. Адмiнiстратору системи вiдiслано попередження", + "garant": "Гарантiя", + "repbyitems": "По товарах", + "repbycat": "По категорiях", + "repbybyers": "По покупцях", + "repbydates": "По датах", + "repbysellers": "По постачальниках", + "repbyservices": "Послуги, роботи", + "mall": "Всi", + "mopen": "Вiдкритi", + "msgtask": "Коментар до завдання", + "msgreply": "Вiдповiсти", + "onlyadminpage": "До сторiнки має доступ тiльки адмiнiстратор", + "email_sent": "Лист вiдправлено", + "emailinvsub": "Рахунок до оплати номер %s ", "refreshed": "Оновлено", "sent": "Відправлено", "saved": "Збережено" diff --git a/www/templates_ua/modules/issue/pages/issuelist.html b/www/templates_ua/modules/issue/pages/issuelist.html index 9b9d99840..6ff330668 100644 --- a/www/templates_ua/modules/issue/pages/issuelist.html +++ b/www/templates_ua/modules/issue/pages/issuelist.html @@ -44,18 +44,19 @@

Список завдань

- - - - - - - - - - -
-
+ + + + + + + + + + +
+
@@ -68,7 +69,7 @@

Список завдань

- +

Редагувати   Вилучити @@ -106,8 +107,8 @@
Коментарі
x -
- +
+
@@ -116,14 +117,14 @@
Коментарі
style="width:400px;height:120px;">
+ +
@@ -172,9 +173,9 @@
Коментарі

- - + +

-

+
diff --git a/www/templates_ua/modules/issue/pages/projectlist.html b/www/templates_ua/modules/issue/pages/projectlist.html index 0f30d4e49..59c3d4f43 100644 --- a/www/templates_ua/modules/issue/pages/projectlist.html +++ b/www/templates_ua/modules/issue/pages/projectlist.html @@ -61,42 +61,43 @@

Проекти

-
- -
-
- -
- - -
-
- - -
-
- - -
-
-
-
- -
-
-
-
- -
-   - +
+ +
+
+ +
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+
+
+
+ +
+   + +
+ +
- -
-
- -
+ +
-
- +
+
- +
Скасувати  Зберегти diff --git a/www/templates_ua/modules/ocstore/options.html b/www/templates_ua/modules/ocstore/options.html index 201fb9161..6c609201e 100644 --- a/www/templates_ua/modules/ocstore/options.html +++ b/www/templates_ua/modules/ocstore/options.html @@ -36,21 +36,22 @@

Налаштування підключення

- Ціна для оновлення в магазині - + Ціна для оновлення в магазині +
- Замість замовлення створювати і автоматично проводити видаткову накладну. - Використовуеться якщо замовлення обробляються на стороні IМ. -
+ Замість замовлення створювати і автоматично проводити видаткову + накладну. + Використовуеться якщо замовлення обробляються на стороні IМ. +
- Iмпортувати клiентiв з IМ в довiдник контрагентiв. -
- + Iмпортувати клiентiв з IМ в довiдник контрагентiв. +
+
diff --git a/www/templates_ua/modules/ocstore/orders.html b/www/templates_ua/modules/ocstore/orders.html index a1c74ea86..261fb065b 100644 --- a/www/templates_ua/modules/ocstore/orders.html +++ b/www/templates_ua/modules/ocstore/orders.html @@ -56,27 +56,26 @@

Імпорт замовлень

diff --git a/www/templates_ua/modules/shop/pages/aboutus.html b/www/templates_ua/modules/shop/pages/aboutus.html index ff6cbfba8..c1968aab8 100644 --- a/www/templates_ua/modules/shop/pages/aboutus.html +++ b/www/templates_ua/modules/shop/pages/aboutus.html @@ -1,10 +1,11 @@ - -
-
+ +
+
+
- {{{aboutus}}} -
-
- + {{{aboutus}}} +
+
+ \ No newline at end of file diff --git a/www/templates_ua/modules/shop/pages/base.html b/www/templates_ua/modules/shop/pages/base.html index 4709ef829..135b0c1f7 100644 --- a/www/templates_ua/modules/shop/pages/base.html +++ b/www/templates_ua/modules/shop/pages/base.html @@ -1,105 +1,107 @@ - - - - Онлайн каталог - - - + + + + Онлайн каталог + + + - - + + + + + + + + - - - - - - + + - - + - + + + + + - - - - - +
+
+ +
+