diff --git a/Extension/Controller/EditAsiento.php b/Extension/Controller/EditAsiento.php
new file mode 100644
index 0000000..f8cea69
--- /dev/null
+++ b/Extension/Controller/EditAsiento.php
@@ -0,0 +1,27 @@
+
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+namespace FacturaScripts\Plugins\Proyectos\Extension\Controller;
+
+use FacturaScripts\Plugins\Proyectos\Extension\Traits\ProjectControllerSalesPurchases;
+
+class EditAsiento
+{
+ use ProjectControllerSalesPurchases;
+}
diff --git a/Extension/XMLView/EditAsiento.xml b/Extension/XMLView/EditAsiento.xml
deleted file mode 100644
index 1c63766..0000000
--- a/Extension/XMLView/EditAsiento.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Init.php b/Init.php
index 87d731d..9c805c7 100644
--- a/Init.php
+++ b/Init.php
@@ -19,6 +19,7 @@
namespace FacturaScripts\Plugins\Proyectos;
+use FacturaScripts\Core\Lib\AjaxForms\AccountingHeaderHTML;
use FacturaScripts\Core\Lib\AjaxForms\PurchasesHeaderHTML;
use FacturaScripts\Core\Lib\AjaxForms\SalesHeaderHTML;
use FacturaScripts\Core\Base\DataBase;
@@ -66,6 +67,7 @@ public function init(): void
$this->loadExtension(new Extension\Controller\DocumentStitcher());
$this->loadExtension(new Extension\Controller\EditAlbaranCliente());
$this->loadExtension(new Extension\Controller\EditAlbaranProveedor());
+ $this->loadExtension(new Extension\Controller\EditAsiento());
$this->loadExtension(new Extension\Controller\EditCliente());
$this->loadExtension(new Extension\Controller\EditFacturaCliente());
$this->loadExtension(new Extension\Controller\EditFacturaProveedor());
@@ -88,6 +90,7 @@ public function init(): void
$this->loadExtension(new Extension\Model\Stock());
$this->loadExtension(new Extension\Model\FacturaProgramada());
+ AccountingHeaderHTML::addMod(new Mod\AccountingHeaderHTMLMod());
PurchasesHeaderHTML::addMod(new Mod\PurchasesHeaderHTMLMod());
SalesHeaderHTML::addMod(new Mod\SalesHeaderHTMLMod());
diff --git a/Mod/AccountingHeaderHTMLMod.php b/Mod/AccountingHeaderHTMLMod.php
new file mode 100644
index 0000000..3e62143
--- /dev/null
+++ b/Mod/AccountingHeaderHTMLMod.php
@@ -0,0 +1,100 @@
+
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+namespace FacturaScripts\Plugins\Proyectos\Mod;
+
+use FacturaScripts\Core\Contract\AccountingModInterface;
+use FacturaScripts\Core\Tools;
+use FacturaScripts\Dinamic\Model\Asiento;
+use FacturaScripts\Dinamic\Model\Proyecto;
+use FacturaScripts\Dinamic\Lib\AssetManager;
+
+/**
+ * Description of AccountingHeaderHTMLMod
+ *
+ * @author Esteban Sánchez
+ */
+class AccountingHeaderHTMLMod implements AccountingModInterface
+{
+ public function apply(Asiento &$model, array $formData): void
+ {
+ }
+
+ public function applyBefore(Asiento &$model, array $formData): void
+ {
+ $model->idproyecto = isset($formData['idproyecto']) && $formData['idproyecto'] ? $formData['idproyecto'] : null;
+ }
+
+ public function assets(): void
+ {
+ $route = Tools::config('route');
+ AssetManager::add('js', $route . '/Dinamic/Assets/JS/AutocompleteProject.js');
+ }
+
+ public function newBtnFields(): array
+ {
+ return [];
+ }
+
+ public function newFields(): array
+ {
+ return ['proyecto'];
+ }
+
+ public function renderField(Asiento $model, string $field): ?string
+ {
+ if ($field === 'proyecto') {
+ return self::proyecto($model);
+ }
+
+ return null;
+ }
+
+ private static function proyecto(Asiento $model): string
+ {
+ $value = '';
+ $project = new Proyecto();
+ if ($model->idproyecto && $project->load($model->idproyecto)) {
+ $value = $project->idproyecto . ' | ' . $project->nombre;
+ }
+
+ $html = '