wip on adding taxes and price to invoice
This commit is contained in:
parent
db8dfb219c
commit
633a3d39c6
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user