diff --git a/doc/ChangeLog b/doc/ChangeLog index 17e0d629df..656bd9af29 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -509,6 +509,11 @@ version 28-git (????-??-??): - enhancement: 'without start date' assignment filter added in customer search form [chilan] - improvement: show customer id for addresses in 'merge' mode lms-teryt.php script [chilan] - enhancement: added division property to network devices [chilan] + - improvement: show source name in imported operation list pending for confirmation [chilan] + - improvement/devel: 'get_customer_sms_options' plugin hook introduced which allows to collect + specific sms-like section configuration variable names [chilan] + - improvement: send document confirm notifications if document is created with 'closed' + status [chilan] - enhancement: added support for user API keys [interduo] version 27.0 (2021-08-20): diff --git a/lib/LMS.class.php b/lib/LMS.class.php index 8ce6c540f2..fcd1e8b264 100644 --- a/lib/LMS.class.php +++ b/lib/LMS.class.php @@ -3292,7 +3292,7 @@ public function SendSMS($number, $message, $messageid = null, $sms_options = nul // message ID must be unique if (!$messageid) { - $messageid = '0.' . time(); + $messageid = '0.' . microtime(true); } $message = preg_replace("/\r/", "", $message); diff --git a/lib/LMSManagers/LMSCustomerManager.php b/lib/LMSManagers/LMSCustomerManager.php index 473fe6b870..4e43b1e9b1 100644 --- a/lib/LMSManagers/LMSCustomerManager.php +++ b/lib/LMSManagers/LMSCustomerManager.php @@ -2717,6 +2717,8 @@ public function isTelecomServiceSuggested($customerid) public function getCustomerSMSOptions() { + global $LMS; + $options = array(); $variable_mapping = array( @@ -2737,6 +2739,11 @@ public function getCustomerSMSOptions() 'message_template' => 'sms-customers.message_template', ); + $variable_mapping = $LMS->executeHook( + 'get_customer_sms_options', + $variable_mapping + ); + foreach ($variable_mapping as $option_name => $variable_name) { if (is_array($variable_name)) { $exists = false; diff --git a/modules/cashimport.php b/modules/cashimport.php index f0c9239871..198d547bb4 100644 --- a/modules/cashimport.php +++ b/modules/cashimport.php @@ -257,11 +257,18 @@ $divisions[0] = array('id' => 0, 'name' => ''); -if ($importlist = $DB->GetAll('SELECT i.*, c.divisionid - FROM cashimport i - LEFT JOIN customerview c ON (i.customerid = c.id) - WHERE i.closed = 0 AND i.value > 0 - ORDER BY i.id')) { +if ($importlist = $DB->GetAll( + 'SELECT + i.*, + c.divisionid, + cs.name AS sourcename + FROM cashimport i + LEFT JOIN customerview c ON i.customerid = c.id + LEFT JOIN cashsources cs ON cs.id = i.sourceid + WHERE i.closed = 0 + AND i.value > 0 + ORDER BY i.id' +)) { $listdata['total'] = count($importlist); foreach ($importlist as $idx => $row) { diff --git a/modules/documentadd.php b/modules/documentadd.php index 9655bbdca5..e7422a9262 100644 --- a/modules/documentadd.php +++ b/modules/documentadd.php @@ -485,12 +485,16 @@ ) ); $document = $hook_data['document']; - } - if ($LMS->DocumentExists($docid) && !empty($document['confirmdate'])) { - $document['id'] = $docid; - $document['fullnumber'] = $fullnumber; - $LMS->NewDocumentCustomerNotifications($document); + if (isset($document['closed'])) { + $LMS->CommitDocuments(array($docid), false, false); + } + + if (!empty($document['confirmdate'])) { + $document['id'] = $docid; + $document['fullnumber'] = $fullnumber; + $LMS->NewDocumentCustomerNotifications($document); + } } if (!isset($document['reuse'])) { diff --git a/templates/default/cash/cashimport.html b/templates/default/cash/cashimport.html index e758e7a445..8c43a1a09e 100644 --- a/templates/default/cash/cashimport.html +++ b/templates/default/cash/cashimport.html @@ -35,6 +35,7 @@

{$layout.pagetitle}

+ @@ -45,6 +46,9 @@

{$layout.pagetitle}

{trans("ID:")} + + {trans("Source")} + {trans("Date:")} @@ -69,7 +73,7 @@

{$layout.pagetitle}

{foreach $divisions as $division} {if $division.list} - + {icon name="division"} {$division.name|escape} @@ -82,6 +86,9 @@

{$layout.pagetitle}

{$item.id|string_format:"%04d"} + + {$item.sourcename|escape} + {$item.date|date_format:"Y-m-d"} @@ -113,7 +120,7 @@

{$layout.pagetitle}

{/foreach} {if !$listdata.total} - + {trans("No cash operations to import.")} @@ -121,7 +128,7 @@

{$layout.pagetitle}

- +