5843-quitUserFk2 #1758
|
@ -45,7 +45,7 @@
|
|||
<vn-label-value
|
||||
label="Attended by">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.claim.worker.userFk)"
|
||||
ng-click="workerDescriptor.show($event, $ctrl.claim.worker.id)"
|
||||
class="link">
|
||||
{{$ctrl.claim.worker.user.name}}
|
||||
</span>
|
||||
|
|
|
@ -60,7 +60,7 @@ module.exports = Self => {
|
|||
at2.id IS NOT NULL as isCompensation
|
||||
FROM vn.receipt r
|
||||
LEFT JOIN vn.worker w ON w.id = r.workerFk
|
||||
LEFT JOIN account.user u ON u.id = w.userFk
|
||||
LEFT JOIN account.user u ON u.id = w.id
|
||||
JOIN vn.company c ON c.id = r.companyFk
|
||||
LEFT JOIN vn.accounting a ON a.id = r.bankFk
|
||||
LEFT JOIN vn.accountingType at2 ON at2.id = a.accountingTypeFk AND at2.code = 'compensation'
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
<vn-tr ng-repeat="credit in credits track by credit.id">
|
||||
<vn-td shrink-datetime>{{::credit.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
|
||||
<vn-td>
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, credit.worker.userFk)"
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, credit.worker.id)"
|
||||
class="link">
|
||||
{{::credit.worker.user.name}}
|
||||
</span>
|
||||
|
@ -41,10 +41,10 @@
|
|||
ui-sref="client.card.credit.create"
|
||||
vn-acl="teamBoss"
|
||||
vn-acl-action="remove"
|
||||
vn-tooltip="New credit"
|
||||
vn-tooltip="New credit"
|
||||
vn-bind="+"
|
||||
fixed-bottom-right>
|
||||
</vn-float-button>
|
||||
<vn-worker-descriptor-popover
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
||||
</vn-worker-descriptor-popover>
|
||||
|
|
|
@ -180,7 +180,7 @@ module.exports = Self => {
|
|||
LEFT JOIN itemType it ON it.id = i.typeFk
|
||||
LEFT JOIN itemCategory ic ON ic.id = it.categoryFk
|
||||
LEFT JOIN worker w ON w.id = it.workerFk
|
||||
LEFT JOIN account.user u ON u.id = w.userFk
|
||||
LEFT JOIN account.user u ON u.id = w.id
|
||||
LEFT JOIN intrastat intr ON intr.id = i.intrastatFk
|
||||
LEFT JOIN producer pr ON pr.id = i.producerFk
|
||||
LEFT JOIN origin ori ON ori.id = i.originFk
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<vn-crud-model
|
||||
auto-load="true"
|
||||
url="Warehouses"
|
||||
auto-load="true"
|
||||
url="Warehouses"
|
||||
data="warehouses">
|
||||
</vn-crud-model>
|
||||
<vn-descriptor-content
|
||||
|
@ -58,7 +58,7 @@
|
|||
<vn-label-value
|
||||
label="Buyer">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.item.itemType.worker.userFk)"
|
||||
ng-click="workerDescriptor.show($event, $ctrl.item.itemType.worker.id)"
|
||||
class="link">
|
||||
{{$ctrl.item.itemType.worker.user.name}}
|
||||
</span>
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
</vn-label-value>
|
||||
<vn-label-value label="Buyer">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.summary.item.itemType.worker.userFk)"
|
||||
ng-click="workerDescriptor.show($event, $ctrl.summary.item.itemType.worker.id)"
|
||||
class="link">
|
||||
{{$ctrl.summary.item.itemType.worker.user.name}}
|
||||
</span>
|
||||
|
|
|
@ -215,7 +215,7 @@ module.exports = Self => {
|
|||
LEFT JOIN state st ON st.id = ts.stateFk
|
||||
LEFT JOIN client c ON c.id = t.clientFk
|
||||
LEFT JOIN worker wk ON wk.id = c.salesPersonFk
|
||||
LEFT JOIN account.user u ON u.id = wk.userFk
|
||||
LEFT JOIN account.user u ON u.id = wk.id
|
||||
LEFT JOIN zoneEstimatedDelivery zed ON zed.zoneFk = t.zoneFk`);
|
||||
|
||||
if (args.orderFk) {
|
||||
|
|
|
@ -169,7 +169,7 @@ module.exports = Self => {
|
|||
LEFT JOIN agencyMode am ON am.id = o.agency_id
|
||||
LEFT JOIN client c ON c.id = o.customer_id
|
||||
LEFT JOIN worker wk ON wk.id = c.salesPersonFk
|
||||
LEFT JOIN account.user u ON u.id = wk.userFk
|
||||
LEFT JOIN account.user u ON u.id = wk.id
|
||||
LEFT JOIN company co ON co.id = o.company_id
|
||||
LEFT JOIN orderTicket ot ON ot.orderFk = o.id
|
||||
LEFT JOIN ticket t ON t.id = ot.ticketFk
|
||||
|
|
|
@ -111,7 +111,7 @@ module.exports = Self => {
|
|||
let stmt;
|
||||
|
||||
stmt = new ParameterizedSQL(
|
||||
`SELECT
|
||||
`SELECT
|
||||
r.id,
|
||||
r.workerFk,
|
||||
r.created,
|
||||
|
@ -134,7 +134,7 @@ module.exports = Self => {
|
|||
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
|
||||
LEFT JOIN vehicle v ON v.id = r.vehicleFk
|
||||
LEFT JOIN worker w ON w.id = r.workerFk
|
||||
LEFT JOIN account.user u ON u.id = w.userFk`
|
||||
LEFT JOIN account.user u ON u.id = w.id`
|
||||
);
|
||||
|
||||
stmt.merge(conn.makeSuffix(filter));
|
||||
|
|
|
@ -41,7 +41,7 @@ module.exports = Self => {
|
|||
FROM saleTracking st
|
||||
JOIN sale s ON s.id = st.saleFk
|
||||
JOIN worker w ON w.id = st.workerFk
|
||||
JOIN account.user u ON u.id = w.userFk
|
||||
JOIN account.user u ON u.id = w.id
|
||||
JOIN state ste ON ste.id = st.stateFk`);
|
||||
|
||||
stmt.merge(Self.makeSuffix(filter));
|
||||
|
|
|
@ -153,9 +153,9 @@ module.exports = Self => {
|
|||
LEFT JOIN item i ON i.id = tr.itemFk
|
||||
LEFT JOIN sale s ON s.id = tr.saleFk
|
||||
LEFT JOIN worker wk ON wk.id = c.salesPersonFk
|
||||
LEFT JOIN account.user u ON u.id = wk.userFk
|
||||
LEFT JOIN account.user u ON u.id = wk.id
|
||||
LEFT JOIN worker wka ON wka.id = tr.attenderFk
|
||||
LEFT JOIN account.user ua ON ua.id = wka.userFk`);
|
||||
LEFT JOIN account.user ua ON ua.id = wka.id`);
|
||||
stmt.merge(conn.makeSuffix(filter));
|
||||
|
||||
return conn.executeStmt(stmt, myOptions);
|
||||
|
|
|
@ -272,7 +272,7 @@ module.exports = Self => {
|
|||
LEFT JOIN state st ON st.id = ts.stateFk
|
||||
LEFT JOIN client c ON c.id = t.clientFk
|
||||
LEFT JOIN worker wk ON wk.id = c.salesPersonFk
|
||||
LEFT JOIN account.user u ON u.id = wk.userFk
|
||||
LEFT JOIN account.user u ON u.id = wk.id
|
||||
LEFT JOIN route r ON r.id = t.routeFk`);
|
||||
|
||||
if (args.orderFk) {
|
||||
|
|
|
@ -38,12 +38,12 @@ module.exports = Self => {
|
|||
const conn = Self.dataSource.connector;
|
||||
|
||||
const worker = await models.Worker.findById(id);
|
||||
const userId = worker.userFk;
|
||||
const userId = worker.id;
|
||||
|
||||
const stmts = [];
|
||||
|
||||
stmts.push(`
|
||||
DROP TEMPORARY TABLE IF EXISTS
|
||||
DROP TEMPORARY TABLE IF EXISTS
|
||||
tmp.timeControlCalculate,
|
||||
tmp.timeBusinessCalculate
|
||||
`);
|
||||
|
@ -54,7 +54,7 @@ module.exports = Self => {
|
|||
|
||||
const resultIndex = stmts.push(new ParameterizedSQL(`
|
||||
SELECT tcc.dated, tbc.timeWorkSeconds expectedHours, tcc.timeWorkSeconds workedHours
|
||||
FROM tmp.timeControlCalculate tcc
|
||||
FROM tmp.timeControlCalculate tcc
|
||||
LEFT JOIN tmp.timeBusinessCalculate tbc ON tcc.dated = tbc.dated
|
||||
WHERE tcc.dated BETWEEN DATE(?) AND DATE(?)
|
||||
`, [started, ended])) - 1;
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
"phone": {
|
||||
"type" : "string"
|
||||
},
|
||||
"userFk": {
|
||||
"type" : "number"
|
||||
},
|
||||
"bossFk": {
|
||||
"type" : "number"
|
||||
},
|
||||
|
@ -66,12 +63,12 @@
|
|||
"client": {
|
||||
"type": "belongsTo",
|
||||
"model": "Client",
|
||||
"foreignKey": "userFk"
|
||||
"foreignKey": "id"
|
||||
},
|
||||
"sip": {
|
||||
"type": "belongsTo",
|
||||
"model": "Sip",
|
||||
"foreignKey": "userFk"
|
||||
"foreignKey": "id"
|
||||
},
|
||||
"department": {
|
||||
"type": "belongsTo",
|
||||
|
|
|
@ -5,7 +5,7 @@ class Controller extends Section {
|
|||
onSubmit() {
|
||||
const sip = this.worker.sip;
|
||||
const params = {
|
||||
userFk: this.worker.userFk,
|
||||
userFk: this.worker.id,
|
||||
extension: sip.extension
|
||||
};
|
||||
this.$.watcher.check();
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<vn-one>
|
||||
<h4 translate>User data</h4>
|
||||
<vn-label-value label="User id"
|
||||
value="{{worker.userFk}}">
|
||||
value="{{worker.id}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="User"
|
||||
value="{{worker.user.name}}">
|
||||
|
|
|
@ -7,5 +7,5 @@ SELECT
|
|||
FROM client c
|
||||
JOIN account.user u ON u.id = c.id
|
||||
LEFT JOIN worker w ON w.id = c.salesPersonFk
|
||||
LEFT JOIN account.user wu ON wu.id = w.userFk
|
||||
WHERE c.id = ?
|
||||
LEFT JOIN account.user wu ON wu.id = w.id
|
||||
WHERE c.id = ?
|
||||
|
|
|
@ -8,5 +8,5 @@ SELECT
|
|||
FROM client c
|
||||
JOIN account.user u ON u.id = c.id
|
||||
LEFT JOIN worker w ON w.id = c.salesPersonFk
|
||||
LEFT JOIN account.user wu ON wu.id = w.userFk
|
||||
WHERE c.id = ?
|
||||
LEFT JOIN account.user wu ON wu.id = w.id
|
||||
WHERE c.id = ?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
SELECT
|
||||
SELECT
|
||||
r.id,
|
||||
r.m3,
|
||||
r.created,
|
||||
|
@ -11,9 +11,9 @@ SELECT
|
|||
FROM route r
|
||||
LEFT JOIN vehicle v ON v.id = r.vehicleFk
|
||||
LEFT JOIN worker w ON w.id = r.workerFk
|
||||
LEFT JOIN account.user u ON u.id = w.userFk
|
||||
LEFT JOIN account.user u ON u.id = w.id
|
||||
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
|
||||
LEFT JOIN agency a ON a.id = am.agencyFk
|
||||
LEFT JOIN supplierAgencyTerm sa ON sa.agencyFk = a.id
|
||||
LEFT JOIN supplier s ON s.id = sa.supplierFk
|
||||
WHERE r.id IN(?)
|
||||
WHERE r.id IN(?)
|
||||
|
|
Loading…
Reference in New Issue