Skip to content

Commit

Permalink
Merge pull request #144 from leon-mbs/dev
Browse files Browse the repository at this point in the history
4.9.0
  • Loading branch information
leon-mbs authored Apr 5, 2021
2 parents 77cdf74 + 65113fa commit 9409577
Show file tree
Hide file tree
Showing 186 changed files with 6,108 additions and 4,235 deletions.
Binary file added 1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
CHANGELOG
=========
### v4.9.0 (2021-04-03)
* Упрощена работа с онлайн-каталогом
* Добавлена иерархия категорий товаров (используется в онлайн-каталоге)
* Настройка в справочнике ТМЦ автоматического пориходования и списания на производство согласно комплектации.
* Исправления и мелкие дополнения

Для обновления версии обновить папки app, templates, templates_ua,
выполнить update485to490.sql

### v4.8.5 (2021-03-12)
* В справочник контрагентов добавлена возможность работы с лидами
* Обновление календаря в нарядах и табеле
Expand Down
271 changes: 97 additions & 174 deletions db/db.sql

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions db/temp.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*


/*
INSERT INTO `metadata` ( `meta_type`, `description`, `meta_name`, `menugroup`, `disabled`) VALUES( 5, 'ÀÐÌ êàññèðà (îáùåïèò)', 'ARMFood', '', 0);


CREATE TABLE `empacc` (
`ea_id` int(11) NOT NULL AUTO_INCREMENT,
`emp_id` int(11) NOT NULL,
Expand All @@ -27,5 +29,5 @@ CREATE TABLE `prodproc` (



*/


*/
47 changes: 47 additions & 0 deletions db/update485to490.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
ALTER TABLE `entrylist` CHANGE `extcode` `extcode` DECIMAL(11,2) NULL DEFAULT 0;


ALTER VIEW entrylist_view AS
select
entrylist.entry_id AS entry_id,
entrylist.document_id AS document_id,
entrylist.amount AS amount,
entrylist.quantity AS quantity,
documents.customer_id AS customer_id,
entrylist.extcode AS extcode,
entrylist.stock_id AS stock_id,
entrylist.service_id AS service_id,
store_stock.item_id AS item_id,
store_stock.partion AS partion,
documents.document_date AS document_date
from
((entrylist left join store_stock on((entrylist.stock_id = store_stock.stock_id))) join documents on((entrylist.document_id = documents.document_id)));

ALTER TABLE `item_cat` ADD `parent_id` INT NULL DEFAULT '0' ;



ALTER TABLE `shop_attributes` CHANGE `group_id` `cat_id` INT(11) NOT NULL;
ALTER TABLE `shop_attributevalues` CHANGE `product_id` `item_id` INT(11) NOT NULL;
ALTER TABLE `shop_prod_comments` CHANGE `product_id` `item_id` INT(11) NOT NULL;


ALTER TABLE `shop_attributes` CHANGE `valueslist` `valueslist` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `shop_attributes` ADD `showincompare` TINYINT(1) NOT NULL DEFAULT '0' ;

ALTER VIEW shop_attributes_view AS
select
shop_attributes.attribute_id AS attribute_id,
shop_attributes.attributename AS attributename,
shop_attributes.cat_id AS cat_id,
shop_attributes.attributetype AS attributetype,
shop_attributes.valueslist AS valueslist,
shop_attributes.showinlist AS showinlist,
shop_attributes.showincompare AS showincompare,
shop_attributes_order.ordern AS ordern
from
(shop_attributes join shop_attributes_order on(((shop_attributes.attribute_id = shop_attributes_order.attr_id) and (shop_attributes.cat_id = shop_attributes_order.pg_id))))
order by
shop_attributes_order.ordern;


67 changes: 67 additions & 0 deletions www/app/api/docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ public function branchlist() {
return $list;
}

//список производственных участвков
public function parealist() {
$list = \App\Entity\ProdArea::findArray('pa_name', '', 'pa_name');

return $list;
}


//записать ордер
public function createorder($args) {
Expand Down Expand Up @@ -228,4 +235,64 @@ public function cancel($args) {
}




// /api/docs
// {"jsonrpc": "2.0", "method": "createprodissue", "params": { "store_id":"1","parea":"1","items":[{"item_code":"cbs500-1","quantity":2.1},{"item_code":"ID0018","quantity":2}] }, "id": 1}

//Списание ТМЦ в производсво
public function createprodissue($args) {


if ($args['store_id'] > 0) {
$store = \App\Entity\Store::load($args['store_id']);
if ($store == null) {
throw new \Exception('Не указан склад');
}
}
$doc = Document::create('ProdIssue');
$doc->document_number = $doc->nextNumber();
$doc->document_date = time();
$doc->headerdata['store'] = $args['store_id'];
$doc->headerdata['parea'] = $args['parea'];
$doc->state = Document::STATE_NEW;

$doc->notes = @base64_decode($args['description']);
$details = array();
$total = 0;
if (is_array($args['items']) && count($args['items']) > 0) {
foreach ($args['items'] as $it) {
if (strlen($it['item_code']) == 0) {
throw new \Exception(H::l("apientercode"));
}
$item = Item::getFirst("disabled<> 1 and item_code=" . Item::qstr($it['item_code']));

if ($item instanceof Item) {

$item->quantity = $it['quantity'];

$details[$item->item_id] = $item;
} else {
throw new \Exception(H::l("apiitemnotfound", $it['code']));
}
}
} else {
throw new \Exception(H::l("apinoitems"));
}
if (count($details) == 0) {
throw new \Exception(H::l("apinoitems"));
}
$doc->packDetails('detaildata', $details);

$doc->amount = 0;


$doc->save();

$doc->updateStatus(Document::STATE_EXECUTED);


return $doc->document_number;
}

}
10 changes: 10 additions & 0 deletions www/app/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public function Route($uri) {
"aboutus" => "\\App\\Modules\\Shop\\Pages\\AboutUs",
"delivery" => "\\App\\Modules\\Shop\\Pages\\Delivery",
"contact" => "\\App\\Modules\\Shop\\Pages\\Contact",
"news" => "\\App\\Modules\\Shop\\Pages\\News",
"scat" => "\\App\\Modules\\Shop\\Pages\\Main",
"pcat" => "\\App\\Modules\\Shop\\Pages\\Catalog",
"project" => "\\App\\Modules\\Issue\\Pages\\ProjectList",
Expand All @@ -134,9 +135,18 @@ public function Route($uri) {
}
}
}
return;
}
if (strlen($pages[$uri]) > 0) {
self::$app->LoadPage($pages[$uri]);
return;
}


$prod = \App\Modules\Shop\Entity\Product::loadSEF($uri);
if ($prod instanceof \App\Entity\Item) {
self::$app->LoadPage($pages['sp'], $prod->item_id);
return;
}
}

Expand Down
37 changes: 19 additions & 18 deletions www/app/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

namespace App;

class Calendar extends \Zippy\Html\HtmlComponent implements \Zippy\Interfaces\Requestable,\Zippy\Interfaces\AjaxRender
class Calendar extends \Zippy\Html\HtmlComponent implements \Zippy\Interfaces\Requestable, \Zippy\Interfaces\AjaxRender
{

private $event = null;
private $data = array();
private $view = 'dayGridMonth';


public function __construct($id ) {

public function __construct($id) {
parent::__construct($id);
$this->view = 'dayGridMonth' ;
}
$this->view = 'dayGridMonth';

}


public final function RenderImpl() {
global $_config;
$id = $this->getAttribute('id');
Expand All @@ -25,11 +25,11 @@ public final function RenderImpl() {
if ($_config['common']['lang'] == 'ua') {
$lang = 'ua';
}

if (count($this->data) > 0) {
$ev = ",events: [";
foreach ($this->data as $dt) {

$ev .= " { id : '{$dt->id}',
title : '{$dt->title}',
start : {$dt->start} ,
Expand Down Expand Up @@ -132,10 +132,10 @@ public final function RequestHandle() {
$action['enddelta'] = $action['enddelta'] / 1000;
}
if ($action['action'] == 'move') {
$action['years'] = $action['years'] ;
$action['month'] = $action['month'] ;
$action['days'] = $action['days'] ;
$action['ms'] = $action['ms']/1000 ;
$action['years'] = $action['years'];
$action['month'] = $action['month'];
$action['days'] = $action['days'];
$action['ms'] = $action['ms'] / 1000;
}

if ($this->event != null) {
Expand All @@ -151,7 +151,8 @@ public function setEvent(\Zippy\Interfaces\EventReceiver $receiver, $handler) {
public function setData($data) {
$this->data = $data;
}
public function AjaxAnswer() {

public function AjaxAnswer() {

return '';
}
Expand All @@ -165,9 +166,9 @@ class CEvent
public function __construct($id, $title, $start, $end, $color) {
$this->id = $id;
$this->title = $title;
$this->start = "new Date(".date("Y", $start).", ".( date("m", $start) -1).", ".date("d", $start).",".date("H", $start).",".date("i", $start).")" ;
$this->end = "new Date(".date("Y", $end).", ".( date("m", $end) -1).", ".date("d", $end).",".date("H", $end).",".date("i", $end).")" ;
// $this->end = date("Y-m-dTH:i", $end);
$this->start = "new Date(" . date("Y", $start) . ", " . (date("m", $start) - 1) . ", " . date("d", $start) . "," . date("H", $start) . "," . date("i", $start) . ")";
$this->end = "new Date(" . date("Y", $end) . ", " . (date("m", $end) - 1) . ", " . date("d", $end) . "," . date("H", $end) . "," . date("i", $end) . ")";
// $this->end = date("Y-m-dTH:i", $end);
$this->color = $color;
}

Expand Down
Loading

0 comments on commit 9409577

Please sign in to comment.