Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-components
Commits
9a53e949
Commit
9a53e949
authored
Apr 25, 2022
by
Irina Oleynik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
24ffc4f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
interpreter/registry_entry_from_table
interpreter/registry_entry_from_table
+44
-0
No files found.
interpreter/registry_entry_from_table
0 → 100644
View file @
9a53e949
var result = true;
var message = "ok";
try {
let currentFormData = API.getFormData(dataUUID);
let table_needs;
let rowCount = 0;
for(let i=0; i<currentFormData.data.length; i++){
if( currentFormData.data[i].id == 'table_needs'){
table_needs = currentFormData.data[i].data;
}
}
for(let i=0; i<table_needs.length; i++){
if( table_needs[i].id.slice(0,16) == 'numericinput_cfo'){
rowCount += 1;
}
}
for(let i=0; i<rowCount; i++){
let contractAsfData = [];
for(let j=0; j<table_needs.length; j++){
if( table_needs[j].id.slice(-1) == (i+1).toString()){
contractAsfData.push(table_needs[j]);
}
}
for(let j=0; j<contractAsfData.length; j++){
contractAsfData[j].id = contractAsfData[j].id.substring(0, contractAsfData[j].id.indexOf("-"));
}
let result = API.createDocRCC('registr_for_budjet', contractAsfData);
if(result.errorCode != 0) throw new Error("Не удалось создать документ.\n" + result.errorMessage);
result = API.activateDoc(result.documentID);
if(result.errorCode != 0) throw new Error("Ошибка активации документа");
}
message = "Документ создан, documentID: " + result.documentID;
} catch (err) {
log.error(err);
message = err.message;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment