Add doc comment, and add field date_reception in commande_fournisseur

for #34975
This commit is contained in:
ldestailleur 2025-08-17 01:45:34 +02:00
parent a9c827d811
commit 01d168afb7
8 changed files with 27 additions and 19 deletions

View file

@ -1141,7 +1141,7 @@ class Conf extends stdClass
}
// Use a SCA ready workflow with Stripe module (STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION by default if nothing defined)
if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && !getDolGlobalString('STRIPE_USE_NEW_CHECKOUT')) {
$this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
}

View file

@ -182,7 +182,7 @@ class CommandeFournisseur extends CommonOrder
public $methode_commande;
/**
* @var null|int|'' Expected Delivery Date
* @var null|int|'' Expected planned Delivery Date
*/
public $delivery_date;

View file

@ -48,6 +48,8 @@ ALTER TABLE llx_paiement_extrafields ADD UNIQUE INDEX uk_paiement_extrafields (f
ALTER TABLE llx_commande ADD COLUMN ip varchar(250);
ALTER TABLE llx_commande ADD COLUMN user_agent varchar(255);
ALTER TABLE llx_commande_fournisseur ADD COLUMN date_reception datetime default NULL;
ALTER TABLE llx_c_currencies ADD COLUMN max_decimal_unit tinyint NULL; -- Number of decimal in this currency for unit prices
ALTER TABLE llx_c_currencies ADD COLUMN max_decimal_tot tinyint NULL; -- Number of decimal in this currency for total prices

View file

@ -33,11 +33,11 @@ create table llx_commande_fournisseur
fk_projet integer DEFAULT 0, -- project id
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_creation datetime, -- date de creation
date_valid datetime, -- date de validation
date_approve datetime, -- date de approve
date_approve2 datetime, -- date de approve 2 (when double approving is accivated)
date_commande date, -- date de la commande
date_creation datetime, -- date of creation
date_valid datetime, -- date of validation
date_approve datetime, -- date of approval
date_approve2 datetime, -- date of approval 2 (when double approving is accivated)
date_commande date, -- date of purchase order
fk_user_author integer, -- user making creation
fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating
@ -59,11 +59,12 @@ create table llx_commande_fournisseur
model_pdf varchar(255),
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
date_livraison datetime default NULL,
fk_account integer, -- bank account
fk_cond_reglement integer, -- condition de reglement
fk_mode_reglement integer, -- mode de reglement
fk_input_method integer default 0, -- id coming from c_input_reason, '0' if no defined
date_livraison datetime default NULL, -- date planned of delivery (expected shipment date)
date_reception datetime default NULL, -- date of real final reception (when everything is received)
fk_account integer, -- bank account
fk_cond_reglement integer, -- condition de reglement
fk_mode_reglement integer, -- mode de reglement
fk_input_method integer default 0, -- id coming from c_input_reason, '0' if no defined
fk_incoterms integer, -- for incoterms
location_incoterms varchar(255), -- for incoterms
import_key varchar(14),

View file

@ -352,6 +352,10 @@ if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypa
//}
if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe')) {
require_once DOL_DOCUMENT_ROOT.'/stripe/config.php'; // This include also /stripe/lib/stripe.lib.php, /includes/stripe/stripe-php/init.php, ...
/**
* @var array<strint,mixed> $stripearrayofkeys
* @var array<int,mixed> $stripearrayofkeysbyenv
*/
}
// Initialize $validpaymentmethod
@ -2722,7 +2726,7 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme
?>
var paymentElement = elements.create("payment");
// Add an instance of the card Element into the `card-element` <div>
// Add an instance of the card Element into the div #payment-element
paymentElement.mount("#payment-element");
// Handle form submission
@ -2795,7 +2799,7 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme
?>
var cardElement = elements.create('card', {style: style});
// Add an instance of the card Element into the `card-element` <div>
// Add an instance of the card Element into the div #card-element
cardElement.mount('#card-element');
// Handle real-time validation errors from the card Element.

View file

@ -756,7 +756,7 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P
return -1;
}
}
} elseif ($event->type == 'checkout.session.completed') { // Called when making payment with new Checkout method ($conf->global->STRIPE_USE_NEW_CHECKOUT is on).
} elseif ($event->type == 'checkout.session.completed') { // Called when making payment with new Checkout method (getDolGlobalString('STRIPE_USE_NEW_CHECKOUT') is on).
// TODO: create fees
} elseif ($event->type == 'payment_method.attached') {
dol_syslog("object = ".var_export($event->data, true));

View file

@ -22,8 +22,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/stripe/config.php'; // This set stripe global env
require_once DOL_DOCUMENT_ROOT.'/stripe/config.php'; // This set stripe global $stripearrayofkeys and $stripearrayofkeysbyenv
/**
* @var array<strint,mixed> $stripearrayofkeys
* @var array<int,mixed> $stripearrayofkeysbyenv
*/
/**
* Stripe class

View file

@ -28,8 +28,6 @@
require_once DOL_DOCUMENT_ROOT.'/includes/stripe/stripe-php/init.php';
require_once DOL_DOCUMENT_ROOT.'/includes/stripe/stripe-php/lib/Stripe.php';
//global $stripe;
global $conf;
global $stripearrayofkeysbyenv;
$stripearrayofkeysbyenv = array(