wip on adding taxes and price to invoice

This commit is contained in:
Dorian Vabre 2021-04-13 14:32:17 +02:00
parent db8dfb219c
commit 633a3d39c6

View File

@ -284,7 +284,7 @@ if (empty($reshook) && $action == 'add') {
} }
if (!$error) { if (!$error) {
$db->commit(); $db->commit();
$project = new Project($db); $project = new Project($db);
$resultproject = $project->fetch($conference->fk_project); $resultproject = $project->fetch($conference->fk_project);
if ($resultproject < 0){ if ($resultproject < 0){
@ -294,22 +294,22 @@ if (empty($reshook) && $action == 'add') {
global $dolibarr_main_url_root; global $dolibarr_main_url_root;
if (!empty(floatval($project->price_registration))){ if (!empty(floatval($project->price_registration))){
$facture = new Facture($db); $facture = new Facture($db);
//$facture->rowid = ;
//$facture->ref = ;
//$facture->entity = ;
$facture->type = 0; $facture->type = 0;
$facture->socid = $thirdparty->id; $facture->socid = $thirdparty->id;
$facture->paye = 0; $facture->paye = 0;
//$facture->fk_user_modif = ; //@todo price and taxes to add
//$facture->fk_cond_reglement = ; $tva = get_default_tva($mysoc, $thirdparty);
//$facture->tms = ;
//$facture->fk_statut = ;
$facture->date = dol_now(); $facture->date = dol_now();
$resultfacture = $facture->create($user); $resultfacture = $facture->create($user);
//@todo rediriger page paiement if ($resultfacture < 0){
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php'; $error++;
Header("Location: ".$redirection); $errmsg .= $facture->error;
exit; } else {
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php';
Header("Location: ".$redirection);
exit;
}
} else { } else {
// No price has been set // No price has been set
// Validating the subscription // Validating the subscription