Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## Unreleased

## Release 1.11
- FIX : Compat v23 - *22/12/2025* - 1.11.1
- NEW : Changed Dolibarr compatibility range to 17 min - 22 max *08/07/2025* - 1.11.0

## Release 1.10
Expand Down
15 changes: 15 additions & 0 deletions admin/ship2bill_setup.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
<?php
/* Copyright (C) 2025 ATM Consulting
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

$res=@include("../../main.inc.php"); // For root directory
if (! $res) $res=@include("../../../main.inc.php"); // For "custom" directory
Expand Down
20 changes: 17 additions & 3 deletions class/ship2bill.class.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
<?php
/* Copyright (C) 2025 ATM Consulting
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

class Ship2Bill {

Expand All @@ -12,7 +27,7 @@ function generate_factures($TExpedition, $dateFact=0, $show_trace = true)
dol_include_once('/core/modules/facture/modules_facture.php');

// Utilisation du sous-module livraison activable dans expedition (note: en v13+, renommé en `delivery_note`)
if(isModEnabled('livraison_bon') || isModEnabled('delivery_note')) {
if(isModEnabled('delivery_note')) {
dol_include_once('/livraison/class/livraison.class.php');
}
// Utilisation du module sous-total si activé
Expand Down Expand Up @@ -410,8 +425,7 @@ function facture_add_title (&$f, &$exp, &$sub) {
if(!empty($exp->date_delivery) && !getDolGlobalString('SHIP2BILL_DISPLAY_SHIPMENT_REAL_DATE')) $title2.= ' ('.dol_print_date($exp->date_delivery,'day').')';
else if(getDolGlobalString('SHIP2BILL_DISPLAY_SHIPMENT_REAL_DATE') && !empty($exp->date_creation))$title2.= ' ('.dol_print_date($exp->date_creation,'day').')';

// Utilisation du sous-module livraison activable dans expedition (note: en v13+, renommé en `delivery_note`)
if(isModEnabled('livraison_bon') || isModEnabled('delivery_note')) {
if(isModEnabled('delivery_note')) {
$exp->fetchObjectLinked('','','','delivery');

// Récupération des infos du BL pour le titre, sinon de l'expédition
Expand Down
4 changes: 2 additions & 2 deletions class/techatm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static function getLastModuleVersionUrl($moduleDescriptor){


/**
* @param $url
* @param string $url Url to call
* @return false|object
*/
public function getJsonData($url){
Expand All @@ -170,7 +170,7 @@ public function getJsonData($url){
}

/**
* @param $url
* @param string $url Url to call
* @return false|string
*/
public function getContents($url){
Expand Down
15 changes: 15 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
<?php
/* Copyright (C) 2025 ATM Consulting
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$res = 0;
// Try main.inc.php using relative path
if (!$res && file_exists("../main.inc.php")) {
Expand Down
12 changes: 6 additions & 6 deletions core/modules/facture/doc/pdf_crabe_shipping.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0,
//$pdf->MultiCell($this->posxtva-$this->posxpicture-1,2, $outputlangs->transnoentities("Photo"),'','C');
}
}

$pdf->line($this->posxshipping-1, $tab_top, $this->posxshipping-1, $tab_top + $tab_height);
if (empty($hidetop))
{
Expand Down Expand Up @@ -1833,13 +1833,13 @@ function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
$showdetails=getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS');
return pdf_pagefoot($pdf,$outputlangs,'INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
}



function pdf_writeLinkedObjectsCustom(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$align,$default_font_size)
{
$linkedobjects = $this->pdf_getLinkedObjectsCustom($object,$outputlangs);

if (! empty($linkedobjects))
{
foreach($linkedobjects as $linkedobject)
Expand Down Expand Up @@ -1911,7 +1911,7 @@ function pdf_getLinkedObjectsCustom($object,$outputlangs)
{
$outputlangs->load('orders');
$outputlangs->load('sendings');

foreach($objects as $x => $elementobject)
{
$order=null;
Expand Down
8 changes: 4 additions & 4 deletions core/modules/modShip2bill.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function __construct($db)
$this->editor_url = 'https://www.atm-consulting.fr';
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version

$this->version = '1.11.0';
$this->version = '1.11.1';
// Url to the file with your last numberversion of this module
require_once __DIR__ . '/../../class/techatm.class.php';
$this->url_last_version = \ship2bill\TechATM::getLastModuleVersionUrl($this);
Expand Down Expand Up @@ -105,7 +105,7 @@ function __construct($db)
$this->depends = array(); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->conflictwith = array(); // List of modules id this module is in conflict with
$this->phpmin = array(7,0); // Minimum version of PHP required by module
$this->phpmin = array(7,4); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(17, 0); // Minimum version of Dolibarr required by module
$this->langfiles = array("ship2bill@ship2bill");

Expand All @@ -117,8 +117,8 @@ function __construct($db)
$this->const = array();

// Array to add new pages in new tabs
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight('mymodule', 'read'):/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->hasRight('othermodule', 'read'):/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
// where objecttype can be
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct($db)
$this->db = &$db;

$this->name = preg_replace('/^Interface/i', '', get_class($this));
$this->family = "demo";
$this->family = "ATM Consulting - CRM";
$this->description = "Triggers of this module are empty functions."
. "They have no effect."
. "They are provided for tutorial purpose only.";
Expand Down Expand Up @@ -99,24 +99,6 @@ public function getVersion()
}
}

/**
* Function called when a Dolibarrr business event is done.
* All functions "run_trigger" are triggered if file
* is inside directory core/triggers
* For old versions compatibility
*
* @param string $action Event action code
* @param Object $object Object
* @param User $user Object user
* @param Translate $langs Object langs
* @param Conf $conf Object conf
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function run_trigger($action, $object, $user, $langs, $conf){
return $this->runTrigger($action, $object, $user, $langs, $conf);
}


/**
* Function called when a Dolibarrr business event is done.
* All functions "run_trigger" are triggered if file
Expand Down