-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from leon-mbs/dev
v4.4.0
- Loading branch information
Showing
96 changed files
with
2,239 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ SET NAMES 'utf8'; | |
|
||
|
||
INSERT INTO `users` ( `userlogin`, `userpass`, `createdon`, `email`, `acl`, `disabled`, `options`) VALUES( 'admin', '$2y$10$GsjC.thVpQAPMQMO6b4Ma.olbIFr2KMGFz12l5/wnmxI1PEqRDQf.', '2017-01-01', '[email protected]', 'a:8:{s:7:"acltype";i:0;s:6:"onlymy";i:0;s:7:"aclview";N;s:7:"acledit";N;s:6:"aclexe";N;s:9:"aclbranch";N;s:7:"widgets";N;s:7:"modules";N;}', 0, 'a:4:{s:9:"smartmenu";s:3:"7,8";s:8:"defstore";s:2:"19";s:5:"defmf";s:1:"2";s:8:"pagesize";s:2:"15";}'); | ||
INSERT INTO `roles` ( `rolename`, `acl`) VALUES ( 'admins', NULL); | ||
INSERT INTO `roles` ( `rolename`, `acl`) VALUES( 'admins', 'a:7:{s:7:"aclview";N;s:7:"acledit";N;s:6:"aclexe";N;s:9:"aclcancel";N;s:7:"widgets";N;s:7:"modules";N;s:9:"smartmenu";s:1:"8";}'); | ||
UPDATE users set role_id=(select role_id from roles where rolename='admins' limit 0,1 ) where userlogin='admin' ; | ||
|
||
|
||
|
@@ -12,7 +12,7 @@ INSERT INTO `mfund` (`mf_id`, `mf_name`, `description`) VALUES(2, 'Касса', | |
|
||
INSERT INTO `options` (`optname`, `optvalue`) VALUES('common', 'a:16:{s:9:"qtydigits";s:1:"0";s:8:"amdigits";s:1:"0";s:11:"partiontype";s:1:"1";s:4:"lang";s:2:"ru";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:8:"defprice";s:2:"10";s:11:"autoarticle";i:1;s:6:"useset";i:0;s:10:"usesnumber";i:0;s:10:"usescanner";i:0;s:9:"useimages";i:0;s:9:"usebranch";i:0;}'); | ||
INSERT INTO `options` (`optname`, `optvalue`) VALUES('shop', 'N;'); | ||
INSERT INTO `options` (`optname`, `optvalue`) VALUES('firm', 'a:5:{s:8:"firmname";s:20:"Наша фирма";s:8:"shopname";s:14:"Магазин";s:5:"phone";s:0:"";s:7:"address";s:0:"";s:3:"inn";s:0:"";}'); | ||
INSERT INTO `options` (`optname`, `optvalue`) VALUES('firm', 'a:5:{s:9:"firm_name";s:20:"Наша фирма";s:8:"shopname";s:14:"Магазин";s:5:"phone";s:0:"";s:7:"address";s:0:"";s:3:"inn";s:0:"";}'); | ||
INSERT INTO `options` (`optname`, `optvalue`) VALUES('printer', 'a:7:{s:6:"pwidth";s:0:"";s:9:"pricetype";s:6:"price1";s:11:"barcodetype";s:5:"EAN13";s:5:"pname";i:1;s:5:"pcode";i:0;s:8:"pbarcode";i:1;s:6:"pprice";i:0;}'); | ||
INSERT INTO `options` (`optname`, `optvalue`) VALUES('modules', 'a:11:{s:6:"ocsite";s:20:"http://local.ostore3";s:9:"ocapiname";s:5:"admin";s:5:"ockey";s:256:"Bf81dB8fY2waVxlhych4fFprGfxF2tULlSlHiwEXZqf45E6HDBoA6XjocGcziRsfCQsRovzzDAvMBImmrlzXqEJcMByQpkfeLYfZBDoYstDVuA0Qvx86YkeXVwQ6I2v8xEXS2ZL6ioH1l8qinySGZdRrO5mgFCFWKhgKxIfkNOYpvzIZdR2MdqkHKSzHGSfoDVmbts8slGNFqYzvkXQSP0VaHcw0fYmBZLo0HEvLb2EiBZ5A8EcGDZWWtndg2wlY";s:13:"occustomer_id";s:1:"8";s:11:"ocpricetype";s:6:"price1";s:6:"wcsite";s:15:"http://local.wp";s:6:"wckeyc";s:43:"ck_a36c9d5d8ef70a34001b6a44bc245a7665ca77e7";s:6:"wckeys";s:43:"cs_12b03012d9db469b45b1fc82e329a3bc995f3e36";s:5:"wcapi";s:2:"v3";s:13:"wccustomer_id";s:1:"8";s:11:"wcpricetype";s:6:"price1";}'); | ||
|
||
|
@@ -73,4 +73,6 @@ INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `men | |
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `disabled`) VALUES(76, 1, 'Выплата зарплаты', 'OutSalary', 'Платежи', 0); | ||
INSERT INTO `metadata` (`meta_id`, `meta_type`, `description`, `meta_name`, `menugroup`, `disabled`) VALUES(77, 2, 'Отчет по зарплате', 'SalaryRep', 'Платежи', 0); | ||
INSERT INTO `metadata` (`meta_type`, `description`, `meta_name`, `menugroup`, `disabled`) VALUES( 2, 'Движение по контрагентам', 'CustActivity', 'Платежи', 0); | ||
INSERT INTO `metadata` (`meta_type`, `description`, `meta_name`, `menugroup`, `disabled`) VALUES( 4, 'Договора', 'ContractList', '', 0); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
CREATE TABLE `firms` ( | ||
`firm_id` int(11) NOT NULL AUTO_INCREMENT, | ||
`firm_name` varchar(255) NOT NULL, | ||
`details` longtext , | ||
`disabled` tinyint(1) NOT NULL DEFAULT '0', | ||
PRIMARY KEY (`firm_id`) | ||
) ENGINE=MyISAM CHARSET=utf8; | ||
|
||
|
||
|
||
|
||
CREATE TABLE `contracts` ( | ||
`contract_id` int(11) NOT NULL AUTO_INCREMENT, | ||
`customer_id` int(11) DEFAULT '0', | ||
`firm_id` int(11) DEFAULT '0', | ||
`createdon` date NOT NULL, | ||
`contract_number` varchar(64) NOT NULL, | ||
`disabled` tinyint(1) DEFAULT '0', | ||
`details` longtext NOT NULL, | ||
PRIMARY KEY (`contract_id`) | ||
) DEFAULT CHARSET=utf8; | ||
|
||
|
||
CREATE VIEW `contracts_view` AS | ||
select | ||
`co`.`contract_id` AS `contract_id`, | ||
`co`.`customer_id` AS `customer_id`, | ||
`co`.`firm_id` AS `firm_id`, | ||
`co`.`createdon` AS `createdon`, | ||
`co`.`contract_number` AS `contract_number`, | ||
`co`.`disabled` AS `disabled`, | ||
`co`.`details` AS `details`, | ||
`cu`.`customer_name` AS `customer_name`, | ||
`f`.`firm_name` AS `firm_name` | ||
from | ||
((`contracts` `co` join `customers` `cu` on((`co`.`customer_id` = `cu`.`customer_id`))) left join `firms` `f` on((`co`.`firm_id` = `f`.`firm_id`))); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
namespace App\Entity; | ||
|
||
/** | ||
* Клас-сущность договор | ||
* | ||
* @table=contracts | ||
* @view=contracts_view | ||
* @keyfield=contract_id | ||
*/ | ||
class Contract extends \ZCL\DB\Entity | ||
{ | ||
|
||
protected function init() { | ||
$this->contract_id = 0; | ||
$this->createdon = time(); | ||
} | ||
|
||
protected function afterLoad() { | ||
|
||
$this->createdon = strtotime($this->createdon); | ||
|
||
$xml = @simplexml_load_string($this->details); | ||
|
||
$this->shortdesc = (string)($xml->shortdesc[0]); | ||
$this->payname = (string)($xml->payname[0]); | ||
$this->pay = (int)($xml->pay[0]); | ||
$this->file_id = (int)($xml->file_id[0]); | ||
|
||
parent::afterLoad(); | ||
} | ||
|
||
protected function beforeSave() { | ||
parent::beforeSave(); | ||
$this->details = "<details>"; | ||
//упаковываем данные | ||
$this->details .= "<shortdesc><![CDATA[{$this->shortdesc}]]></shortdesc>"; | ||
$this->details .= "<payname><![CDATA[{$this->payname}]]></payname>"; | ||
$this->details .= "<pay>{$this->pay}</pay>"; | ||
$this->details .= "<file_id>{$this->file_id}</file_id>"; | ||
$this->details .= "</details>"; | ||
|
||
return true; | ||
} | ||
|
||
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') | ||
); | ||
} | ||
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 ; | ||
} | ||
|
||
} | ||
|
||
return $ar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.