Commit 15c215b3 authored by Hakan Uygun's avatar Hakan Uygun

refs #3433 Satış faturalarında stok seviye kontrolü kontrolü düzeltildi

parent f3241508
......@@ -94,7 +94,7 @@ public class LimitationChecker implements Serializable {
}
}
public void stockLevel(int rowKey, Product product, Double quantity,String warehouseCode) {
public void stockLevel(int rowKey, Product product, Double quantity,String warehouseCode, Long docId) {
Double remain = 0d;
String wareCode = "";
ControlType type = getOption(LimitationOptionKey.STOCK_LEVEL);
......@@ -103,6 +103,7 @@ public class LimitationChecker implements Serializable {
filterModel = new ProductTxnFilterModel();
filterModel.setProduct(product);
filterModel.setDocId(docId);
getPrices();
for (Iterator it = warehouseResult.iterator(); it.hasNext();) {
......@@ -236,6 +237,11 @@ public class LimitationChecker implements Serializable {
crit.add(Restrictions.eq("active", true));
//Evrağın kendisini toplam değerlere eklemiyoruz.
if( filterModel.getDocId() != null ){
crit.add(Restrictions.ne("documentId", filterModel.getDocId()));
}
if( filterModel.getBarcode() != null && filterModel.getBarcode().length() > 0 ){
Criterion criteria1 = Restrictions.eq("product.barcode1", filterModel.getBarcode());
Criterion criteria2 = Restrictions.eq("product.barcode2", filterModel.getBarcode());
......
......@@ -1215,7 +1215,12 @@ public class RetailSaleInvoiceHomeBean extends TenderCalculationHomeBean<TekirIn
getLimitationChecker().saleInvoiceZeroLineAmount(i, detail.getTaxExcludedUnitPrice().getValue());
getLimitationChecker().stockLevel(i, detail.getProduct(), detail.getQuantity().getValue(),entity.getWarehouse().getCode());
//İçinde bulunan irsaliytenin ID'sini kontrol için gönderiyoruz.
Long id = null;
if( entity.getShipmentList().size() > 0 ){
id = entity.getShipmentList().get(0).getId();
}
getLimitationChecker().stockLevel(i, detail.getProduct(), detail.getQuantity().getValue(),entity.getWarehouse().getCode(), id);
//son satış fiyatlarını güncelliyoruz.
updateLastSalePrices(detail);
......
......@@ -1311,7 +1311,12 @@ public class SaleInvoiceHomeBean extends TenderCalculationHomeBean<TekirInvoice>
getLimitationChecker().saleInvoiceZeroLineAmount(i, detail.getTaxExcludedUnitPrice().getValue());
getLimitationChecker().stockLevel(i, detail.getProduct(), detail.getQuantity().getValue(),entity.getWarehouse().getCode());
//İçinde bulunan irsaliytenin ID'sini kontrol için gönderiyoruz.
Long id = null;
if( entity.getShipmentList().size() > 0 ){
id = entity.getShipmentList().get(0).getId();
}
getLimitationChecker().stockLevel(i, detail.getProduct(), detail.getQuantity().getValue(),entity.getWarehouse().getCode(), id);
//son satış fiyatlarını güncelliyoruz.
if (!entity.getTradeAction().equals(TradeAction.SaleReturn)) {
......
......@@ -42,6 +42,7 @@ public class ProductTxnFilterModel extends DefaultDocumentFilterModel{
private String adverseCode;
private String adverseName;
private WorkBunch workBunch;
private Long docId;
public boolean isEmpty(){
return Strings.isEmpty(barcode) & product == null;
......@@ -152,6 +153,14 @@ public class ProductTxnFilterModel extends DefaultDocumentFilterModel{
public void setWorkBunch(WorkBunch workBunch) {
this.workBunch = workBunch;
}
public Long getDocId() {
return docId;
}
public void setDocId(Long docId) {
this.docId = docId;
}
}
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