Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
FIX 17.0: supplier invoice template card: buyer and seller swapped in…
… VAT-related function calls (probably a copy-paste from customer invoice templates)
  • Loading branch information
atm-florianm committed Oct 17, 2024
commit 36015f1454744d63a24f382305618a4c9e9600fc
4 changes: 2 additions & 2 deletions htdocs/core/class/commonobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4917,8 +4917,8 @@ public function formAddObjectLine($dateSelector, $seller, $buyer, $defaulttpldir
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
*
* @param string $action Action code
* @param string $seller Object of seller third party
* @param string $buyer Object of buyer third party
* @param Societe $seller Object of seller third party
* @param Societe $buyer Object of buyer third party
* @param int $selected Object line selected
* @param int $dateSelector 1=Show also date range input fields
* @param string $defaulttpldir Directory where to find the template
Expand Down
14 changes: 7 additions & 7 deletions htdocs/fourn/facture/card-rec.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,16 +535,16 @@
$label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : '');

// Update if prices fields are defined
$tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id);
$tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id);
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $prod->id);
$tva_npr = get_default_npr($object->thirdparty, $mysoc, $prod->id);
if (empty($tva_tx)) {
$tva_npr = 0;
}

// Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp'].
$pqp = (GETPOST('pbq', 'int') ? GETPOST('pbq', 'int') : 0);

$datapriceofproduct = $prod->getSellPrice($mysoc, $object->thirdparty, $pqp);
$datapriceofproduct = $prod->getSellPrice($object->thirdparty, $mysoc, $pqp);

$pu_ht = $datapriceofproduct['pu_ht'];
$pu_ttc = $datapriceofproduct['pu_ttc'];
Expand Down Expand Up @@ -659,8 +659,8 @@
$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value

// Local Taxes
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr);
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr);
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr);
$localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr);
$info_bits = 0;
if ($tva_npr) {
$info_bits |= 0x01;
Expand Down Expand Up @@ -1080,7 +1080,7 @@
$disableedit = 1;
$disablemove = 1;
$disableremove = 1;
$object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
$object->printObjectLines('', $object->thirdparty, $mysoc, $lineid, 0); // No date selector for template invoice
}

print "</table>\n";
Expand Down Expand Up @@ -1569,7 +1569,7 @@
$canchangeproduct = 0;

$object->statut = $object->suspended;
$object->printObjectLines($action, $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
$object->printObjectLines($action, $object->thirdparty, $mysoc, $lineid, 0); // No date selector for template invoice
}

// Form to add new line
Expand Down