Skip to content

Commit

Permalink
Merge pull request #122 from leon-mbs/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
leon-mbs authored Jan 6, 2021
2 parents a7edc65 + b44d356 commit 072c251
Show file tree
Hide file tree
Showing 45 changed files with 804 additions and 861 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CHANGELOG
=========

### v4.8.1 (2021-01-10)
* Исправление ошибок
* Печать накладной на узком принтере


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

### v4.8.0 (2020-12-19)
* Добавлен модуль програмного РРО для отправки чеков в налоговую (Украина). Описание модуля
на оф. сайте.
Expand Down
34 changes: 17 additions & 17 deletions db/db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ CREATE TABLE `docstatelog` (
`hostname` varchar(64) NOT NULL,
PRIMARY KEY (`log_id`),
KEY `document_id` (`document_id`)
) AUTO_INCREMENT=1149 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=1199 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `docstatelog_view`;
/*!50001 DROP VIEW IF EXISTS `docstatelog_view`*/;
Expand Down Expand Up @@ -134,7 +134,7 @@ CREATE TABLE `documents` (
KEY `user_id` (`user_id`),
KEY `branch_id` (`branch_id`),
KEY `meta_id` (`meta_id`)
) AUTO_INCREMENT=310 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=331 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `documents_view`;
/*!50001 DROP VIEW IF EXISTS `documents_view`*/;
Expand Down Expand Up @@ -190,9 +190,9 @@ CREATE TABLE `entrylist` (
PRIMARY KEY (`entry_id`),
KEY `document_id` (`document_id`),
KEY `stock_id` (`stock_id`)
) AUTO_INCREMENT=802 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=821 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
ALTER DATABASE `zstore` CHARACTER SET utf8 COLLATE utf8_general_ci ;
;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
Expand All @@ -218,8 +218,8 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
ALTER DATABASE `zstore` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ;
ALTER DATABASE `zstore` CHARACTER SET utf8 COLLATE utf8_general_ci ;
;
;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
Expand All @@ -244,7 +244,7 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
ALTER DATABASE `zstore` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ;
;
DROP TABLE IF EXISTS `entrylist_view`;
/*!50001 DROP VIEW IF EXISTS `entrylist_view`*/;
SET @saved_cs_client = @@character_set_client;
Expand Down Expand Up @@ -335,7 +335,7 @@ CREATE TABLE `firms` (
`details` longtext NOT NULL,
`disabled` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`firm_id`)
) AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `images`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
Expand All @@ -346,7 +346,7 @@ CREATE TABLE `images` (
`mime` varchar(16) DEFAULT NULL,
`thumb` longblob,
PRIMARY KEY (`image_id`)
) AUTO_INCREMENT=48 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=50 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `issue_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
Expand Down Expand Up @@ -514,7 +514,7 @@ CREATE TABLE `items` (
KEY `item_code` (`item_code`),
KEY `itemname` (`itemname`),
KEY `cat_id` (`cat_id`)
) AUTO_INCREMENT=575 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=581 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `items_view`;
/*!50001 DROP VIEW IF EXISTS `items_view`*/;
Expand Down Expand Up @@ -694,7 +694,7 @@ CREATE TABLE `notifies` (
`sender_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`notify_id`),
KEY `user_id` (`user_id`)
) AUTO_INCREMENT=92 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=95 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `options`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
Expand Down Expand Up @@ -729,7 +729,7 @@ CREATE TABLE `paylist` (
`detail` longtext,
PRIMARY KEY (`pl_id`),
KEY `document_id` (`document_id`)
) AUTO_INCREMENT=264 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=291 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `paylist_view`;
/*!50001 DROP VIEW IF EXISTS `paylist_view`*/;
Expand Down Expand Up @@ -760,7 +760,7 @@ CREATE TABLE `poslist` (
`details` longtext NOT NULL,
`branch_id` int(11) DEFAULT '0',
PRIMARY KEY (`pos_id`)
) AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ppo_zformstat`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
Expand Down Expand Up @@ -927,7 +927,7 @@ CREATE TABLE `shop_products` (
`comments` int(11) DEFAULT '0',
PRIMARY KEY (`product_id`),
KEY `group_id` (`group_id`)
) AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `shop_products_view`;
/*!50001 DROP VIEW IF EXISTS `shop_products_view`*/;
Expand Down Expand Up @@ -966,7 +966,7 @@ CREATE TABLE `store_stock` (
`sdate` date DEFAULT NULL,
PRIMARY KEY (`stock_id`),
KEY `item_id` (`item_id`)
) AUTO_INCREMENT=573 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=575 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `store_stock_view`;
/*!50001 DROP VIEW IF EXISTS `store_stock_view`*/;
Expand Down Expand Up @@ -1014,7 +1014,7 @@ CREATE TABLE `timesheet` (
`t_break` smallint(6) DEFAULT '0',
PRIMARY KEY (`time_id`),
KEY `emp_id` (`emp_id`)
) AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4;
) DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `timesheet_view`;
/*!50001 DROP VIEW IF EXISTS `timesheet_view`*/;
Expand Down Expand Up @@ -1082,7 +1082,7 @@ CREATE TABLE `zformstat` (
`document_number` varchar(255) NOT NULL,
`amount3` decimal(10,2) NOT NULL,
PRIMARY KEY (`zf_id`)
) AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50001 DROP VIEW IF EXISTS `contracts_view`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
Expand Down
2 changes: 1 addition & 1 deletion www/app/api/orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\API;

/**
* Класс для Json RPC
* Пример для использования Json RPC
* пример вызова /api/Orders
*/
class Orders extends \App\JsonRPC
Expand Down
18 changes: 6 additions & 12 deletions www/app/api/pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,18 @@
namespace App\API;

/**
* Класс для работы с кассовыми апаратами
* Пример для создания произвольного класса через API
* пример вызова /api/Pos/Add/1
*/
class Pos
{

//Демо

public function Add($p) {
$error = "";
$xml = $_POST['data'];
$user = $_POST['user'];
$pass = $_REQUEST['pass'];

//$doc = new \App\Entity\Doc\RegisterReceipt();
// todo
// $doc->save();

//если POST
$request = file_get_contents('php://input');

return "";
echo "Hi";
}

}
2 changes: 1 addition & 1 deletion www/app/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function Route($uri) {

//для произвольной страницы
$params = array_slice($api, 3);
echo call_user_func_array(array($page, $api[2]), $params);
call_user_func_array(array($page, $api[2]), $params);
die;
} catch(\Throwable $e) {
global $logger;
Expand Down
41 changes: 41 additions & 0 deletions www/app/entity/doc/goodsissue.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,45 @@ protected function getNumberTemplate() {
return 'РН-000000';
}


public function generatePosReport() {

$detail = array();

foreach ($this->unpackDetails('detaildata') as $item) {


$detail[] = array(
"tovar_name" => $item->itemname,
"quantity" => H::fqty($item->quantity),
"price" => H::fa($item->price),
"amount" => H::fa($item->quantity * $item->price)
);
}

$firm = H::getFirmData($this->firm_id, $this->branch_id);

$header = array('date' => H::fd($this->document_date),
"_detail" => $detail,
"firm_name" => $firm["firm_name"],
"phone" => $firm["phone"],
"customer_name" => strlen($this->headerdata["customer_name"]) > 0 ? $this->headerdata["customer_name"] : false,
"document_number" => $this->document_number,
"total" => H::fa($this->amount)

);


$report = new \App\Report('doc/goodsissue_bill.tpl');

$html = $report->generate($header);

return $html;
}


public function supportedExport() {
return array(self::EX_EXCEL, self::EX_POS, self::EX_PDF);
}

}
2 changes: 1 addition & 1 deletion www/app/entity/doc/invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function Execute() {
}

if ($this->headerdata['payment'] > 0 && $this->payed > 0) {
\App\Entity\Pay::addPayment($this->document_id, $this->document_date, $this->payed, $this->headerdata['payment'], \App\Entity\Pay::PAY_BASE_OUTCOME);
\App\Entity\Pay::addPayment($this->document_id, $this->document_date, $this->payed, $this->headerdata['payment'], \App\Entity\Pay::PAY_BASE_INCOME);
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion www/app/entity/doc/retcustissue.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function Execute() {

}
if ($this->headerdata['payment'] > 0 && $this->payed > 0) {
\App\Entity\Pay::addPayment($this->document_id, $this->document_date, $this->payed, $this->headerdata['payment'], \App\Entity\Pay::PAY_BASE_OUTCOME);
\App\Entity\Pay::addPayment($this->document_id, $this->document_date, $this->payed, $this->headerdata['payment'], \App\Entity\Pay::PAY_BASE_INCOME);
$this->payamount = $this->amount;
}

Expand Down
2 changes: 1 addition & 1 deletion www/app/entity/pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static function addPayment($document_id, $paydate, $amount, $mf_id, $type
$pay = new \App\Entity\Pay();
$pay->mf_id = $mf_id;
$pay->document_id = $document_id;
$pay->amount = ($amount * $mf->btran / 100);
$pay->amount = 0-($amount * $mf->btran / 100);
$pay->paytype = Pay::PAY_BASE_OUTCOME;
$pay->paydate = $paydate;
$pay->notes = \App\Helper::l('bankproc');
Expand Down
2 changes: 1 addition & 1 deletion www/app/modules/ppo/ppohelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static function send($data, $type, $server, $port, $encrypted) {

if ($signed['success'] == true) {


file_put_contents("d:/leon/denwer72/home/local.gost/www/signedask",$signed['data']) ;
$request = curl_init();

curl_setopt_array($request, [
Expand Down
Loading

0 comments on commit 072c251

Please sign in to comment.