diff --git a/js/crm.js b/js/crm.js index cbf5db3..3929622 100644 --- a/js/crm.js +++ b/js/crm.js @@ -6293,7 +6293,14 @@ $(document).ready(function() { var factCommission = $('#fact_agent_commission').val(); 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 factDealDate = $('#fact_deal_date').val(); + if (factDealDate) { + var fdParts = factDealDate.split(' '); + var fdDateParts = fdParts[0].split('.'); + param.datazakl = Date.parse(fdDateParts[2] + '-' + fdDateParts[1] + '-' + fdDateParts[0] + (fdParts[1] ? 'T' + fdParts[1] : 'T00:00')); + } else { + param.datazakl = Date.parse(dataZZ); + } // var factPayload = {}; // if (factPrice !== '' && !isNaN(parseInt(factPrice))) factPayload.contract_price = parseInt(factPrice) || 0; diff --git a/templates/footer.php b/templates/footer.php index e7cebd0..72a5e9d 100644 --- a/templates/footer.php +++ b/templates/footer.php @@ -4215,6 +4215,7 @@ $user_id = $_SESSION['id']; }); }); function resetDealCloseModal() { + window.dealCloseData = null; $('#luck').prop('checked', false); $('#deal_close_content').empty(); $('#deal_close_block').hide(); @@ -4327,6 +4328,12 @@ $user_id = $_SESSION['id']; var html = '