Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ def expireRateAmount() {
}
return success()
}
/**
* Information to update the specific customer code after change service deleteRateAmount to expireRateAmount
* @return
*/
def deleteRateAmount() {
return error('delete rate amount isn\'t possible, please update your code with service name "expireRateAmount" instead "deleteRateAmount"')
}

def updatePartyRate() {
List<GenericValue> partyRates = from('PartyRate').where([partyId: partyId, rateTypeId: rateTypeId]).queryList()
Expand Down
11 changes: 0 additions & 11 deletions applications/accounting/servicedef/services_paymentmethod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -352,17 +352,6 @@ under the License.
<attribute name="processResult" type="String" mode="OUT" optional="false"/>
</service>

<service name="captureBillingAccountPayment" engine="java"
location="org.apache.ofbiz.accounting.payment.PaymentGatewayServices" invoke="captureBillingAccountPayment" auth="true">
<description>Records a settlement or payment of an invoice by a billing account for the given captureAmount</description>
<deprecated use-instead="captureBillingAccountPayments" since="Releases 17.12"/>
<attribute name="invoiceId" type="String" mode="IN" optional="false"/>
<attribute name="billingAccountId" type="String" mode="IN" optional="false"/>
<attribute name="captureAmount" type="BigDecimal" mode="IN" optional="false"/>
<attribute name="orderId" type="String" mode="IN" optional="true"/>
<attribute name="paymentId" type="String" mode="OUT" optional="false"/>
<attribute name="paymentGatewayResponseId" type="String" mode="OUT" optional="true"/>
</service>
<service name="captureBillingAccountPayments" engine="java"
location="org.apache.ofbiz.accounting.payment.PaymentGatewayServices" invoke="captureBillingAccountPayments" auth="true">
<description>Applies (part of) the unapplied payment applications associated to the billing account to the given invoice.</description>
Expand Down
8 changes: 0 additions & 8 deletions applications/accounting/servicedef/services_rate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ under the License.
<override name="periodTypeId" default-value="RATE_HOUR"/>
<override name="partyId" default-value="_NA_"/>
</service>
<service name="deleteRateAmount" default-entity-name="RateAmount" engine="groovy" auth="true"
location="component://accounting/groovyScripts/rate/RateServices.groovy" invoke="deleteRateAmount">
<deprecated use-instead="expireRateAmount" since="Release 18.12"/>
<permission-service service-name="acctgBasePermissionCheck" main-action="CREATE"/>
<auto-attributes include="pk" mode="IN" optional="true"/>
<override name="rateTypeId" optional="false"/>
<override name="fromDate" optional="false"/>
</service>
<service name="getRateAmount" default-entity-name="RateAmount" engine="groovy" auth="true"
location="component://accounting/groovyScripts/rate/RateServices.groovy" invoke="getRateAmount">
<description>Get Rate Amount</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1526,93 +1526,6 @@ public static Map<String, Object> processCaptureSplitPayment(DispatchContext dct
return ServiceUtil.returnSuccess();
}

// Deprecated: use captureBillingAccountPayments instead of this.
public static Map<String, Object> captureBillingAccountPayment(DispatchContext dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue) context.get("userLogin");
String invoiceId = (String) context.get("invoiceId");
String billingAccountId = (String) context.get("billingAccountId");
BigDecimal captureAmount = (BigDecimal) context.get("captureAmount");
String orderId = (String) context.get("orderId");
Locale locale = (Locale) context.get("locale");
Map<String, Object> results = ServiceUtil.returnSuccess();

try {
// Note that the partyIdFrom of the Payment should be the partyIdTo of the invoice, since you're receiving a payment from the party you billed
GenericValue invoice = EntityQuery.use(delegator).from("Invoice").where("invoiceId", invoiceId).queryOne();
Map<String, Object> paymentParams = UtilMisc.<String, Object>toMap("paymentTypeId", "CUSTOMER_PAYMENT", "paymentMethodTypeId", "EXT_BILLACT",
"partyIdFrom", invoice.getString("partyId"), "partyIdTo", invoice.getString("partyIdFrom"),
"statusId", "PMNT_RECEIVED", "effectiveDate", UtilDateTime.nowTimestamp());
paymentParams.put("amount", captureAmount);
paymentParams.put("currencyUomId", invoice.getString("currencyUomId"));
paymentParams.put("userLogin", userLogin);
Map<String, Object> tmpResult = dispatcher.runSync("createPayment", paymentParams);
if (ServiceUtil.isError(tmpResult)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(tmpResult));
}

String paymentId = (String) tmpResult.get("paymentId");
tmpResult = dispatcher.runSync("createPaymentApplication", UtilMisc.<String, Object>toMap("paymentId", paymentId, "invoiceId", invoiceId, "billingAccountId", billingAccountId,
"amountApplied", captureAmount, "userLogin", userLogin));
if (ServiceUtil.isError(tmpResult)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(tmpResult));
}
if (paymentId == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"AccountingNoPaymentCreatedForInvoice",
UtilMisc.toMap("invoiceId", invoiceId, "billingAccountId", billingAccountId), locale));
}
results.put("paymentId", paymentId);

if (orderId != null && captureAmount.compareTo(BigDecimal.ZERO) > 0) {
// Create a paymentGatewayResponse, if necessary
GenericValue order = EntityQuery.use(delegator).from("OrderHeader").where("orderId", orderId).queryOne();
if (order == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"AccountingNoPaymentGatewayResponseCreatedForInvoice",
UtilMisc.toMap("invoiceId", invoiceId, "billingAccountId", billingAccountId,
"orderId", orderId), locale));
}
// See if there's an orderPaymentPreference - there should be only one OPP for EXT_BILLACT per order
GenericValue orderPaymentPreference = EntityQuery.use(delegator).from("OrderPaymentPreference").where("orderId", orderId, "paymentMethodTypeId", "EXT_BILLACT").queryFirst();
if (orderPaymentPreference != null) {

// Check the productStore setting to see if we need to do this explicitly
GenericValue productStore = order.getRelatedOne("ProductStore", false);
if (productStore.getString("manualAuthIsCapture") == null || (! "Y".equalsIgnoreCase(productStore.getString("manualAuthIsCapture")))) {
String responseId = delegator.getNextSeqId("PaymentGatewayResponse");
GenericValue pgResponse = delegator.makeValue("PaymentGatewayResponse");
pgResponse.set("paymentGatewayResponseId", responseId);
pgResponse.set("paymentServiceTypeEnumId", CAPTURE_SERVICE_TYPE);
pgResponse.set("orderPaymentPreferenceId", orderPaymentPreference.getString("orderPaymentPreferenceId"));
pgResponse.set("paymentMethodTypeId", "EXT_BILLACT");
pgResponse.set("transCodeEnumId", "PGT_CAPTURE");
pgResponse.set("amount", captureAmount);
pgResponse.set("currencyUomId", invoice.getString("currencyUomId"));
pgResponse.set("transactionDate", UtilDateTime.nowTimestamp());
// referenceNum holds the relation to the order.
// todo: Extend PaymentGatewayResponse with a billingAccountId field?
pgResponse.set("referenceNum", billingAccountId);

// save the response
savePgr(dctx, pgResponse);

// Update the orderPaymentPreference
orderPaymentPreference.set("statusId", "PAYMENT_SETTLED");
orderPaymentPreference.store();

results.put("paymentGatewayResponseId", responseId);
}
}
}
} catch (GenericEntityException | GenericServiceException ex) {
return ServiceUtil.returnError(ex.getMessage());
}

return results;
}

public static Map<String, Object> captureBillingAccountPayments(DispatchContext dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
String invoiceId = (String) context.get("invoiceId");
Expand Down
4 changes: 2 additions & 2 deletions applications/humanres/minilang/HumanResServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@
<now-timestamp field="lookedUpValue.thruDate"/>
<store-value value-field="lookedUpValue"/>

<set-service-fields service-name="deleteRateAmount" map="parameters" to-map="delRateAmount"/>
<set-service-fields service-name="expireRateAmount" map="parameters" to-map="delRateAmount"/>
<set field="delRateAmount.fromDate" from-field="parameters.rateAmountFromDate"/>
<call-service service-name="deleteRateAmount" in-map-name="delRateAmount"/>
<call-service service-name="expireRateAmount" in-map-name="delRateAmount"/>
</simple-method>

<simple-method method-name="createEmplLeave" short-description="Create Employee Leave">
Expand Down
24 changes: 0 additions & 24 deletions applications/marketing/servicedef/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,11 @@ under the License.
</service>

<!-- MarketingCampaignPrice Services -->
<service name="addPriceRuleToMarketingCampaign" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="create" auth="true">
<deprecated since="Release 18.12" use-instead="createMarketingCampaignPrice">
Renaming service to respect service name best practice
</deprecated>
<implements service="createMarketingCampaignPrice"/>
</service>
<service name="createMarketingCampaignPrice" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="create" auth="true">
<description>Add PriceRule to MarketingCampaign</description>
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
</service>
<service name="removePriceRuleFromMarketingCampaign" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="delete" auth="true">
<deprecated since="Release 18.12" use-instead="deleteMarketingCampaignPrice">
Renaming service to respect service name best practice
</deprecated>
<implements service="deleteMarketingCampaignPrice"/>
</service>
<service name="updateMarketingCampaignPrice" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="update" auth="true">
<description>Update PriceRule to MarketingCampaign</description>
<auto-attributes include="pk" mode="IN" optional="false"/>
Expand All @@ -77,23 +65,11 @@ under the License.
</service>

<!-- MarketingCampaignPromo Services -->
<service name="addPromoToMarketingCampaign" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="create" auth="true">
<deprecated since="Release 18.12" use-instead="createMarketingCampaignPromo">
Renaming service to respect service name best practice
</deprecated>
<implements service="createMarketingCampaignPromo"/>
</service>
<service name="createMarketingCampaignPromo" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="create" auth="true">
<description>Add Promo to MarketingCampaign</description>
<auto-attributes include="pk" mode="IN" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
</service>
<service name="removePromoFromMarketingCampaign" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="delete" auth="true">
<deprecated since="Release 18.12" use-instead="deleteMarketingCampaignPromo">
Renaming service to respect service name best practice
</deprecated>
<implements service="deleteMarketingCampaignPromo"/>
</service>
<service name="updateMarketingCampaignPromo" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="update" auth="true">
<description>Update Promo to MarketingCampaign</description>
<auto-attributes include="pk" mode="IN" optional="false"/>
Expand Down
7 changes: 0 additions & 7 deletions applications/order/servicedef/services_quote.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,6 @@ under the License.
<auto-attributes include="pk" mode="IN" optional="true"/>
</service>

<!--Duplicate the service createQuoteWorkEffort, the first inform the deprecation, the second override and work normally-->
<service name="createQuoteWorkEffort" default-entity-name="QuoteWorkEffort" engine="entity-auto" invoke="create" auth="true">
<deprecated use-instead="ensureWorkEffortAndCreateQuoteWorkEffort" since="Release 18.12">
use createQuoteWorkEffort to create a workeffort has been deprecated for best pratice naming reason, use ensureWorkEffortAndCreateQuoteWorkEffort instead.
Now createQuoteWorkEffort work as a crud service on QuoteWorkEffort
</deprecated>
</service>
<service name="createQuoteWorkEffort" default-entity-name="QuoteWorkEffort" engine="entity-auto" invoke="create" auth="true">
<description>Create a new QuoteWorkEffort</description>
<required-permissions join-type="AND">
Expand Down