Skip to content

Commit

Permalink
Merge branch 'develop' into add_commande_signature
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Jul 17, 2024
2 parents 39a9439 + 8d86f54 commit e688a8f
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 127 deletions.
2 changes: 1 addition & 1 deletion htdocs/admin/pdf_other.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
}
print '</td></tr>';
*/

print '</table>';
print '</div>';
}
Expand Down
74 changes: 40 additions & 34 deletions htdocs/bom/tpl/objectline_create.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,33 @@
print '</td>';
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';

if ($filtertype != 1) {
if ($filtertype != 1) { // Product
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
print '<td class="linecoluseunit left">';
print '<span id="title_units">';
print $langs->trans('Unit');
print '</span></td>';
}
} else { // Service
print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>';
}
if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active
// Qty frozen
print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>';

// Disable stock change
print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>';

// Efficiency
print '<td class="linecollost right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>';
} else {
print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>';
print '<td class="linecolqtyfrozen right">' .$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>';
}

if (isModEnabled('workstation')) {
print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
}
print '<td class="linecoltotalcost right">' . $form->textwithpicto($langs->trans('TotalCost'), '') . '</td>';
// Service and workstations are active
if ($filtertype == 1 && isModEnabled('workstation')) {
print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
}
// Cost
print '<td class="linecoltotalcost right">' . $form->textwithpicto($langs->trans('TotalCost'), '') . '</td>';

print '<td class="linecoledit" colspan="' . $colspan . '">&nbsp;</td>';
print '</tr>';
Expand Down Expand Up @@ -154,55 +162,53 @@
print '<td class="bordertop nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="'.(GETPOSTISSET("qty") ? GETPOST("qty", 'alpha', 2) : 1).'">';
print '</td>';

if ($filtertype != 1) {
if ($filtertype != 1) { // Product
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
$coldisplay++;
print '<td class="nobottom linecoluseunit">';
print '</td>';
}

$coldisplay++;
print '<td class="bordertop nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOST("qty_frozen", 'alpha') ? ' checked="checked"' : '') . '>';
print '</td>';


$coldisplay++;
print '<td class="bordertop nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOST("disable_stock_change", 'alpha') ? ' checked="checked"' : '') . '">';
print '</td>';

$coldisplay++;
print '<td class="bordertop nobottom nowrap linecollost right">';
print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . ((GETPOSTISSET("efficiency") && $action == 'addline') ? GETPOST("efficiency", 'alpha') : 1) . '">';
print '</td>';

$coldisplay++;
print '<td class="bordertop nobottom nowrap linecolcost right">';
print '&nbsp;';
print '</td>';
} else {
} else { // Service
$coldisplay++;
require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
$cUnit = new CUnits($this->db);
$fk_unit_default = $cUnit->getUnitFromCode('h', 'short_label', 'time');
print '<td class="bordertop nobottom nowrap linecolunit">';
print $formproduct->selectMeasuringUnits("fk_unit", "time", $fk_unit_default, 1);
print '</td>';

}
if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active
// Qty frozen
$coldisplay++;
print '<td class="bordertop nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOST("qty_frozen", 'alpha') ? ' checked="checked"' : '') . '>';
print '</td>';

// Disable stock change
$coldisplay++;
print '<td class="bordertop nobottom nowrap linecolworkstation">';
print $formproduct->selectWorkstations('', 'idworkstations', 1);
print '<td class="bordertop nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOST("disable_stock_change", 'alpha') ? ' checked="checked"' : '') . '">';
print '</td>';

// Efficiency
$coldisplay++;
print '<td class="bordertop nobottom nowrap linecollost right">';
print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . ((GETPOSTISSET("efficiency") && $action == 'addline') ? GETPOST("efficiency", 'alpha') : 1) . '">';
print '</td>';
}
// Service and workstations are active
if ($filtertype == 1 && isModEnabled('workstation')) {
$coldisplay++;
print '<td class="bordertop nobottom nowrap linecolcost right">';
print '&nbsp;';
print '<td class="bordertop nobottom nowrap linecolworkstation">';
print $formproduct->selectWorkstations('', 'idworkstations', 1);
print '</td>';
}

// Cost
$coldisplay++;
print '<td class="bordertop nobottom nowrap linecolcost right">';
print '&nbsp;';
print '</td>';


$coldisplay += $colspan;
print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="' . $colspan . '">';
print '<input type="submit" class="button button-add small" name="addline" id="addline" value="' . $langs->trans('Add') . '">';
Expand Down
37 changes: 18 additions & 19 deletions htdocs/bom/tpl/objectline_edit.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,48 +130,47 @@
}
print '</td>';

if ($filtertype != 1) {
if ($filtertype != 1) { // Product
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
$coldisplay++;
print '<td class="nobottom nowrap linecolunit">';
print $formproduct->selectMeasuringUnits("fk_unit", '', (($line->fk_unit) ? $line->fk_unit : ''), 0, 0);
print '</td>';
}

} else { // Service
$coldisplay++;
print '<td class="nobottom nowrap linecolunit">';
print $formproduct->selectMeasuringUnits("fk_unit", "time", ($line->fk_unit) ? $line->fk_unit : '', 0, 0);
print '</td>';
}
if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active
// Qty frozen
$coldisplay++;
print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOSTISSET("qty_frozen") ? (GETPOSTINT('qty_frozen') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')) . '>';
print '</td>';

// Disable stock change
$coldisplay++;
print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOSTISSET('disablestockchange') ? (GETPOSTINT("disable_stock_change") ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')) . '">';
print '</td>';

// Efficiency
$coldisplay++;
print '<td class="nobottom nowrap linecollost right">';
print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . $line->efficiency . '"></td>';
}

$coldisplay++;
print '<td class="nobottom nowrap linecolcostprice right">';
print '</td>';
} else {
$coldisplay++;
print '<td class="nobottom nowrap linecolunit">';
print $formproduct->selectMeasuringUnits("fk_unit", "time", ($line->fk_unit) ? $line->fk_unit : '', 0, 0);
print '</td>';

$coldisplay++;
print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOSTISSET("qty_frozen") ? (GETPOST('qty_frozen', 'int') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')) . '>';
print '</td>';

// Service and workstations are active
if ($filtertype == 1 && isModEnabled('workstation')) {
$coldisplay++;
print '<td class="nobottom nowrap linecolworkstation">';
print $formproduct->selectWorkstations($line->fk_default_workstation, 'idworkstations', 1);
print '</td>';

$coldisplay++;
print '<td class="nobottom nowrap linecolcostprice right">';
print '</td>';
}
// Cost
$coldisplay++;
print '<td class="nobottom nowrap linecolcostprice right">';
print '</td>';

$coldisplay += $colspan;
print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
Expand Down
25 changes: 10 additions & 15 deletions htdocs/bom/tpl/objectline_title.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@
// Qty
print '<td class="linecolqty width100 right">'.$form->textwithpicto($langs->trans('Qty'), ($filtertype != 1) ? $langs->trans("QtyRequiredIfNoLoss") : '').'</td>';

if ($filtertype != 1) {
if ($filtertype != 1) { // Product
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
print '<td class="linecoluseunit"></td>';
}

} else { // Service
print '<td class="linecolunit"></td>';
}
if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active
// Qty frozen
print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>';

Expand All @@ -84,26 +87,18 @@

// Efficiency
print '<td class="linecolefficiency right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>';
}

// Cost
print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td>';
} else {
print '<td class="linecolunit"></td>';

// Qty frozen
print '<td class="linecolqtyfrozen right">' .$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>';

// Service and workstations are active
if ($filtertype == 1 && isModEnabled('workstation')) {
// Workstation
if (isModEnabled('workstation')) {
print '<td class="linecolworkstation">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>';
}

// Cost
print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).'</td>';
}



// Cost
print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td>';

print '<td class="linecoledit" style="width: 10px"></td>'; // No width to allow autodim

Expand Down
53 changes: 26 additions & 27 deletions htdocs/bom/tpl/objectline_view.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formatting role of function price
print '</td>';

if ($filtertype != 1) {
if ($filtertype != 1) { // Product
if (getDolGlobalInt('PRODUCT_USE_UNITS')) { // For product, unit is shown only if option PRODUCT_USE_UNITS is on
print '<td class="linecoluseunit nowrap">';
$label = measuringUnitString($line->fk_unit, '', '', 1);
Expand All @@ -148,21 +148,7 @@
}
print '</td>';
}

print '<td class="linecolqtyfrozen nowrap right">';
$coldisplay++;
echo $line->qty_frozen ? yn($line->qty_frozen) : '';
print '</td>';
print '<td class="linecoldisablestockchange nowrap right">';
$coldisplay++;
echo $line->disable_stock_change ? yn($line->disable_stock_change) : ''; // Yes, it is a quantity, not a price, but we just want the formatting role of function price
print '</td>';

print '<td class="linecolefficiency nowrap right">';
$coldisplay++;
echo $line->efficiency;
print '</td>';
} else {
} else { // Service
// Unit // For services, units are always enabled
print '<td class="linecolunit nowrap">';
$coldisplay++;
Expand All @@ -175,25 +161,38 @@
}

print '</td>';

}
if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active
// Qty frozen
print '<td class="linecolqtyfrozen nowrap right">';
$coldisplay++;
echo $line->qty_frozen ? yn($line->qty_frozen) : '';
print '</td>';

// Work station
if (isModEnabled('workstation')) {
$workstation = new Workstation($object->db);
$res = $workstation->fetch($line->fk_default_workstation);
// Disable stock change
print '<td class="linecoldisablestockchange nowrap right">';
$coldisplay++;
echo $line->disable_stock_change ? yn($line->disable_stock_change) : ''; // Yes, it is a quantity, not a price, but we just want the formatting role of function price
print '</td>';

print '<td class="linecolworkstation nowrap">';
$coldisplay++;
if ($res > 0) {
echo $workstation->getNomUrl(1);
}
print '</td>';
// Efficiency
print '<td class="linecolefficiency nowrap right">';
$coldisplay++;
echo $line->efficiency;
print '</td>';
}

// Service and workstations are active
if ($filtertype == 1 && isModEnabled('workstation')) {
$workstation = new Workstation($object->db);
$res = $workstation->fetch($line->fk_default_workstation);

print '<td class="linecolworkstation nowrap">';
$coldisplay++;
if ($res > 0) {
echo $workstation->getNomUrl(1);
}
print '</td>';
}

// Cost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1356,12 +1356,12 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)

// If CUSTOMER contact defined, we use it
$usecontact = false;
if (getDolGlobalInt('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT')) {
if (!getDolGlobalInt('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT')) {
$arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
} else {
$arrayidcontact = array_merge($object->getIdContact('external', 'CUSTOMER'), $object->getIdContact('external', 'BILLING'));
}
if (count($arrayidcontact) > 0) {
if (is_array($arrayidcontact) && count($arrayidcontact) > 0) {
$usecontact = true;
$result = $object->fetch_contact($arrayidcontact[0]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,8 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
// Get contact
if (getDolGlobalString('DOC_SHOW_FIRST_SALES_REP')) {
$arrayidcontact = $object->getIdContact('internal', 'SALESREPFOLL');
if (count($arrayidcontact) > 0) {

if (is_array($arrayidcontact) && count($arrayidcontact) > 0) {
$usertmp = new User($this->db);
$usertmp->fetch($arrayidcontact[0]);
$posy += 4;
Expand Down Expand Up @@ -1377,12 +1378,12 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)

// If CUSTOMER contact defined on proposal, we use it. Note: Even if this is a supplier object, the code for external contat that follow order is 'CUSTOMER'
$usecontact = false;
if (getDolGlobalInt('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT')) {
if (!getDolGlobalInt('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT')) {
$arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
} else {
$arrayidcontact = array_merge($object->getIdContact('external', 'CUSTOMER'), $object->getIdContact('external', 'BILLING'));
}
if (count($arrayidcontact) > 0) {
if (is_array($arrayidcontact) && count($arrayidcontact) > 0) {
$usecontact = true;
$result = $object->fetch_contact($arrayidcontact[0]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ public function __invoke($className)
if (false !== $includeReference = $this->discover($className))
return $includeReference;

// @CHANGE LDR Reduce cases of conflicts with the messy autoload
//static::thereCanBeOnlyOne();

if (false !== $includeReference = $this->loadAliases($className))
Expand Down
4 changes: 2 additions & 2 deletions htdocs/langs/en_US/admin.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2389,8 +2389,8 @@ INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR C
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
INVOICE_SHOW_SHIPPING_ADDRESS=Show shipping address
INVOICE_SHOW_SHIPPING_ADDRESSMore=Compulsory indication in some countries (France, ...)
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT = Show billing contact on proposal
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACMore = By default the contact only appears for billing
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACTMore=By default the contact only appears for billing
UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID.
IfThisCategoryIsChildOfAnother=If this category is a child of another one
DarkThemeMode=Dark theme mode
Expand Down
Loading

0 comments on commit e688a8f

Please sign in to comment.