Actual prod
This commit is contained in:
parent
e0a941fd74
commit
5717ef990d
@ -4974,8 +4974,20 @@ class Requisitions{
|
||||
}
|
||||
|
||||
if ($dealId) {
|
||||
$this->db->query("UPDATE user_client_events SET calendar_view = 1 WHERE deal_id = $dealId AND calendar_view = 0");
|
||||
$this->db->query("UPDATE user_object_events SET calendar_view = 1 WHERE deal_id = $dealId AND calendar_view = 0");
|
||||
$this->db->query("UPDATE user_client_events SET calendar_view = 1 WHERE deal_id = $dealId");
|
||||
$this->db->query("UPDATE user_object_events SET calendar_view = 1 WHERE deal_id = $dealId");
|
||||
|
||||
// Обновляем стоимость и комиссию сделки если переданы
|
||||
$dealUpdateParts = [];
|
||||
if (isset($post['summa']) && is_numeric($post['summa']) && intval($post['summa']) > 0) {
|
||||
$dealUpdateParts[] = "contract_price = " . intval($post['summa']);
|
||||
}
|
||||
if (isset($post['commission']) && is_numeric($post['commission']) && intval($post['commission']) > 0) {
|
||||
$dealUpdateParts[] = "total_commission = " . intval($post['commission']);
|
||||
}
|
||||
if (!empty($dealUpdateParts)) {
|
||||
$this->db->query("UPDATE deals SET " . implode(', ', $dealUpdateParts) . " WHERE id = $dealId");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
12
js/crm.js
12
js/crm.js
@ -6294,18 +6294,6 @@ $(document).ready(function() {
|
||||
param.summa = (factPrice !== '' && !isNaN(parseInt(factPrice))) ? parseInt(factPrice) : (window.dealCloseData.contract_price || 0);
|
||||
param.commission = (factCommission !== '' && !isNaN(parseInt(factCommission))) ? parseInt(factCommission) : (window.dealCloseData.total_commission || 0);
|
||||
param.datazakl = Date.parse(dataZZ);
|
||||
|
||||
var factPayload = {};
|
||||
if (factPrice !== '' && !isNaN(parseInt(factPrice))) factPayload.contract_price = parseInt(factPrice) || 0;
|
||||
if (factCommission !== '' && !isNaN(parseInt(factCommission))) factPayload.total_commission = parseInt(factCommission) || 0;
|
||||
if (Object.keys(factPayload).length > 0) {
|
||||
$.ajax({
|
||||
url: '/deal/index.php?path=deals/' + window.dealCloseData.id,
|
||||
type: 'PUT',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(factPayload)
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (isNaN(parseInt($('#summa_sdelki').val()))) {
|
||||
alert("Введите сумму сделки");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user