Skip to content

Commit

Permalink
Merge pull request #13 from leon-mbs/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-mbs authored Jun 19, 2019
2 parents b7a56d1 + 8a1c8f9 commit 4453f6e
Show file tree
Hide file tree
Showing 201 changed files with 5,078 additions and 2,596 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
CHANGELOG
=========
### v1.3.5 (2019-06-05)
### v1.4.0 (2019-06-15)
* учет по партиям поставщика
* учет платежей


### v1.3.4 (2019-05-05)
* модуль интеграции с опенкарт
Expand Down
167 changes: 134 additions & 33 deletions db/db.sql

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions db/initdata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ INSERT INTO `users` ( `userlogin`, `userpass`, `createdon`, `email`, `acl`, `sma


INSERT INTO `stores` ( `storename`, `description`) VALUES( 'Основной склад', '');
INSERT INTO `mfund` (`mf_id`, `mf_name`, `description`) VALUES(2, 'Касса', 'Основная касса');


INSERT INTO `options` (`optname`, `optvalue`) VALUES('common', 'a:13:{s:8:"firmname";s:20:"Наша фирма";s:8:"defstore";s:2:"19";s:9:"qtydigits";s:1:"2";s:5:"cdoll";s:1:"2";s:5:"ceuro";s:1:"5";s:4:"crub";s:3:"0.4";s:6:"price1";s:18:"Розничная";s:6:"price2";s:14:"Оптовая";s:6:"price3";s:0:"";s:6:"price4";s:0:"";s:6:"price5";s:0:"";s:6:"useset";b:0;s:6:"useval";b:0;}');
INSERT INTO `options` (`optname`, `optvalue`) VALUES('common', 'a:14:{s:8:"firmname";s:20:"Наша фирма";s:8:"defstore";s:2:"19";s:9:"qtydigits";s:1:"0";s:5:"cdoll";s:1:"2";s:5:"ceuro";s:1:"5";s:4:"crub";s:3:"0.4";s:6:"price1";s:18:"Розничная";s:6:"price2";s:14:"Оптовая";s:6:"price3";s:0:"";s:6:"price4";s:0:"";s:6:"price5";s:0:"";s:6:"useset";b:0;s:10:"usesnumber";b:0;s:6:"useval";b:0;}');
INSERT INTO `options` (`optname`, `optvalue`) VALUES('shop', 'N;');

INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(1, 4, 'Склады', 'StoreList', 'Товары', '', 0, 0);
Expand All @@ -30,12 +31,10 @@ INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `men
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(16, 1, 'Возврат от покупателя', 'ReturnIssue', 'Продажи', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(18, 3, 'Работы, наряды', 'TaskList', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(19, 1, 'Наряд', 'Task', 'Производство', 'Наряд на выполнение работы, задачи', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(20, 2, 'Оплата по нарядам', 'EmpTask', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(20, 2, 'Оплата по нарядам', 'EmpTask', 'Платежи', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(21, 2, 'Закупки', 'Income', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(22, 2, 'Продажи', 'Outcome', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(23, 5, 'Бренды', 'Manufacturers', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(24, 5, 'Группы товаров', 'GroupList', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(26, 5, 'Товары', 'ProductList', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(46, 4, 'Денежные счета', 'MFList', '', 'кассы и банковские счета', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(27, 3, 'Заказы клиентов', 'OrderList', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(28, 1, 'Заказ', 'Order', 'Продажи', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(30, 1, 'Оприходование с производства', 'ProdReceipt', 'Производство', 'Оприходование готовой продукции и полуфабрикатов с производства на склад. ', 0, 0);
Expand All @@ -52,3 +51,9 @@ INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `men
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(43, 1, 'Заказ (услуги)', 'ServiceOrder', 'Продажи', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(44, 1, 'Перекомплектация ТМЦ', 'TransItem', 'Склад', 'Документ преобразовывает ТМЦ с одной формы упаковки в другую. Например с бочек в литры или ящиков в пачки', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(45, 3, 'Производство', 'ProdList', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(47, 3, 'Журнал платежей', 'PayList', '', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(48, 2, 'Движение по денежным счетам', 'PayActivity', 'Платежи', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(49, 1, 'Перевод денежных средств', 'MoveMoney', 'Платежи', ' ', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(50, 1, 'Приходный ордер', 'IncomeMoney', 'Платежи', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(51, 1, 'Расходный ордер', 'OutcomeMoney', 'Платежи', '', 0, 0);
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `notes`, `disabled`, `smartmenu`) VALUES(52, 3, 'Расчеты с контрагентами', 'PayCustList', '', '', 0, 0);
2 changes: 0 additions & 2 deletions www/app/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ public static function checkShowReg($reg) {
return false;
}



//проверка на доступ к документу
public static function checkShowDoc($doc, $inreg = false) {
$user = System::getUser();
Expand Down
16 changes: 7 additions & 9 deletions www/app/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ public function Route($uri) {
$arr = explode('/', $uri);

$pages = array(
"shop" => "\\App\\Shop\\Pages\\Main",
"shop" => "\\App\\Modules\\Shop\\Pages\\Main",
"store" => "\\App\\Pages\\Main",
"sp" => "\\App\\Shop\\Pages\\ProductView",
"aboutus" => "\\App\\Shop\\Pages\\AboutUs",
"delivery" => "\\App\\Shop\\Pages\\Delivery",
"contact" => "\\App\\Shop\\Pages\\Contact",
"sp" => "\\App\\Modules\\Shop\\Pages\\ProductView",
"aboutus" => "\\App\\Modules\\Shop\\Pages\\AboutUs",
"delivery" => "\\App\\Modules\\Shop\\Pages\\Delivery",
"contact" => "\\App\\Modules\\Shop\\Pages\\Contact",
"simage" => "\\App\\Pages\\LoadImage",
"scat" => "\\App\\Shop\\Pages\\Main",
"pcat" => "\\App\\Shop\\Pages\\Catalog"
"scat" => "\\App\\Modules\\Shop\\Pages\\Main",
"pcat" => "\\App\\Modules\\Shop\\Pages\\Catalog"
);

if (strlen($pages[$arr[0]]) > 0) {
Expand All @@ -128,6 +128,4 @@ public function Route($uri) {
}
}



}
16 changes: 16 additions & 0 deletions www/app/dataitem.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,20 @@ public function getID() {
return $this->id;
}

/**
* возвращает список DataItem заполненый с запроса
*
* @param mixed $sql
*/
public static function query($sql){
$conn = \ZDB\DB::getConnect();
$list = array();

$rc = $conn->Execute($sql);
foreach($rc as $row){
$list[] = new DataItem($row);
}
return $list;
}

}
10 changes: 9 additions & 1 deletion www/app/entity/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Entity;

/**
* Клас-сущность категория товара
* Класс-сущность категория товара
*
* @table=item_cat
* @keyfield=cat_id
Expand All @@ -14,4 +14,12 @@ protected function init() {
$this->cat_id = 0;
}

protected function beforeDelete() {

$conn = \ZDB\DB::getConnect();
$sql = " select count(*) from items where cat_id = {$this->cat_id}";
$cnt = $conn->GetOne($sql);
return ($cnt > 0) ? "Категория используется в товарах" : "";
}

}
7 changes: 3 additions & 4 deletions www/app/entity/customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ public function beforeDelete() {
$sql = " select count(*) from entrylist where customer_id = {$this->customer_id}";
$cnt = $conn->GetOne($sql);
if ($cnt > 0)
return false;
return "На контрагента есть ссылки в документах";
$sql = " select count(*) from documents where customer_id = {$this->customer_id} ";
$cnt = $conn->GetOne($sql);
if ($cnt > 0)
return false;
return true;
;
return "На контрагента есть ссылки в документах";
return "";
}

/**
Expand Down
Loading

0 comments on commit 4453f6e

Please sign in to comment.