19 if((isset(
$arFields[
"PURCHASING_PRICE"])))
21 $arFields[
"PURCHASING_PRICE"] = preg_replace(
"|\s|",
'',
$arFields[
"PURCHASING_PRICE"]);
31 foreach(
GetModuleEvents(
"catalog",
"OnBeforeCatalogStoreDocsElementUpdate",
true) as $arEvent)
35 if($id < 0 || !self::CheckFields(
'UPDATE',
$arFields))
38 $strUpdate =
$DB->PrepareUpdate(
"b_catalog_docs_element",
$arFields);
39 $strSql =
"UPDATE b_catalog_docs_element SET ".$strUpdate.
" WHERE ID = ".$id;
40 if(!
$DB->Query($strSql,
true))
43 foreach(
GetModuleEvents(
"catalog",
"OnCatalogStoreDocsElementUpdate",
true) as $arEvent)
48 public static function delete($id)
54 foreach(
GetModuleEvents(
"catalog",
"OnBeforeCatalogStoreDocsElementDelete",
true) as $arEvent)
58 $DB->Query(
"DELETE FROM b_catalog_docs_barcode WHERE DOC_ELEMENT_ID = ".$id.
" ",
true);
59 $DB->Query(
"DELETE FROM b_catalog_docs_element WHERE ID = ".$id.
" ",
true);
61 foreach(
GetModuleEvents(
"catalog",
"OnCatalogStoreDocsElementDelete",
true) as $arEvent)
static deleteByDocument(int $id)
static update($id, $arFields)
static OnDocumentBarcodeDelete($id)
static CheckFields($action, &$arFields)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
ExecuteModuleEventEx($arEvent, $arParams=[])
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)