Skip to content

Commit

Permalink
fix(Individual) add getInventoryDetailsSQL event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed May 18, 2024
1 parent a0f473b commit a5a6683
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/*************************************************************************************************
* Copyright 2024 JPL TSolucio, S.L. -- This file is a part of TSOLUCIO coreBOS Customizations.
* Licensed under the vtiger CRM Public License Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You can redistribute it and/or modify it
* under the terms of the License. JPL TSolucio, S.L. reserves all rights not expressly
* granted by the License. coreBOS distributed by JPL TSolucio S.L. 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. Unless required by
* applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT ANY WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing
* permissions and limitations under the License. You may obtain a copy of the License
* at <http://corebos.org/documentation/doku.php?id=en:devel:vpl11>
*************************************************************************************************/

class addTaxCalculationgetInventoryDetailsSQL extends cbupdaterWorker {

public function applyChange() {
if ($this->hasError()) {
$this->sendError();
}
if ($this->isApplied()) {
$this->sendMsg('Changeset '.get_class($this).' already applied!');
} else {
require_once 'include/events/include.inc';
include_once 'vtlib/Vtiger/Module.php';
global $adb;
$em = new VTEventsManager($adb);
$em->registerHandler('corebos.filter.TaxCalculation.getInventoryDetailsSQL', 'modules/coreBOSTax/coreBOSTaxHandler.php', 'coreBOSTaxEvents');
$this->sendMsg('Changeset '.get_class($this).' applied!');
$this->markApplied(false);
}
$this->finishExecution();
}
}
7 changes: 7 additions & 0 deletions modules/coreBOSTax/changesets/ycoreBOSTax.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@
<classname>installcoreBOSTaxModules</classname>
<systemupdate>false</systemupdate>
</changeSet>
<changeSet>
<author>joebordes</author>
<description>Add TaxCalculation.getInventoryDetailsSQL event handler</description>
<filename>modules/coreBOSTax/changesets/addTaxCalculationgetInventoryDetailsSQL.php</filename>
<classname>addTaxCalculationgetInventoryDetailsSQL</classname>
<systemupdate>false</systemupdate>
</changeSet>
</updatesChangeLog>
1 change: 1 addition & 0 deletions modules/coreBOSTax/coreBOSTax.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public function vtlib_handler($modulename, $event_type) {
$em->registerHandler('corebos.filter.TaxCalculation.getTaxId', 'modules/coreBOSTax/coreBOSTaxHandler.php', 'coreBOSTaxEvents');
$em->registerHandler('corebos.filter.TaxCalculation.getInventoryProductTaxValue', 'modules/coreBOSTax/coreBOSTaxHandler.php', 'coreBOSTaxEvents');
$em->registerHandler('corebos.filter.TaxCalculation.getInventorySHTaxPercent', 'modules/coreBOSTax/coreBOSTaxHandler.php', 'coreBOSTaxEvents');
$em->registerHandler('corebos.filter.TaxCalculation.getInventoryDetailsSQL', 'modules/coreBOSTax/coreBOSTaxHandler.php', 'coreBOSTaxEvents');
$em->registerHandler('corebos.changestatus.tax', 'modules/coreBOSTax/coreBOSTaxHandler.php', 'coreBOSTaxEvents');
$em->registerHandler('corebos.changelabel.tax', 'modules/coreBOSTax/coreBOSTaxHandler.php', 'coreBOSTaxEvents');
$em->registerHandler('corebos.add.tax', 'modules/coreBOSTax/coreBOSTaxHandler.php', 'coreBOSTaxEvents');
Expand Down

0 comments on commit a5a6683

Please sign in to comment.