diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 268463f1e7d..eb43da88a4b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -207,12 +207,8 @@ if (empty($reshook)) { $objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone. We use native clone to keep this->db valid. $objectutil->date = dol_mktime(12, 0, 0, GETPOST('newdatemonth', 'int'), GETPOST('newdateday', 'int'), GETPOST('newdateyear', 'int')); - $objectutil->socid = $socid; - - $targetThirdPartyVat = GETPOSTISSET('targetThirdPartyVat'); - $result = $objectutil->createFromClone($user, $id, $targetThirdPartyVat); - + $result = $objectutil->createFromClone($user, $id); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result); exit(); @@ -4178,10 +4174,9 @@ if ($action == 'create') { // Create an array for form $formquestion = array( array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company($object->socid, 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', 1)), - array('type' => 'date', 'name' => 'newdate', 'label' => $langs->trans("Date"), 'value' => dol_now()), - array('type' => 'checkbox', 'name' => 'targetThirdPartyVat', 'label' => $langs->trans("targetThirdPartyVat"), 'value' => 0 ), + array('type' => 'date', 'name' => 'newdate', 'label' => $langs->trans("Date"), 'value' => dol_now()) ); - // Ask confirmation to clone + // Ask confirmatio to clone $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250); } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fb6a59ef3da..ec8e4a93b80 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1192,7 +1192,7 @@ class Facture extends CommonInvoice * @param int $fromid Id of object to clone * @return int New id of clone */ - public function createFromClone(User $user, $fromid = 0, $targetThirdPartyVat = false) + public function createFromClone(User $user, $fromid = 0) { global $conf, $hookmanager; @@ -1277,14 +1277,6 @@ class Facture extends CommonInvoice $object->lines[$i]->ref_ext = ''; // Do not clone ref_ext } - // we have a different thirdparty selected and we checked $targetThirdPartyVat - if ($objFrom->socid != $object->socid && $targetThirdPartyVat) { - global $mysoc; - - foreach ($object->lines as $line) { - $line->tva_tx = get_default_tva($mysoc, $objsoc, $line->fk_product); - } - } // Create clone $object->context['createfromclone'] = 'createfromclone'; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 4d32f48f862..b9b4b111b43 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -609,5 +609,4 @@ NoPaymentAvailable=No payment available for %s PaymentRegisteredAndInvoiceSetToPaid=Payment registered and invoice %s set to paid SendEmailsRemindersOnInvoiceDueDate=Send reminder by email for unpaid invoices MakePaymentAndClassifyPayed=Record payment -BulkPaymentNotPossibleForInvoice=Bulk payment is not possible for invoice %s (bad type or status) -targetThirdPartyVat=Modify the VAT rate to use the default rate depending on the new thirdparty +BulkPaymentNotPossibleForInvoice=Bulk payment is not possible for invoice %s (bad type or status) \ No newline at end of file