diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 831eb3f52ad..e11d47face0 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -677,13 +677,14 @@ else if ($action == 'add' && $user->rights->facture->creer) $id = $object->create($user); - if(GETPOST('invoiceAvoirWithLines', 'int')==1 && $id>0) { - + if (GETPOST('invoiceAvoirWithLines', 'int')==1 && $id>0) + { $facture_source = new Facture($db); // fetch origin object - if($facture_source->fetch($object->fk_facture_source)>0) { - - foreach($facture_source->lines as $line) { + if ($facture_source->fetch($object->fk_facture_source)>0) + { + foreach($facture_source->lines as $line) + { $line->fk_facture = $object->id; $line->subprice =-$line->subprice; // invert price for object @@ -733,14 +734,16 @@ else if ($action == 'add' && $user->rights->facture->creer) } // Standard invoice or Deposit invoice created from a Predefined invoice - if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0) { + if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0) + { $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($datefacture)) { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); } - if (! $error) { + if (! $error) + { $object->socid = GETPOST('socid', 'int'); $object->type = $_POST['type']; $object->number = $_POST['facnumber']; @@ -759,8 +762,10 @@ else if ($action == 'add' && $user->rights->facture->creer) } // Standard or deposit or proforma invoice - if (($_POST['type'] == 0 || $_POST['type'] == 3 || $_POST['type'] == 4) && $_POST['fac_rec'] <= 0) { - if (GETPOST('socid', 'int') < 1) { + if (($_POST['type'] == 0 || $_POST['type'] == 3 || $_POST['type'] == 4) && $_POST['fac_rec'] <= 0) + { + if (GETPOST('socid', 'int') < 1) + { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); } @@ -771,7 +776,8 @@ else if ($action == 'add' && $user->rights->facture->creer) setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); } - if (! $error) { + if (! $error) + { // Si facture standard $object->socid = GETPOST('socid', 'int'); $object->type = GETPOST('type'); @@ -2014,7 +2020,7 @@ if ($action == 'create') // Standard invoice print '