Commit f3241508 by Hakan Uygun

refs #4670 Alış faturasından barkod kuyruğuna bilgi gönderme yeteneği

parent 8cd86b46
......@@ -139,6 +139,8 @@ public interface PurchaseInvoiceHome<E> extends IEntityBase<E> {
boolean hasWarningOrRequiredLimitation();
boolean hasRequiredLimitation();
LimitationMessages getLimitationMessages();
void sendToBarcodeSpool();
ControlType getOption(OptionKey key);
......
......@@ -12,6 +12,7 @@
package com.ut.tekir.invoice.yeni;
import com.ut.tekir.entities.BarcodeTxn;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
......@@ -59,6 +60,8 @@ import com.ut.tekir.entities.Product;
import com.ut.tekir.entities.ProductType;
import com.ut.tekir.entities.Quantity;
import com.ut.tekir.entities.ReturnInvoiceStatus;
import com.ut.tekir.entities.ShipmentItem;
import com.ut.tekir.entities.ShipmentNote;
import com.ut.tekir.entities.TaxEmbeddable;
import com.ut.tekir.entities.TenderDetailBase;
import com.ut.tekir.entities.TradeAction;
......@@ -91,6 +94,7 @@ import com.ut.tekir.tender.PosPrinterHome;
import com.ut.tekir.tender.PriceProvider;
import com.ut.tekir.tender.TenderCalculationHomeBean;
import com.ut.tekir.util.Utils;
import org.jboss.seam.international.StatusMessage;
//FIXME: fatura kapatma işlemlerini düzenlemek gerek.
......@@ -1967,5 +1971,35 @@ public class PurchaseInvoiceHomeBean extends TenderCalculationHomeBean<TekirInvo
}
return documentPrint;
}
/**
* Alış yapılan ürünlerin hepsi için alış miktarında barcode basımı için kuyruğa gönderir.
*/
@Override
public void sendToBarcodeSpool() {
for( TekirInvoiceDetail item : entity.getProductItems() ){
log.info("Sending to barcode pool, product caption :{0}", item.getProduct().getCaption());
try {
BarcodeTxn barcodeTxn = new BarcodeTxn();
barcodeTxn.setProduct(item.getProduct());
barcodeTxn.setUnit(item.getQuantity().getValue().intValue());
entityManager.persist(barcodeTxn);
entityManager.flush();
log.info("Barkod havuzuna başarılı bir şekilde gönderildi. Ürün kodu : {0}", item.getProduct().getCaption());
} catch (Exception e) {
log.error("Hata :{0}", e);
facesMessages.add(StatusMessage.Severity.ERROR,"Barkod havuzuna gönderirken hata meydana geldi.Hata sebebi:\n{0}",e.getMessage());
}
}
facesMessages.add("Barkod havuzuna başarılı bir şekilde gönderildi.");
}
}
\ No newline at end of file
......@@ -335,6 +335,10 @@
</r:panel>
<div class="actionButtons">
<a:commandButton action="#{purchaseInvoiceHome.sendToBarcodeSpool()}" oncomplete="alert('Barkodlar kuyruğa gönderildi.');"
value="#{messages['general.label.BarcodeSpool']}" styleClass="button" rendered="#{s:hasPermission('product', 'barcodeSpool')}" />
<input type="button" onclick="Richfaces.showModalPanel('prntTmpltPop');"
class="button" value="#{messages['general.button.Print']}"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment