Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Order field detail info. #777

Merged
merged 6 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion docker/envoy_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static_resources:
- express_shipment.ExpressShipment
- field.business_partner.BusinessPartnerInfoService
- field.invoice.InvoiceInfoService
- field.order.OrderInfoService
- field.product.ProductInfoService
- file_management.FileManagement
- general_ledger.GeneralLedger
Expand All @@ -69,7 +70,6 @@ static_resources:
- match_po_receipt_invoice.MatchPORReceiptInvoice
- material_management.MaterialManagement
- notice_management.NoticeManagement
- order.Order
- payment_allocation.PaymentAllocation
- payment_print_export.PaymentPrintExport
- payment.Payment
Expand Down
Binary file modified resources/adempiere-grpc-server.pb
Binary file not shown.
2 changes: 1 addition & 1 deletion resources/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static_resources:
- express_shipment.ExpressShipment
- field.business_partner.BusinessPartnerInfoService
- field.invoice.InvoiceInfoService
- field.order.OrderInfoService
- field.product.ProductInfoService
- file_management.FileManagement
- general_ledger.GeneralLedger
Expand All @@ -66,7 +67,6 @@ static_resources:
- match_po_receipt_invoice.MatchPORReceiptInvoice
- material_management.MaterialManagement
- notice_management.NoticeManagement
- order.Order
- payment_allocation.PaymentAllocation
- payment_print_export.PaymentPrintExport
- payment.Payment
Expand Down
159 changes: 0 additions & 159 deletions src/main/java/org/spin/grpc/service/OrderInfo.java

This file was deleted.

133 changes: 133 additions & 0 deletions src/main/java/org/spin/grpc/service/field/order/OrderInfoConvert.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/************************************************************************************
* Copyright (C) 2018-present E.R.P. Consultores y Asociados, C.A. *
* Contributor(s): Elsio Sanchez elsiosanches@gmail.com *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
************************************************************************************/

package org.spin.grpc.service.field.order;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.adempiere.core.domains.models.I_C_Order;
import org.compiere.model.MOrder;
import org.compiere.util.Env;
import org.spin.backend.grpc.field.order.OrderInfo;
import org.spin.service.grpc.util.value.NumberManager;
import org.spin.service.grpc.util.value.TimeManager;
import org.spin.service.grpc.util.value.ValueManager;

/**
* @author Elsio Sanchez elsiosanches@gmail.com, https://github.com/elsiosanchez
* Service for backend of Product Info field
*/
public class OrderInfoConvert {

public static OrderInfo.Builder convertOrderInfo(ResultSet rs) throws SQLException {
OrderInfo.Builder builder = OrderInfo.newBuilder();
if (rs == null) {
return builder;
}
int orderId = rs.getInt(
I_C_Order.COLUMNNAME_C_Order_ID
);
MOrder order = new MOrder(Env.getCtx(), orderId, null);

builder.setId(
rs.getInt(
I_C_Order.COLUMNNAME_C_Order_ID
)
)
.setUuid(
ValueManager.validateNull(
rs.getString(
I_C_Order.COLUMNNAME_UUID
)
)
)
.setDisplayValue(
ValueManager.validateNull(
order.getDisplayValue()
)
)
.setBusinessPartner(
ValueManager.validateNull(
rs.getString("BusinessPartner")
)
)
.setDateOrdered(
TimeManager.convertDateToValue(
rs.getTimestamp(
I_C_Order.COLUMNNAME_DateOrdered
)
)
)
.setDocumentNo(
ValueManager.validateNull(
rs.getString(
I_C_Order.COLUMNNAME_DocumentNo
)
)
)
.setCurrency(
ValueManager.validateNull(
rs.getString("Currency")
)
)
.setGrandTotal(
NumberManager.getBigDecimalToString(
rs.getBigDecimal(
I_C_Order.COLUMNNAME_GrandTotal
)
)
)
.setConvertedAmount(
NumberManager.getBigDecimalToString(
rs.getBigDecimal("currencyBase")
)
)
.setIsSalesTransaction(
rs.getBoolean(
I_C_Order.COLUMNNAME_IsSOTrx
)
)

.setIsDelivered(
rs.getBoolean(
I_C_Order.COLUMNNAME_IsDelivered
)
)
.setDescription(
ValueManager.validateNull(
rs.getString(
I_C_Order.COLUMNNAME_Description
)
)
)
.setPoReference(
ValueManager.validateNull(
rs.getString(
I_C_Order.COLUMNNAME_POReference
)
)
)
.setDocumentStatus(
ValueManager.validateNull(
rs.getString(I_C_Order.COLUMNNAME_DocStatus)
// I_C_Order.COLUMNNAME_DocStatus
)
)
;

return builder;
}
}
Loading
Loading