📜 ⬆️ ⬇️

Drupal 7 module. Transfer of meter readings

I suggest to get acquainted with the module Transfer meter readings. This module is highly specialized and most readers may not be interested. The module allows a resident of an apartment building to transfer the readings of individual metering devices in a convenient form on the website of the management organization, and the management organization to process this data in a semi-automatic mode.



Address selection form
')


User part


First, the resident is asked to fill in the address and number of the personal account. With proper correspondence of the address and the personal account, the user proceeds to the input form of readings:


If one of the counters for one of the readings was not specified, the form will reappear, but the previously entered values ​​will no longer be available for editing:


When all counters are read, a corresponding notification is displayed:


Administrative part




The administrator has the ability to:
  1. Configure the format of the imported file (master file):
    • The sequence of matched fields in the database and in the file;
    • Specify field delimiters, escape characters, etc .;
  2. Configure the format of the exported file (with transmitted readings);
  3. Unlock or block any entered meter reading;


The list of required fields that must be present in the file with the main data:


I want to note that the “mandatory” fields are not for a tick, if one of the fields is unavailable or empty, then the row with this field will not fall into the table with general data. An example of how the correct master data file should look like (for import):
"2014-05-01";"7200008701";"1";".  ";"12345";"5";"7";"  ";1;8702;" ";25 "2014-05-01";"7200008701";"1";".  ";"12345";"5";"7";"  ";2;8703;" ";10 

Keep in mind that for each counter there should be a separate line with the data on the address, the month of the account, and the number of the LAN.
In the accounting month only the month and the year are important, any day can be (within the month). For example, the value "2014-05-12" is quite appropriate.

Import Export

At the moment, the import and export of data passes only through delimited text files. Export of meter readings is made in CSV format. Any delimited text file is suitable for import.

Work algorithm



The module is under a BSD license.
Source code can be viewed on GitHub . On Drupal.org will publish in the sandbox soon.

I will accept any comments on the code and the translation module.

Thanks for attention.

UPD 1 from 03 Sep. 2014 02:40
In hook_permission () there was an error due to which users did not have access to the form. If you have already installed yourself to test, you need to upgrade.

UPD 2 dated 03/20/2015
Version 1.0.2

Source: https://habr.com/ru/post/235251/


All Articles