From 28d706410bb97de9e2822cdae3f3ba95fcaf370f Mon Sep 17 00:00:00 2001 From: Matteo Date: Mon, 4 Apr 2022 17:58:46 +0200 Subject: [PATCH] =?UTF-8?q?Introdotta=20stampa=20attivit=C3=A0=20con=20che?= =?UTF-8?q?cklist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/checklists/modutil.php | 25 +++++++++++++++++++++++++ templates/interventi/body.php | 28 ++++++++++++++++++++++++++++ templates/interventi/check.png | Bin 0 -> 7731 bytes update/2_4_33.sql | 6 +++++- 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 templates/interventi/check.png diff --git a/modules/checklists/modutil.php b/modules/checklists/modutil.php index d97ddce02..2b8a028b5 100755 --- a/modules/checklists/modutil.php +++ b/modules/checklists/modutil.php @@ -63,3 +63,28 @@ function renderChecklist($check, $level = 0) return $result; } + +function renderChecklistHtml($check, $level = 0) +{ + $user = auth()->getUser(); + $enabled = $check->assignedUsers ? $check->assignedUsers->pluck('id')->search($user->id) !== false : true; + + $width = 10+20*$level; + + $result = ' + + + '.(!empty($check->checked_at)?'':'').' + + + '.$check->content.' + + '; + + $children = $check->children; + foreach ($children as $child) { + $result .= renderChecklistHtml($child, $level + 1); + } + + return $result; +} \ No newline at end of file diff --git a/templates/interventi/body.php b/templates/interventi/body.php index aaeb9a693..8b65ebcfd 100755 --- a/templates/interventi/body.php +++ b/templates/interventi/body.php @@ -493,3 +493,31 @@ if ($options['pricing']) { echo ' '; + +if($options['checklist']){ + + $structure = Modules::get('Interventi'); + $checks = $structure->mainChecks($id_record); + + if(!empty($checks)){ + echo ' + + + + + '; + + $structure = Modules::get('Interventi'); + $checks = $structure->mainChecks($id_record); + + foreach ($checks as $check) { + echo renderChecklistHtml($check); + } + + echo ' +
+ CHECKLIST +
'; + } + +} diff --git a/templates/interventi/check.png b/templates/interventi/check.png new file mode 100644 index 0000000000000000000000000000000000000000..127c24503701a3a82fa111bf6dfd48a2b3e1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pgBDFrLi2u?vZqB4+ALK{jn-J4N)}M+8TMjqGh#gGw;n zKebS#$oPn4q91~z#jdTi-O3CRsp5H(vW?*k>seD(j0Z6(FhhSLI)0)OExi`-yI2Go z@0>_7_C!uZB)b277H#y(Y?}a&W{0)dbIIaMJ;zKR=q<`Mt-IfJKqB8xli4@^WdD&k z0-u_;quQTYhI7_0Jz2o|xJCyoZVc1@QIU8It7G`uvzAjMb1%MGGL?q6>5ADk!Zae(PL96TMu`=^6!!12SqhJ za_V|yJtKn7%!WbQ&LZXDu?Weap-HwdX16eeaAsy>zW{*2BevAt8m7z> TpSObleK*-y5iReV`^5bZy|`@^ literal 0 HcmV?d00001 diff --git a/update/2_4_33.sql b/update/2_4_33.sql index 376307491..c0d4837dd 100644 --- a/update/2_4_33.sql +++ b/update/2_4_33.sql @@ -85,4 +85,8 @@ UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM `co_documenti`\nLEFT J UPDATE `zz_views` SET `query` = '(righe.totale_imponibile + righe.iva + `co_documenti`.`rivalsainps` + `co_documenti`.`iva_rivalsainps`) * IF(co_tipidocumento.reversed, -1, 1)' WHERE `zz_views`.`name` = 'Totale ivato' AND `zz_views`.`id_module`=(SELECT `id` FROM `zz_modules` WHERE `name` = 'Fatture di acquisto'); -UPDATE `zz_views` SET `query` = '(righe.totale_imponibile + IF(righe.split_payment=0, righe.iva, 0) + `co_documenti`.`rivalsainps` + `co_documenti`.`iva_rivalsainps` - `co_documenti`.`ritenutaacconto` - `co_documenti`.`sconto_finale`) * (1 - `co_documenti`.`sconto_finale_percentuale` / 100) * IF(co_tipidocumento.reversed, -1, 1)' WHERE `zz_views`.`name` = 'Netto a pagare' AND `zz_views`.`id_module`=(SELECT `id` FROM `zz_modules` WHERE `name` = 'Fatture di acquisto'); \ No newline at end of file +UPDATE `zz_views` SET `query` = '(righe.totale_imponibile + IF(righe.split_payment=0, righe.iva, 0) + `co_documenti`.`rivalsainps` + `co_documenti`.`iva_rivalsainps` - `co_documenti`.`ritenutaacconto` - `co_documenti`.`sconto_finale`) * (1 - `co_documenti`.`sconto_finale_percentuale` / 100) * IF(co_tipidocumento.reversed, -1, 1)' WHERE `zz_views`.`name` = 'Netto a pagare' AND `zz_views`.`id_module`=(SELECT `id` FROM `zz_modules` WHERE `name` = 'Fatture di acquisto'); + +INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES +(NULL, (SELECT id FROM zz_modules WHERE `name`='Interventi'), 1, 'Intervento & checklist', 'Intervento & checklist', 'Intervento num {numero} del {data}', 'interventi', 'idintervento', '{\"pricing\":true, \"checklist\": true}', 'fa fa-print', '', '', 0, 1, 1, 1), +(NULL, (SELECT id FROM zz_modules WHERE `name`='Interventi'), 1, 'Intervento & checklist (senza costi)', 'Intervento & checklist (senza prezzi)', 'Intervento num {numero} del {data}', 'interventi', 'idintervento', '{\"pricing\":false, \"checklist\": true}', 'fa fa-print', '', '', 0, 1, 1, 1); \ No newline at end of file