quit vn_curdate of sql in print
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
f786cdd33d
commit
7dffe4edcb
|
@ -40,7 +40,7 @@ BEGIN
|
||||||
INTO vFromDated
|
INTO vFromDated
|
||||||
FROM bs.manaCustomer;
|
FROM bs.manaCustomer;
|
||||||
|
|
||||||
WHILE timestampadd(DAY,30,vFromDated) < vn.VN_CURDATE() DO
|
WHILE timestampadd(DAY,30,vFromDated) < CURDATE() DO
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
timestampadd(DAY,30,vFromDated),
|
timestampadd(DAY,30,vFromDated),
|
||||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
||||||
*/
|
*/
|
||||||
DECLARE vWorkerIsExcluded BOOLEAN;
|
DECLARE vWorkerIsExcluded BOOLEAN;
|
||||||
DECLARE vFromDated DATE;
|
DECLARE vFromDated DATE;
|
||||||
DECLARE vToDated DATE DEFAULT TIMESTAMPADD(DAY,1,vn.VN_CURDATE());
|
DECLARE vToDated DATE DEFAULT TIMESTAMPADD(DAY,1,CURDATE());
|
||||||
DECLARE vMana INT;
|
DECLARE vMana INT;
|
||||||
DECLARE vAutoMana INT;
|
DECLARE vAutoMana INT;
|
||||||
DECLARE vClaimMana INT;
|
DECLARE vClaimMana INT;
|
||||||
|
@ -63,7 +63,7 @@ BEGIN
|
||||||
FROM greuge g
|
FROM greuge g
|
||||||
JOIN client c ON c.id = g.clientFk
|
JOIN client c ON c.id = g.clientFk
|
||||||
WHERE c.salesPersonFk = vWorkerFk AND g.greugeTypeFk = vManaGreugeType
|
WHERE c.salesPersonFk = vWorkerFk AND g.greugeTypeFk = vManaGreugeType
|
||||||
AND g.shipped > vFromDated and g.shipped < vn.VN_CURDATE()
|
AND g.shipped > vFromDated and g.shipped < CURDATE()
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT cc.mana
|
SELECT cc.mana
|
||||||
FROM clientManaCache cc
|
FROM clientManaCache cc
|
||||||
|
|
|
@ -51,13 +51,13 @@ BEGIN
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
vCustomer,
|
vCustomer,
|
||||||
vn.VN_CURDATE(),
|
CURDATE(),
|
||||||
vAddress,
|
vAddress,
|
||||||
vRefundAgencyMode,
|
vRefundAgencyMode,
|
||||||
a.nickname,
|
a.nickname,
|
||||||
vWarehouse,
|
vWarehouse,
|
||||||
vCompany,
|
vCompany,
|
||||||
vn.VN_CURDATE(),
|
CURDATE(),
|
||||||
vZoneFk
|
vZoneFk
|
||||||
FROM address a
|
FROM address a
|
||||||
WHERE a.id = vAddress;
|
WHERE a.id = vAddress;
|
||||||
|
|
|
@ -94,7 +94,6 @@ module.exports = async function(request, response, next) {
|
||||||
}
|
}
|
||||||
// Update queue status
|
// Update queue status
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
date.setHours(0, 0, 0, 0);
|
|
||||||
sql = `UPDATE invoiceOut_queue
|
sql = `UPDATE invoiceOut_queue
|
||||||
SET status = "printed",
|
SET status = "printed",
|
||||||
printed = ?
|
printed = ?
|
||||||
|
|
|
@ -5,7 +5,7 @@ SELECT *, 100 * dwindle / total AS percentage
|
||||||
sum(saleWaste) as dwindle
|
sum(saleWaste) as dwindle
|
||||||
FROM bs.waste w
|
FROM bs.waste w
|
||||||
JOIN vn.time t ON w.year = t.year AND w.week = t.week
|
JOIN vn.time t ON w.year = t.year AND w.week = t.week
|
||||||
WHERE t.dated = DATE_ADD(vn.VN_CURDATE(), INTERVAL -1 WEEK)
|
WHERE t.dated = DATE_ADD(CURDATE(), INTERVAL -1 WEEK)
|
||||||
GROUP BY buyer
|
GROUP BY buyer
|
||||||
) sub
|
) sub
|
||||||
ORDER BY percentage DESC;
|
ORDER BY percentage DESC;
|
|
@ -1,6 +1,6 @@
|
||||||
SELECT @lastWeekMondayTime AS started, @lastWeekFridayTime AS ended
|
SELECT @lastWeekMondayTime AS started, @lastWeekFridayTime AS ended
|
||||||
FROM (
|
FROM (
|
||||||
SELECT @lastWeek := DATE_ADD(vn.VN_CURDATE(), INTERVAL -1 WEEK),
|
SELECT @lastWeek := DATE_ADD(CURDATE(), INTERVAL -1 WEEK),
|
||||||
@lastWeekMonday := DATE_ADD(@lastWeek, INTERVAL (-WEEKDAY(@lastWeek)) DAY),
|
@lastWeekMonday := DATE_ADD(@lastWeek, INTERVAL (-WEEKDAY(@lastWeek)) DAY),
|
||||||
@lastWeekFriday := DATE_ADD(@lastWeekMonday, INTERVAL (+6) DAY),
|
@lastWeekFriday := DATE_ADD(@lastWeekMonday, INTERVAL (+6) DAY),
|
||||||
@lastWeekMondayTime := CONCAT(@lastWeekMonday, ' 00:00:00'),
|
@lastWeekMondayTime := CONCAT(@lastWeekMonday, ' 00:00:00'),
|
||||||
|
|
|
@ -24,7 +24,7 @@ FROM route r
|
||||||
LEFT JOIN ticket t ON t.routeFk = r.id
|
LEFT JOIN ticket t ON t.routeFk = r.id
|
||||||
LEFT JOIN address a ON a.id = t.addressFk
|
LEFT JOIN address a ON a.id = t.addressFk
|
||||||
LEFT JOIN client c ON c.id = t.clientFk
|
LEFT JOIN client c ON c.id = t.clientFk
|
||||||
LEFT JOIN worker w ON w.id = client_getSalesPerson(t.clientFk, vn.VN_CURDATE())
|
LEFT JOIN worker w ON w.id = client_getSalesPerson(t.clientFk, CURDATE())
|
||||||
LEFT JOIN account.user u ON u.id = w.id
|
LEFT JOIN account.user u ON u.id = w.id
|
||||||
LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3
|
LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3
|
||||||
LEFT JOIN province p ON a.provinceFk = p.id
|
LEFT JOIN province p ON a.provinceFk = p.id
|
||||||
|
|
Loading…
Reference in New Issue