Skip to content

Commit

Permalink
- updated dev.json/dev.locks
Browse files Browse the repository at this point in the history
- added missing translations
- psr fixes
- updated package-json's
  • Loading branch information
24198 committed Apr 22, 2021
1 parent 22397d3 commit f688b50
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 18 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"prefer-stable": true,
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.1-dev"
}
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ protected function buildComparisonExpr(
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ marello:
purchase_price.label: Purchase Price
total_price.label: Total Price
organization.label: Organization
delivery_date.label: Delivery Date

inventorylevellogrecord:
id.label: Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ data:
data:
-
type: marelloorderitems
id: '<toString(@marello_order_0->items->first()->id)>'
id: '8da4d8e7-6b25-4c5c-8075-nh3fpu9sca3htc3v'
customer:
data:
type: marellocustomers
Expand All @@ -35,4 +35,27 @@ included:
attributes:
firstName: 'test'
lastName: 'user'
email: '[email protected]'
email: '[email protected]'
-
type: marelloorderitems
id: '8da4d8e7-6b25-4c5c-8075-nh3fpu9sca3htc3v'
attributes:
quantity: 10
productName: '<toString(@product1->name)>'
price: 0
originalPriceInclTax: 0
originalPriceExclTax: 0
purchasePriceIncl: 0
tax: 0
taxPercent: 0.21
rowTotalInclTax: 180.00
rowTotalExclTax: 180.00
relationships:
product:
data:
type: marelloproducts
id: '<toString(@product1->sku)>'
taxCode:
data:
type: marellotaxcodes
id: 'TAX_HIGH'
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,19 @@ public function testMap()
'product' => $product1,
'inventoryBatches' => ['000001' => 5],
'quantity' => $orderItem1->getQuantity(),
'weight' => $product1->getWeight()
'weight' => ($orderItem1->getQuantity() * $product1->getWeight())
]),
$this->getEntity(PackingSlipItem::class, [
'orderItem' => $orderItem2,
'product' => $product2,
'quantity' => $orderItem2->getQuantity(),
'weight' => $product2->getWeight()
'weight' => ($orderItem2->getQuantity() * $product2->getWeight())
]),
$this->getEntity(PackingSlipItem::class, [
'orderItem' => $orderItem3,
'product' => $product3,
'quantity' => $orderItem3->getQuantity(),
'weight' => $product3->getWeight()
'weight' => ($orderItem3->getQuantity() * $product3->getWeight())
]),
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class ChannelPricesDatagridListener
/**
* @param DoctrineHelper $doctrineHelper
*/
public function __construct(DoctrineHelper $doctrineHelper) {
public function __construct(DoctrineHelper $doctrineHelper)
{
$this->doctrineHelper = $doctrineHelper;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class PricesDatagridListener
/**
* @param DoctrineHelper $doctrineHelper
*/
public function __construct(DoctrineHelper $doctrineHelper) {
public function __construct(DoctrineHelper $doctrineHelper)
{
$this->doctrineHelper = $doctrineHelper;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ function (ResultRecord $record) {
}
}
}
}
}
4 changes: 4 additions & 0 deletions src/Marello/Bundle/ProductBundle/Resources/config/oro/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ api:
property_path: taxCode
productstatus:
property_path: status
channelsCodes:
exclude: true
categoriesCodes:
exclude: true
createdAt:
exclude: true
updatedAt:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ marello:
categories.label: Categories
suppliers.label: Suppliers
attribute_family.label: Attribute Family
channels_codes.label: Channel codes
categories_codes.label: Category codes
variant:
label: Variant
entity_label: Variant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ public function buildForm(FormBuilderInterface $builder, array $options)
[
'required' => false,
'label' => 'marello.purchaseorder.expected_delivery_date.label',
'constraints' => [ new GreaterThan(
[
'value' => 'today',
'message' => 'marello.purchaseorder.expected_delivery_date.messages.error.greater_than_date'
])
'constraints' => [
new GreaterThan(
[
'value' => 'today',
'message'
=> 'marello.purchaseorder.expected_delivery_date.messages.error.greater_than_date'
]
)
]
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ marello:
billing_and_shipping.label: Billing & Delivery Info
shipping_address.label: Shipping Address
data.label: Data
due_date.label: Due Date
ui:
continue: Continue
sections:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public function testErrorDueDateCreateAction()
$this->assertHtmlResponseStatusCodeEquals($result, Response::HTTP_OK);

$html = $crawler->html();
$this->assertContains('Due date must be greater than', $html);
$this->assertContains('Expected Delivery date must be greater than today', $html);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ public function createAction(Order $order, Request $request)
}

return [
'form' => $form->createView(),
'form' => $form->createView()
];
} else {

throw new AccessDeniedException(
$this->get('translator')->trans(
'marello.return.returnentity.messages.error.return.cannot_be_returned_without_shipment'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ marello:
channel_type.label: Type
owner.label: Owner
localization.label: Localization
products.label: Products
controller.message.saved: Sales Channel saved
form.select_saleschannels: Select Sales Channels
form.select_saleschannel: Select Sales Channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public function testGetFunctions()
new TwigFunction(
'marello_sales_has_active_channels',
[$this->extension, 'checkActiveChannels']
),
new TwigFunction(
'marello_get_sales_channel_name_by_code',
[$this->extension, 'getChannelNameByCode']
)
],
$this->extension->getFunctions()
Expand Down Expand Up @@ -81,4 +85,41 @@ public function checkActiveChannelsDataProvider()
],
];
}

/**
* @param $expectedChannel
* @param $code
* @param $expectedResult
* @dataProvider getChannelNameByCodeDataProvider
*/
public function testGetChannelNameByCode($expectedChannel, $code, $expectedResult)
{
$this->salesChannelRepository
->expects(static::once())
->method('findOneBy')
->willReturn($expectedChannel);

static::assertEquals($expectedResult, $this->extension->getChannelNameByCode($code));
}

/**
* @return array[]
*/
public function getChannelNameByCodeDataProvider()
{
$channel = new SalesChannel('channel1');
$channel->setCode('test');
return [
'with active channels' => [
'expectedChannel' => $channel,
'code' => 'test',
'expectedResult' => 'channel1',
],
'without active channels' => [
'expectedChannel' => null,
'code' => 'MySalesChannelCode',
'expectedResult' => 'MySalesChannelCode'
],
];
}
}

0 comments on commit f688b50

Please sign in to comment.