// SupplyOrder form updated

This commit is contained in:
bMancone
2012-01-30 10:11:36 +00:00
parent e959ed363b
commit 39f8cfe26a
4 changed files with 35 additions and 7 deletions
+21
View File
@@ -487,6 +487,27 @@ class SupplyOrderCore extends ObjectModel
}
}
/**
* Gets the reference of a given order
*
* @param int $id_supply_order
* @return bool|string
*/
public static function getReferenceById($id_supply_order)
{
if (!$id_supply_order)
return false;
$query = new DbQuery();
$query->select('so.reference');
$query->from('supply_order', 'so');
$query->where('so.id_supply_order = '.(int)$id_supply_order);
$ref = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
return (pSQL($ref));
}
/*********************************\
*
* Webservices Specific Methods
@@ -979,8 +979,15 @@ class AdminSupplyOrdersControllerCore extends AdminController
// checks if supply order reference is unique
if (Tools::isSubmit('reference'))
{
// gets the reference
$ref = pSQL(Tools::getValue('reference'));
if ((int)SupplyOrder::exists($ref) != (int)Tools::getValue('id_supply_order'))
if (Tools::getValue('id_supply_order') != 0 && SupplyOrder::getReferenceById((int)Tools::getValue('id_supply_order')) != $ref)
{
if ((int)SupplyOrder::exists($ref) != 0)
$this->errors[] = Tools::displayError($this->l('The reference has to be unique.'));
}
else if (Tools::getValue('id_supply_order') == 0 && (int)SupplyOrder::exists($ref) != 0)
$this->errors[] = Tools::displayError($this->l('The reference has to be unique.'));
}
+4 -4
View File
@@ -60,19 +60,19 @@ $_LANGPDF['PDF66f6e4bbd0a0af1af6b54763871dd280'] = 'Produits commandés :';
$_LANGPDF['PDF63d5049791d9d79d86e9a108b0a999ca'] = 'Référence';
$_LANGPDF['PDFf107f5a9ee4ecea58d0f29ae7959baa8'] = 'Nom';
$_LANGPDF['PDFc8ba77264f6e923f5ee35abf3108ae7c'] = 'Prix unitaire HT';
$_LANGPDF['PDF3a6a6d37bea2c7567f8599ea88b47930'] = 'Total HT';
$_LANGPDF['PDF3a6a6d37bea2c7567f8599ea88b47930'] = 'Prix HT';
$_LANGPDF['PDF7521172dd37ba56442ea866ac18eb49d'] = 'Avant réduction';
$_LANGPDF['PDF6703aa9936582b4381418f7d523370b4'] = 'Taux de remise';
$_LANGPDF['PDFa61109b693023aed557445989c517982'] = 'Après réduction';
$_LANGPDF['PDF20a34c4e30c5bbe1d3f870ac55f0d831'] = 'Taux TVA';
$_LANGPDF['PDFfa2ce544158555e8f06c69dd9e681832'] = 'Prix TTC';
$_LANGPDF['PDFfa2ce544158555e8f06c69dd9e681832'] = 'Prix TTC ';
$_LANGPDF['PDF716be2c7de31f063369ca297a9928403'] = 'Taxes :';
$_LANGPDF['PDFf4a232c48df10124ee867767a4e7280e'] = 'Base HT';
$_LANGPDF['PDF01a2436b8e3782c1f99e6b26adf901b2'] = 'Montant TVA';
$_LANGPDF['PDF1300f86974cafc2d65eb1f082a26bdf1'] = 'Résumé :';
$_LANGPDF['PDF9b8362e5321f70746e9cb8f615c28d05'] = 'Prix HT (HR)';
$_LANGPDF['PDF627be65d466c88030f7afcfdaf6d794f'] = 'Brut (Avant remise)';
$_LANGPDF['PDF6b9e9f2472786ed1e76005bfc37bc8af'] = 'Remise globale';
$_LANGPDF['PDFa86dc2fff006afd2deb243d7e26b30e7'] = 'Prix HT (RC)';
$_LANGPDF['PDF77c48b105700c87484e3008ca52a8e57'] = 'Net (Après remise)';
$_LANGPDF['PDF699e6bd4690ed3bd5f658052e12aba04'] = 'Montant TVA';
$_LANGPDF['PDF448634536559b1f8aaa975e0aa12b930'] = 'NET A PAYER';
+2 -2
View File
@@ -142,7 +142,7 @@
<div style="font-size: 6pt;">
<table style="width: 30%;">
<tr style="line-height:6px; border: none">
<td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 5px; font-weight: bold;">{l s='Total TE (DE)' pdf='true'}</td>
<td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 5px; font-weight: bold;">{l s='Total TE' pdf='true'} <br /> {l s='(Discount excluded)' pdf='true'}</td>
<td>{$currency->prefix} {$supply_order->total_te} {$currency->suffix}</td>
</tr>
<tr style="line-height:6px; border: none">
@@ -150,7 +150,7 @@
<td>{$currency->prefix} {$supply_order->discount_value_te} {$currency->suffix}</td>
</tr>
<tr style="line-height:6px; border: none">
<td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 5px; font-weight: bold;">{l s='Total TE (DI)' pdf='true'}</td>
<td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 5px; font-weight: bold;">{l s='Total TE' pdf='true'} <br /> {l s='(Discount included)' pdf='true'}</td>
<td>{$currency->prefix} {$supply_order->total_with_discount_te} {$currency->suffix}</td>
</tr>
<tr style="line-height:6px; border: none">