View GeneralLedgerSettlementsProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->criteria->params[':cli'] = $this->clientId; | |
$this->criteria->params[':cor'] = $this->correspondenceAccountId; | |
$this->criteria->params[':cdi'] = $this->creditDebitIndicator == 'K' ? 'D' : 'K'; // Invert logic | |
$this->criteria->params[':invcdi'] = $this->creditDebitIndicator; | |
$this->criteria->order = 'd_data ASC, d_dok ASC'; |
View AngularJs: send-manager.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c.sendEmail = function () { | |
c.savingData = true; | |
if (_.isUndefined(c.model.toEmail) && model.templateId === 7) { | |
if (model.agreementIds.length === 1 && model.agreementIds[0] === 0) { | |
//get all employees | |
personnelEmployee.fetchAllWorkingEmployees() | |
.then(function (data) { | |
console.log(data); | |
prepareAndSend(); | |
}) |
View WooComerce - add snipet to e-mail template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add text to template in woocommerce_email_before_order_table hook | |
function filter_woocommerce_email_before_table( $order, $is_admin_email ) { | |
// make filter magic happen here... | |
echo '<h1><strong>Discount used </h1>'; | |
}; | |
add_action( 'woocommerce_email_before_order_table', 'filter_woocommerce_email_before_table', 10, 3 ); |
View AngularJs - Get input by angular.element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myElement = angular.element($document[0].querySelector('.form-control.input-sm.ng-valid.ng-not-empty.ng-dirty.ng-valid-parse.ng-touched')); | |
myElement.trigger('hideCalendar.daterangepicker'); |
View Wordpress - switch on log writing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* enable log writing | |
* // Enable WP_DEBUG mode | |
define( 'WP_DEBUG', true ); | |
// Enable Debug logging to the /wp-content/debug.log file | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', false ); | |
*/ | |
if (!function_exists('write_log')) { |
View woocomerce - add validation on checkout field blur - out of input in JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_footer', 'ybc_javascript_validation' ); | |
function ybc_javascript_validation(){ | |
if( !is_checkout() ) return; | |
?> <script>jQuery(function($){ | |
$('body').on('blur change', '#billing_birthday', function(){ | |
// alert($(this).val()); | |
var formRow = $(this).parents('.form-row'); | |
// if( /\d/.test( $(this).val() ) ) { |
View Woocomerce - get variation name of cart item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_checkout_fields', 'pulse_checkout_fields_validate_birthdate', 9999 ); | |
function pulse_checkout_fields_validate_birthdate( $fields ) { | |
$cart = WC()->cart->get_cart(); | |
foreach ( $cart as $cart_item ) { | |
$variation = wc_get_product($cart_item['variation_id']); | |
$variationFormattedName = $variation->get_formatted_name(); | |
$cartItemVariationIsChildrenRace = (strpos($variationFormattedName, 'Детский')>0); | |
write_log($cartItemVariationIsChildrenRace); | |
View Add filter in Backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
other.country.controller.js: | |
c.possibleCountries = { | |
config: {}, | |
filter: { | |
countryType: 0 | |
}, | |
data: [], | |
}; |
View Add filter to grid through the FrontEnd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.set(c.possibleCountries.filter, ['filters', 'groupOp'], 'AND'); | |
//exclude selected countries | |
_.set(c.possibleCountries.filter, ['filters', 'rules', 'id'], { | |
field: 'id', | |
op: 'ni', | |
data: c.model.countriesTypeIds | |
}); | |
//set filter on EU countries | |
_.set(c.possibleCountries.filter, ['filters', 'rules', 'typeId'], { | |
field: 'typeId', |
View PHP create class without constructor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getSettingsFieldsMap($providerName, $moduleName) | |
{ | |
Yii::import('application.modules.' . $moduleName . '.models.' . $providerName); | |
$reflection = new ReflectionClass($providerName); | |
$instance = $reflection->newInstanceWithoutConstructor(); | |
return $instance->getAttributeConfig(); | |
} |
NewerOlder