-
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 #155 from leon-mbs/dev
v5.1.0
- Loading branch information
Showing
65 changed files
with
3,193 additions
and
1,792 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
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,59 @@ | ||
|
||
|
||
ALTER TABLE `customers` ADD `country` VARCHAR(255) NULL ; | ||
ALTER TABLE `timesheet` ADD `branch_id` INT NULL ; | ||
|
||
|
||
alter VIEW `timesheet_view` AS | ||
select | ||
`t`.`time_id` AS `time_id`, | ||
`t`.`emp_id` AS `emp_id`, | ||
`t`.`description` AS `description`, | ||
`t`.`t_start` AS `t_start`, | ||
`t`.`t_end` AS `t_end`, | ||
`t`.`t_type` AS `t_type`, | ||
`t`.`t_break` AS `t_break`, | ||
`e`.`emp_name` AS `emp_name`, | ||
`b`.`branch_name` AS `branch_name`, | ||
`e`.`disabled` AS `disabled`, | ||
`t`.`branch_id` AS `branch_id` | ||
from | ||
`timesheet` `t` join `employees` `e` on `t`.`emp_id` = `e`.`employee_id` | ||
left join branches b on t.branch_id = b.branch_id; | ||
|
||
|
||
ALTER VIEW `customers_view` AS | ||
select | ||
`customers`.`customer_id` AS `customer_id`, | ||
`customers`.`customer_name` AS `customer_name`, | ||
`customers`.`detail` AS `detail`, | ||
`customers`.`email` AS `email`, | ||
`customers`.`phone` AS `phone`, | ||
`customers`.`status` AS `status`, | ||
`customers`.`city` AS `city`, | ||
`customers`.`leadsource` AS `leadsource`, | ||
`customers`.`leadstatus` AS `leadstatus`, | ||
`customers`.`country` AS `country`, | ||
( | ||
select | ||
count(0) | ||
from | ||
`messages` `m` | ||
where | ||
((`m`.`item_id` = `customers`.`customer_id`) and (`m`.`item_type` = 2))) AS `mcnt`,( | ||
select | ||
count(0) | ||
from | ||
`files` `f` | ||
where | ||
((`f`.`item_id` = `customers`.`customer_id`) and (`f`.`item_type` = 2))) AS `fcnt`,( | ||
select | ||
count(0) | ||
from | ||
`eventlist` `e` | ||
where | ||
((`e`.`customer_id` = `customers`.`customer_id`) and (`e`.`eventdate` >= now()))) AS `ecnt` | ||
from | ||
`customers`; | ||
|
||
|
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 |
---|---|---|
|
@@ -292,4 +292,6 @@ public function createprodissue($args) { | |
return $doc->document_number; | ||
} | ||
|
||
|
||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace App\Entity; | ||
|
||
/** | ||
* Клас-сущность лицевой счет контрагента | ||
* | ||
* @table=custacc | ||
* @view=custacc_view | ||
* @keyfield=ca_id | ||
*/ | ||
class CustAcc extends \ZCL\DB\Entity | ||
{ | ||
const TYPE_PAYMENT = 0; | ||
const TYPE_BONUS = 1; | ||
|
||
protected function init() { | ||
$this->customer_id = 0; | ||
$this->optype = 0; | ||
|
||
} | ||
protected function afterLoad() { | ||
$this->document_date = strtotime($this->document_date); | ||
} | ||
|
||
public static function addEntry($customer_id,$amount,$document_id,$optype=0){ | ||
$custacc = new CustAcc(); | ||
$custacc->customer_id = $customer_id; | ||
$custacc->optype = $optype; | ||
$custacc->document_id = $document_id; | ||
$custacc->createdon=time() ; | ||
|
||
$custacc->save(); | ||
} | ||
} |
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
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
Oops, something went wrong.